{
  "openapi": "3.1.0",
  "info": {
    "title": "La Pyme API",
    "description": "Resources and workflows for purchases, sales, inventory, contacts, products, reports, and settings.",
    "version": "1.0.0",
    "contact": {
      "name": "La Pyme Support",
      "email": "hola@lapyme.com.ar"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://lapyme.com.ar/terminos"
    }
  },
  "servers": [
    {
      "url": "https://api.lapyme.com.ar",
      "description": "Servidor de producción"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "API",
      "description": "Public API operations for La Pyme integrations."
    }
  ],
  "x-speakeasy-retries": {
    "strategy": "backoff",
    "backoff": {
      "initialInterval": 500,
      "maxInterval": 60000,
      "maxElapsedTime": 3600000,
      "exponent": 1.5
    },
    "statusCodes": [
      "5XX"
    ],
    "retryConnectionErrors": true
  },
  "components": {
    "schemas": {
      "ApiErrorDetail": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            }
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "ApiErrorEnvelope": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "error": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "api_error",
                  "authentication_error",
                  "authorization_error",
                  "business_error",
                  "external_dependency_error",
                  "idempotency_error",
                  "invalid_request_error",
                  "rate_limit_error"
                ]
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              },
              "details": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "metadata": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      }
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "type",
              "code",
              "message",
              "retryable",
              "details"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "error"
        ],
        "additionalProperties": false
      },
      "ApiListMetadata": {
        "type": "object",
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ApiOrganization": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "organization"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "legal_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_category": {
            "type": [
              "string",
              "null"
            ]
          },
          "person_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "apartment": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "province_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "postal_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": "string"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "rounding_preference": {
            "type": [
              "string",
              "null"
            ]
          },
          "default_currency": {
            "type": "string",
            "const": "ARS"
          },
          "timezone": {
            "type": "string",
            "const": "UTC-3"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "accounting_circuits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectc549c5f436"
            },
            "description": "Circuitos contables definidos por la organización. Los asientos sin circuito están en General, que no se lista. Usá estos ids en `circuit_id`."
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "slug",
          "legal_name",
          "logo_url",
          "tax_id",
          "tax_id_type",
          "tax_category",
          "person_type",
          "address",
          "apartment",
          "city",
          "province_id",
          "postal_code",
          "country",
          "phone",
          "email",
          "rounding_preference",
          "default_currency",
          "timezone",
          "created_at",
          "updated_at",
          "accounting_circuits"
        ],
        "additionalProperties": false
      },
      "ApiOrganizationResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "organization"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              },
              "legal_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "logo_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "tax_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "tax_id_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "tax_category": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "person_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "address": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "apartment": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "province_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "postal_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "country": {
                "type": "string"
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "rounding_preference": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "default_currency": {
                "type": "string",
                "const": "ARS"
              },
              "timezone": {
                "type": "string",
                "const": "UTC-3"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              },
              "accounting_circuits": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedObjectc549c5f436"
                },
                "description": "Circuitos contables definidos por la organización. Los asientos sin circuito están en General, que no se lista. Usá estos ids en `circuit_id`."
              }
            },
            "required": [
              "object",
              "id",
              "name",
              "slug",
              "legal_name",
              "logo_url",
              "tax_id",
              "tax_id_type",
              "tax_category",
              "person_type",
              "address",
              "apartment",
              "city",
              "province_id",
              "postal_code",
              "country",
              "phone",
              "email",
              "rounding_preference",
              "default_currency",
              "timezone",
              "created_at",
              "updated_at",
              "accounting_circuits"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiTaxRateReference": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "tax_rate_reference"
          },
          "code": {
            "type": "integer"
          },
          "percentage": {
            "type": "number"
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "code",
          "percentage",
          "description"
        ],
        "additionalProperties": false
      },
      "ApiTaxRateReferenceListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "tax_rate_reference"
                },
                "code": {
                  "type": "integer"
                },
                "percentage": {
                  "type": "number"
                },
                "description": {
                  "type": "string"
                }
              },
              "required": [
                "object",
                "code",
                "percentage",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiVoucherTypeReference": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "voucher_type_reference"
          },
          "code": {
            "type": "integer"
          },
          "abbreviation": {
            "type": "string"
          },
          "document_kind": {
            "$ref": "#/components/schemas/ApiSharedEnumd52c0ebb9c"
          },
          "letter": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum10987946fd"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "code",
          "abbreviation",
          "document_kind",
          "letter",
          "description"
        ],
        "additionalProperties": false
      },
      "ApiVoucherTypeReferenceListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "voucher_type_reference"
                },
                "code": {
                  "type": "integer"
                },
                "abbreviation": {
                  "type": "string"
                },
                "document_kind": {
                  "$ref": "#/components/schemas/ApiSharedEnumd52c0ebb9c"
                },
                "letter": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedEnum10987946fd"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": {
                  "type": "string"
                }
              },
              "required": [
                "object",
                "code",
                "abbreviation",
                "document_kind",
                "letter",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiSupplier": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "supplier"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_category": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "is_active": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "company_name",
          "description",
          "email",
          "phone",
          "tax_id",
          "tax_id_type",
          "tax_category",
          "payment_term_id",
          "payment_term_days",
          "is_active",
          "tags"
        ],
        "additionalProperties": false
      },
      "ApiSupplierDetail": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "supplier"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_category": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "is_active": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          },
          "default_account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "province_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "apartment": {
            "type": [
              "string",
              "null"
            ]
          },
          "postal_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "company_name",
          "description",
          "email",
          "phone",
          "tax_id",
          "tax_id_type",
          "tax_category",
          "payment_term_id",
          "payment_term_days",
          "is_active",
          "tags",
          "default_account_id",
          "country",
          "province_id",
          "city",
          "address",
          "apartment",
          "postal_code",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiSupplierMutationRequest": {
        "type": "object",
        "properties": {
          "default_account_id": {
            "description": "Setting or clearing this field also requires treasury:write. Omit it to preserve the default.",
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 70
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "format": "email"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 13
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_id_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum250b15b651"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_category": {
            "$ref": "#/components/schemas/ApiSharedEnumbb2864ecea"
          },
          "country": {
            "type": "string",
            "maxLength": 50
          },
          "province": {
            "type": "string",
            "maxLength": 2
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 70
              },
              {
                "type": "null"
              }
            ]
          },
          "apartment": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10
              },
              {
                "type": "null"
              }
            ]
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 8
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_term_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "ApiSupplierUpdateRequest": {
        "type": "object",
        "properties": {
          "default_account_id": {
            "description": "Setting or clearing this field also requires treasury:write. Omit it to preserve the default.",
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 70
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "format": "email"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 13
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_id_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum250b15b651"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_category": {
            "$ref": "#/components/schemas/ApiSharedEnumbb2864ecea"
          },
          "country": {
            "type": "string",
            "maxLength": 50
          },
          "province": {
            "type": "string",
            "maxLength": 2
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 70
              },
              {
                "type": "null"
              }
            ]
          },
          "apartment": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10
              },
              {
                "type": "null"
              }
            ]
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 8
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_term_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ApiSupplierCreateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "supplier": {
                "$ref": "#/components/schemas/ApiSharedObjecte014df5c78"
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "supplier",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiSupplierUpdateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "supplier": {
                "$ref": "#/components/schemas/ApiSharedObjecte014df5c78"
              }
            },
            "required": [
              "supplier"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiCategory": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "category"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_economic_activity": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "parent_id",
          "default_economic_activity",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiCategoryMutationRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_economic_activity": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{6}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "ApiCategoryCreateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "category": {
                "$ref": "#/components/schemas/ApiSharedObjectf86e1828bb"
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "category",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiCategoryUpdateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "category": {
                "$ref": "#/components/schemas/ApiSharedObjectf86e1828bb"
              }
            },
            "required": [
              "category"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiWarehouse": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "warehouse"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_default": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          },
          "points_of_sale_count": {
            "type": "integer",
            "minimum": 0
          },
          "member_count": {
            "type": "integer",
            "minimum": 0
          },
          "register_count": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "address",
          "is_default",
          "is_active",
          "points_of_sale_count",
          "member_count",
          "register_count"
        ],
        "additionalProperties": false
      },
      "ApiWarehouseDetail": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "warehouse"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_default": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "address",
          "is_default",
          "is_active"
        ],
        "additionalProperties": false
      },
      "ApiWarehouseMutationRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 70
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "is_default": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "ApiWarehouseUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 70
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "is_default": {
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "ApiWarehouseCreateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "warehouse": {
                "$ref": "#/components/schemas/ApiSharedObject743a1706af"
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "warehouse",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiWarehouseUpdateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "warehouse": {
                "$ref": "#/components/schemas/ApiSharedObject743a1706af"
              }
            },
            "required": [
              "warehouse"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseIssue": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "field": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseNormalizedLine": {
        "type": "object",
        "properties": {
          "product_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "unit_cost": {
            "type": "integer",
            "minimum": 0
          },
          "subtotal": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_rate_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "is_exempt": {
            "type": "boolean"
          },
          "discount_percentage": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "purchase_order_item_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum822a963f55"
              },
              {
                "type": "null"
              }
            ]
          },
          "account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "account_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "cost_center1_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center1_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "cost_center2_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center2_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "cost_center3_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center3_name": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "product_id",
          "product_name",
          "sku",
          "name",
          "quantity",
          "unit_cost",
          "subtotal",
          "total",
          "tax_rate_id",
          "is_exempt",
          "discount_percentage",
          "purchase_order_item_id",
          "vat_category",
          "account_id",
          "account_name",
          "cost_center1_id",
          "cost_center1_name",
          "cost_center2_id",
          "cost_center2_name",
          "cost_center3_id",
          "cost_center3_name"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseNormalizedSnapshot": {
        "type": "object",
        "properties": {
          "supplier_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "voucher_type": {
            "type": "integer",
            "minimum": 1
          },
          "supplier_invoice_number": {
            "description": "Numero de comprobante del proveedor. Hasta 120 caracteres.",
            "type": [
              "string",
              "null"
            ]
          },
          "invoice_date": {
            "description": "Fecha del comprobante en formato YYYY-MM-DD.",
            "type": [
              "string",
              "null"
            ]
          },
          "account_date": {
            "description": "Fecha contable de la compra en formato YYYY-MM-DD.",
            "type": [
              "string",
              "null"
            ]
          },
          "due_date": {
            "description": "Fecha de vencimiento en formato YYYY-MM-DD.",
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumd34af90520"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "import_document_role": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum9e7af09974"
              },
              {
                "type": "null"
              }
            ],
            "description": "Rol del comprobante dentro del flujo de importacion."
          },
          "import_source_purchase_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID de la factura comercial asociada al despacho aduanero."
          },
          "import_nationalization_status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumf0d69c3d87"
              },
              {
                "type": "null"
              }
            ],
            "description": "Estado de nacionalizacion de la factura comercial de importacion."
          },
          "customs_dispatch_number": {
            "description": "Numero de despacho aduanero informado por el proveedor. Hasta 32 caracteres.",
            "type": [
              "string",
              "null"
            ]
          },
          "warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "products_received": {
            "type": "boolean"
          },
          "products_returned": {
            "type": "boolean"
          },
          "inventory_effect": {
            "$ref": "#/components/schemas/ApiSharedEnumde48b709b2"
          },
          "update_product_variant_cost": {
            "type": "boolean"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "exchange_rate": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "subtotal": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "discount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "exempt_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "non_taxed_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "base_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_perception_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "national_tax_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "gross_income_tax_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "municipal_tax_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "internal_tax_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "other_tax_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "pdf_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "manual_account_allocations": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject1fb80ddff0"
            }
          }
        },
        "required": [
          "supplier_id",
          "voucher_type",
          "supplier_invoice_number",
          "invoice_date",
          "account_date",
          "due_date",
          "payment_term_id",
          "payment_term_days",
          "import_document_role",
          "import_source_purchase_id",
          "import_nationalization_status",
          "customs_dispatch_number",
          "warehouse_id",
          "products_received",
          "products_returned",
          "inventory_effect",
          "update_product_variant_cost",
          "currency",
          "exchange_rate",
          "subtotal",
          "tax_amount",
          "total",
          "discount",
          "exempt_amount",
          "non_taxed_amount",
          "base_amount",
          "vat_perception_amount",
          "national_tax_amount",
          "gross_income_tax_amount",
          "municipal_tax_amount",
          "internal_tax_amount",
          "other_tax_amount",
          "notes",
          "pdf_path",
          "manual_account_allocations",
          "items"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseProjectedEffects": {
        "type": "object",
        "properties": {
          "inventory": {
            "$ref": "#/components/schemas/ApiSharedObjectb451a3d8de"
          },
          "accounting": {
            "$ref": "#/components/schemas/ApiSharedObjectc482130d79"
          }
        },
        "required": [
          "inventory",
          "accounting"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseCommitResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "purchase_id": {
                "type": "string",
                "format": "uuid"
              },
              "receipt_created": {
                "type": "boolean"
              },
              "idempotent_replay": {
                "type": "boolean"
              },
              "normalized_purchase": {
                "type": "object",
                "properties": {
                  "supplier_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "voucher_type": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "supplier_invoice_number": {
                    "description": "Numero de comprobante del proveedor. Hasta 120 caracteres.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "invoice_date": {
                    "description": "Fecha del comprobante en formato YYYY-MM-DD.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "account_date": {
                    "description": "Fecha contable de la compra en formato YYYY-MM-DD.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "due_date": {
                    "description": "Fecha de vencimiento en formato YYYY-MM-DD.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "payment_term_id": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/ApiSharedEnumd34af90520"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "payment_term_days": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 365,
                        "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "import_document_role": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/ApiSharedEnum9e7af09974"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Rol del comprobante dentro del flujo de importacion."
                  },
                  "import_source_purchase_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "ID de la factura comercial asociada al despacho aduanero."
                  },
                  "import_nationalization_status": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/ApiSharedEnumf0d69c3d87"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Estado de nacionalizacion de la factura comercial de importacion."
                  },
                  "customs_dispatch_number": {
                    "description": "Numero de despacho aduanero informado por el proveedor. Hasta 32 caracteres.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "warehouse_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "products_received": {
                    "type": "boolean"
                  },
                  "products_returned": {
                    "type": "boolean"
                  },
                  "inventory_effect": {
                    "$ref": "#/components/schemas/ApiSharedEnumde48b709b2"
                  },
                  "update_product_variant_cost": {
                    "type": "boolean"
                  },
                  "currency": {
                    "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
                  },
                  "exchange_rate": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "subtotal": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tax_amount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "total": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "discount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "exempt_amount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "non_taxed_amount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "base_amount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "vat_perception_amount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "national_tax_amount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "gross_income_tax_amount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "municipal_tax_amount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "internal_tax_amount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "other_tax_amount": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notes": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "pdf_path": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "manual_account_allocations": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ApiSharedObject1fb80ddff0"
                    }
                  }
                },
                "required": [
                  "supplier_id",
                  "voucher_type",
                  "supplier_invoice_number",
                  "invoice_date",
                  "account_date",
                  "due_date",
                  "payment_term_id",
                  "payment_term_days",
                  "import_document_role",
                  "import_source_purchase_id",
                  "import_nationalization_status",
                  "customs_dispatch_number",
                  "warehouse_id",
                  "products_received",
                  "products_returned",
                  "inventory_effect",
                  "update_product_variant_cost",
                  "currency",
                  "exchange_rate",
                  "subtotal",
                  "tax_amount",
                  "total",
                  "discount",
                  "exempt_amount",
                  "non_taxed_amount",
                  "base_amount",
                  "vat_perception_amount",
                  "national_tax_amount",
                  "gross_income_tax_amount",
                  "municipal_tax_amount",
                  "internal_tax_amount",
                  "other_tax_amount",
                  "notes",
                  "pdf_path",
                  "manual_account_allocations",
                  "items"
                ],
                "additionalProperties": false
              },
              "projected_effects": {
                "type": "object",
                "properties": {
                  "inventory": {
                    "$ref": "#/components/schemas/ApiSharedObjectb451a3d8de"
                  },
                  "accounting": {
                    "$ref": "#/components/schemas/ApiSharedObjectc482130d79"
                  }
                },
                "required": [
                  "inventory",
                  "accounting"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "purchase_id",
              "receipt_created",
              "idempotent_replay",
              "normalized_purchase",
              "projected_effects"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectc671832641"
            }
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseTransactionRequest": {
        "type": "object",
        "properties": {
          "supplier_id": {
            "type": "string",
            "format": "uuid"
          },
          "voucher_type": {
            "type": "integer",
            "minimum": 1
          },
          "import_document_role": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum9e7af09974"
              },
              {
                "type": "null"
              }
            ],
            "description": "Rol del comprobante dentro del flujo de importacion."
          },
          "import_source_purchase_id": {
            "description": "ID de la factura comercial asociada al despacho aduanero.",
            "type": "string",
            "format": "uuid"
          },
          "import_nationalization_status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumf0d69c3d87"
              },
              {
                "type": "null"
              }
            ],
            "description": "Estado de nacionalizacion de la factura comercial de importacion."
          },
          "customs_dispatch_number": {
            "description": "Numero de despacho aduanero informado por el proveedor. Hasta 32 caracteres.",
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "supplier_invoice_number": {
            "description": "Numero de comprobante del proveedor. Hasta 120 caracteres.",
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "invoice_date": {
            "description": "Fecha del comprobante en formato YYYY-MM-DD.",
            "type": "string",
            "format": "date"
          },
          "account_date": {
            "description": "Fecha contable de la compra en formato YYYY-MM-DD.",
            "type": "string",
            "format": "date"
          },
          "due_date": {
            "description": "Fecha de vencimiento en formato YYYY-MM-DD.",
            "type": "string",
            "format": "date"
          },
          "payment_term_id": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedEnumd34af90520"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_perception_amount": {
            "type": "integer",
            "minimum": 0
          },
          "national_tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "gross_income_tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "gross_income_tax_breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject95929ea589"
            }
          },
          "municipal_tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "internal_tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "other_tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "products_received": {
            "type": "boolean"
          },
          "products_returned": {
            "description": "If true, a supplier credit note returns product quantities from the selected warehouse. Requires warehouseId. Invalid on non-credit purchases.",
            "type": "boolean"
          },
          "update_product_variant_cost": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectd4b58bde30"
            }
          },
          "subtotal": {
            "type": "integer",
            "minimum": 0
          },
          "tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "discount": {
            "type": "integer",
            "minimum": 0
          },
          "exempt_amount": {
            "type": "integer",
            "minimum": 0
          },
          "non_taxed_amount": {
            "type": "integer",
            "minimum": 0
          },
          "base_amount": {
            "type": "integer",
            "minimum": 0
          },
          "vat_breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectfb7405a472"
            }
          },
          "manual_account_allocations": {
            "$ref": "#/components/schemas/ApiSharedObjectbea003a73d"
          },
          "notes": {
            "type": "string",
            "maxLength": 1000
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "exchange_rate": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "pdf_path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "vat_category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum822a963f55"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "confirmed"
            ]
          }
        },
        "required": [
          "voucher_type",
          "currency"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseUpdateRequest": {
        "type": "object",
        "properties": {
          "supplier_id": {
            "type": "string",
            "format": "uuid"
          },
          "voucher_type": {
            "type": "integer",
            "minimum": 1
          },
          "import_document_role": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum9e7af09974"
              },
              {
                "type": "null"
              }
            ],
            "description": "Rol del comprobante dentro del flujo de importacion."
          },
          "import_source_purchase_id": {
            "description": "ID de la factura comercial asociada al despacho aduanero.",
            "type": "string",
            "format": "uuid"
          },
          "import_nationalization_status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumf0d69c3d87"
              },
              {
                "type": "null"
              }
            ],
            "description": "Estado de nacionalizacion de la factura comercial de importacion."
          },
          "customs_dispatch_number": {
            "description": "Numero de despacho aduanero informado por el proveedor. Hasta 32 caracteres.",
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "supplier_invoice_number": {
            "description": "Numero de comprobante del proveedor. Hasta 120 caracteres.",
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "invoice_date": {
            "description": "Fecha del comprobante en formato YYYY-MM-DD.",
            "type": "string",
            "format": "date"
          },
          "account_date": {
            "description": "Fecha contable de la compra en formato YYYY-MM-DD.",
            "type": "string",
            "format": "date"
          },
          "due_date": {
            "description": "Fecha de vencimiento en formato YYYY-MM-DD.",
            "type": "string",
            "format": "date"
          },
          "payment_term_id": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedEnumd34af90520"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_perception_amount": {
            "type": "integer",
            "minimum": 0
          },
          "national_tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "gross_income_tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "gross_income_tax_breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject95929ea589"
            }
          },
          "municipal_tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "internal_tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "other_tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "products_received": {
            "type": "boolean"
          },
          "products_returned": {
            "description": "If true, a supplier credit note returns product quantities from the selected warehouse. Requires warehouseId. Invalid on non-credit purchases.",
            "type": "boolean"
          },
          "update_product_variant_cost": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectd4b58bde30"
            }
          },
          "subtotal": {
            "type": "integer",
            "minimum": 0
          },
          "tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "discount": {
            "type": "integer",
            "minimum": 0
          },
          "exempt_amount": {
            "type": "integer",
            "minimum": 0
          },
          "non_taxed_amount": {
            "type": "integer",
            "minimum": 0
          },
          "base_amount": {
            "type": "integer",
            "minimum": 0
          },
          "vat_breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectfb7405a472"
            }
          },
          "manual_account_allocations": {
            "$ref": "#/components/schemas/ApiSharedObjectbea003a73d"
          },
          "notes": {
            "type": "string",
            "maxLength": 1000
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "exchange_rate": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "pdf_path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "vat_category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum822a963f55"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "voucher_type",
          "items",
          "currency"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseTransactionSuccessResponse": {
        "$ref": "#/components/schemas/ApiPurchaseCommitResponse"
      },
      "ApiSaleIssue": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "field": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "ApiSaleNormalizedPayment": {
        "type": "object",
        "properties": {
          "method_id": {
            "type": "string",
            "format": "uuid"
          },
          "amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "fee_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "terminal_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "card_batch_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_coupon_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_installment_plan_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_brand": {
            "type": [
              "string",
              "null"
            ]
          },
          "cash_source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectf61e74f9c5"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "method_id",
          "amount",
          "description",
          "reference",
          "fee_amount",
          "terminal_id",
          "card_batch_number",
          "card_coupon_number",
          "card_installment_plan_code",
          "card_brand",
          "cash_source"
        ],
        "additionalProperties": false
      },
      "ApiSaleNormalizedLine": {
        "type": "object",
        "properties": {
          "product_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumff49232140"
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "unit_price": {
            "type": "integer",
            "minimum": 0
          },
          "unit_cost": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_rate_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "is_exempt": {
            "type": "boolean"
          },
          "discount": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject16c3799d74"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "line_type": {
            "$ref": "#/components/schemas/ApiSharedEnum4e55733f20"
          },
          "cost_center1_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center2_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center3_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "product_id",
          "product_name",
          "sku",
          "warehouse_id",
          "name",
          "product_type",
          "quantity",
          "unit_price",
          "unit_cost",
          "tax_rate_id",
          "is_exempt",
          "discount",
          "notes",
          "account_id",
          "line_type",
          "cost_center1_id",
          "cost_center2_id",
          "cost_center3_id"
        ],
        "additionalProperties": false
      },
      "ApiSaleNormalizedSnapshot": {
        "type": "object",
        "properties": {
          "customer_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "customer_tax_category_override": {
            "type": [
              "string",
              "null"
            ]
          },
          "voucher_type": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 95
              },
              {
                "type": "number",
                "const": 201
              },
              {
                "type": "number",
                "const": 206
              },
              {
                "type": "number",
                "const": 211
              }
            ]
          },
          "point_of_sale_id": {
            "type": "string",
            "format": "uuid"
          },
          "register_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "operator_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "due_date": {
            "type": "string",
            "format": "date"
          },
          "transfer_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum447a859a74"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "exchange_rate": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "same_currency_payment": {
            "type": "boolean"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "subtotal": {
            "type": "integer",
            "minimum": 0
          },
          "tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "exempt_amount": {
            "type": "integer",
            "minimum": 0
          },
          "non_taxed_amount": {
            "type": "integer",
            "minimum": 0
          },
          "tributes_amount": {
            "type": "integer",
            "minimum": 0
          },
          "national_perception_amount": {
            "type": "integer",
            "minimum": 0
          },
          "gross_income_perception_amount": {
            "type": "integer",
            "minimum": 0
          },
          "gross_income_tax_breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject95929ea589"
            }
          },
          "municipal_perception_amount": {
            "type": "integer",
            "minimum": 0
          },
          "internal_tribute_amount": {
            "type": "integer",
            "minimum": 0
          },
          "uncategorized_vat_perception_amount": {
            "type": "integer",
            "minimum": 0
          },
          "other_tribute_amount": {
            "type": "integer",
            "minimum": 0
          },
          "discount_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum539fdceccc"
              },
              {
                "type": "null"
              }
            ]
          },
          "discount_value": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "discount_amount": {
            "type": "integer",
            "minimum": 0
          },
          "balance": {
            "type": "number"
          },
          "is_full_amount_pending": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectd835b52c6b"
            }
          },
          "payment_methods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject3d3dc47592"
            }
          }
        },
        "required": [
          "customer_id",
          "customer_tax_category_override",
          "voucher_type",
          "point_of_sale_id",
          "register_id",
          "operator_id",
          "invoice_date",
          "due_date",
          "transfer_type",
          "service_from",
          "service_to",
          "currency",
          "exchange_rate",
          "same_currency_payment",
          "notes",
          "subtotal",
          "tax_amount",
          "total",
          "exempt_amount",
          "non_taxed_amount",
          "tributes_amount",
          "national_perception_amount",
          "gross_income_perception_amount",
          "gross_income_tax_breakdown",
          "municipal_perception_amount",
          "internal_tribute_amount",
          "uncategorized_vat_perception_amount",
          "other_tribute_amount",
          "discount_type",
          "discount_value",
          "discount_amount",
          "balance",
          "is_full_amount_pending",
          "items",
          "payment_methods"
        ],
        "additionalProperties": false
      },
      "ApiSaleProjectedEffects": {
        "type": "object",
        "properties": {
          "inventory": {
            "$ref": "#/components/schemas/ApiSharedObject6a71e7888b"
          },
          "accounting": {
            "$ref": "#/components/schemas/ApiSharedObject9428e7100c"
          },
          "fiscal": {
            "$ref": "#/components/schemas/ApiSharedObject3563932f8e"
          },
          "payments": {
            "$ref": "#/components/schemas/ApiSharedObject8e516a9b19"
          }
        },
        "required": [
          "inventory",
          "accounting",
          "fiscal",
          "payments"
        ],
        "additionalProperties": false
      },
      "ApiSalePersistedSnapshot": {
        "type": "object",
        "properties": {
          "sale_id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_pdf": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "voucher_type": {
            "type": "string"
          },
          "point_of_sale_id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "formatted_invoice_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoice_status": {
            "$ref": "#/components/schemas/ApiSharedEnum9ac70a3316"
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "due_date": {
            "type": "string",
            "format": "date"
          },
          "currency": {
            "type": "string"
          },
          "subtotal": {
            "type": "integer",
            "minimum": 0
          },
          "tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "exempt_amount": {
            "type": "integer",
            "minimum": 0
          },
          "non_taxed_amount": {
            "type": "integer",
            "minimum": 0
          },
          "tributes_amount": {
            "type": "integer",
            "minimum": 0
          },
          "discount_amount": {
            "type": "integer"
          },
          "balance": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "sale_id",
          "invoice_pdf",
          "customer_id",
          "voucher_type",
          "point_of_sale_id",
          "invoice_number",
          "formatted_invoice_number",
          "invoice_status",
          "invoice_date",
          "due_date",
          "currency",
          "subtotal",
          "tax_amount",
          "total",
          "exempt_amount",
          "non_taxed_amount",
          "tributes_amount",
          "discount_amount",
          "balance",
          "created_at"
        ],
        "additionalProperties": false
      },
      "ApiSaleCommitResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "sale": {
                "type": "object",
                "properties": {
                  "sale_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "invoice_pdf": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "customer_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "voucher_type": {
                    "type": "string"
                  },
                  "point_of_sale_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "invoice_number": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "formatted_invoice_number": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "invoice_status": {
                    "$ref": "#/components/schemas/ApiSharedEnum9ac70a3316"
                  },
                  "invoice_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "due_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "subtotal": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "tax_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "total": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "exempt_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "non_taxed_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "tributes_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "discount_amount": {
                    "type": "integer"
                  },
                  "balance": {
                    "type": "number"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "sale_id",
                  "invoice_pdf",
                  "customer_id",
                  "voucher_type",
                  "point_of_sale_id",
                  "invoice_number",
                  "formatted_invoice_number",
                  "invoice_status",
                  "invoice_date",
                  "due_date",
                  "currency",
                  "subtotal",
                  "tax_amount",
                  "total",
                  "exempt_amount",
                  "non_taxed_amount",
                  "tributes_amount",
                  "discount_amount",
                  "balance",
                  "created_at"
                ],
                "additionalProperties": false
              },
              "normalized_sale": {
                "type": "object",
                "properties": {
                  "customer_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "customer_tax_category_override": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "voucher_type": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 95
                      },
                      {
                        "type": "number",
                        "const": 201
                      },
                      {
                        "type": "number",
                        "const": 206
                      },
                      {
                        "type": "number",
                        "const": 211
                      }
                    ]
                  },
                  "point_of_sale_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "register_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "operator_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "invoice_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "due_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "transfer_type": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/ApiSharedEnum447a859a74"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "service_from": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "service_to": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
                  },
                  "exchange_rate": {
                    "anyOf": [
                      {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "same_currency_payment": {
                    "type": "boolean"
                  },
                  "notes": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "subtotal": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "tax_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "total": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "exempt_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "non_taxed_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "tributes_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "national_perception_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "gross_income_perception_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "gross_income_tax_breakdown": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ApiSharedObject95929ea589"
                    }
                  },
                  "municipal_perception_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "internal_tribute_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "uncategorized_vat_perception_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "other_tribute_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "discount_type": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/ApiSharedEnum539fdceccc"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "discount_value": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "discount_amount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "balance": {
                    "type": "number"
                  },
                  "is_full_amount_pending": {
                    "type": "boolean"
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ApiSharedObjectd835b52c6b"
                    }
                  },
                  "payment_methods": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ApiSharedObject3d3dc47592"
                    }
                  }
                },
                "required": [
                  "customer_id",
                  "customer_tax_category_override",
                  "voucher_type",
                  "point_of_sale_id",
                  "register_id",
                  "operator_id",
                  "invoice_date",
                  "due_date",
                  "transfer_type",
                  "service_from",
                  "service_to",
                  "currency",
                  "exchange_rate",
                  "same_currency_payment",
                  "notes",
                  "subtotal",
                  "tax_amount",
                  "total",
                  "exempt_amount",
                  "non_taxed_amount",
                  "tributes_amount",
                  "national_perception_amount",
                  "gross_income_perception_amount",
                  "gross_income_tax_breakdown",
                  "municipal_perception_amount",
                  "internal_tribute_amount",
                  "uncategorized_vat_perception_amount",
                  "other_tribute_amount",
                  "discount_type",
                  "discount_value",
                  "discount_amount",
                  "balance",
                  "is_full_amount_pending",
                  "items",
                  "payment_methods"
                ],
                "additionalProperties": false
              },
              "projected_effects": {
                "type": "object",
                "properties": {
                  "inventory": {
                    "$ref": "#/components/schemas/ApiSharedObject6a71e7888b"
                  },
                  "accounting": {
                    "$ref": "#/components/schemas/ApiSharedObject9428e7100c"
                  },
                  "fiscal": {
                    "$ref": "#/components/schemas/ApiSharedObject3563932f8e"
                  },
                  "payments": {
                    "$ref": "#/components/schemas/ApiSharedObject8e516a9b19"
                  }
                },
                "required": [
                  "inventory",
                  "accounting",
                  "fiscal",
                  "payments"
                ],
                "additionalProperties": false
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "sale",
              "normalized_sale",
              "projected_effects",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectc671832641"
            }
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiSaleTransactionRequest": {
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_tax_category_override": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "voucher_type": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 95
              },
              {
                "type": "number",
                "const": 201
              },
              {
                "type": "number",
                "const": 206
              },
              {
                "type": "number",
                "const": 211
              }
            ]
          },
          "point_of_sale_id": {
            "type": "string",
            "format": "uuid"
          },
          "register_id": {
            "type": "string",
            "format": "uuid"
          },
          "operator_id": {
            "type": "string",
            "format": "uuid"
          },
          "integration_source": {
            "description": "Fuente de integracion externa para buscar/conciliar la venta. Debe enviarse junto con integrationId.",
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "integration_id": {
            "description": "ID de referencia externa visible en la venta. Debe enviarse junto con integrationSource; no se deriva del header Idempotency-Key.",
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "due_date": {
            "description": "Obligatoria para FCE (201, 206, 211); debe ser igual o posterior a invoiceDate y a la fecha actual en Argentina.",
            "type": "string",
            "format": "date"
          },
          "transfer_type": {
            "description": "Obligatorio para FCE (201, 206, 211). Seleccioná explícitamente SCA o ADC; no hay valor predeterminado.",
            "type": "string",
            "enum": [
              "SCA",
              "ADC"
            ]
          },
          "service_from": {
            "type": "string",
            "format": "date"
          },
          "service_to": {
            "type": "string",
            "format": "date"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "exchange_rate": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "same_currency_payment": {
            "type": "boolean"
          },
          "notes": {
            "type": "string",
            "maxLength": 1000
          },
          "items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "product_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "warehouse_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "unit_cost": {
                  "type": "integer",
                  "minimum": 0
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                },
                "product_type": {
                  "$ref": "#/components/schemas/ApiSharedEnum003ee2d7f5"
                },
                "tax_rate_id": {
                  "type": "integer",
                  "minimum": 0
                },
                "is_exempt": {
                  "type": "boolean"
                },
                "quantity": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "unit_price": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Importe unitario en centavos. Para comprobantes A (1, 2 y 3), enviá el importe neto sin IVA. Para comprobantes a consumidor final, incluidos B (6, 7 y 8) y presupuesto (90), enviá el importe final con IVA incluido."
                },
                "discount": {
                  "$ref": "#/components/schemas/ApiSharedObject16c3799d74"
                },
                "notes": {
                  "type": "string",
                  "maxLength": 1000
                },
                "account_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "line_type": {
                  "$ref": "#/components/schemas/ApiSharedEnum4e55733f20"
                },
                "cost_center1_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "cost_center2_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "cost_center3_id": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "quantity",
                "unit_price"
              ],
              "additionalProperties": false
            }
          },
          "discount_type": {
            "$ref": "#/components/schemas/ApiSharedEnum539fdceccc"
          },
          "discount_value": {
            "type": "number",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "Total final esperado en centavos. La API lo compara con el total canónico antes de crear la venta o cualquier efecto durable."
          },
          "national_perception_amount": {
            "type": "integer",
            "minimum": 0
          },
          "gross_income_perception_amount": {
            "type": "integer",
            "minimum": 0
          },
          "gross_income_tax_breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject95929ea589"
            }
          },
          "municipal_perception_amount": {
            "type": "integer",
            "minimum": 0
          },
          "internal_tribute_amount": {
            "type": "integer",
            "minimum": 0
          },
          "uncategorized_vat_perception_amount": {
            "type": "integer",
            "minimum": 0
          },
          "other_tribute_amount": {
            "type": "integer",
            "minimum": 0
          },
          "payment_methods": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "method_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "amount": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "description": {
                  "type": "string",
                  "maxLength": 255
                },
                "reference": {
                  "type": "string",
                  "maxLength": 255
                },
                "fee_amount": {
                  "type": "integer",
                  "minimum": 0
                },
                "terminal_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "card_batch_number": {
                  "type": "string",
                  "maxLength": 100
                },
                "card_coupon_number": {
                  "type": "string",
                  "maxLength": 100
                },
                "card_installment_plan_code": {
                  "type": "string",
                  "maxLength": 100
                },
                "card_brand": {
                  "type": "string",
                  "maxLength": 100
                },
                "register_id": {
                  "description": "ID de caja para pagos en efectivo. Usá cashSource en integraciones nuevas.",
                  "type": "string",
                  "format": "uuid"
                },
                "safe_id": {
                  "description": "ID de caja fuerte para pagos en efectivo. Usá cashSource en integraciones nuevas.",
                  "type": "string",
                  "format": "uuid"
                },
                "cash_source": {
                  "description": "Origen de efectivo para pagos cash. No combinar con registerId o safeId.",
                  "type": "object",
                  "properties": {
                    "type": {
                      "$ref": "#/components/schemas/ApiSharedEnum459535dab3"
                    },
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "ID de la caja o caja fuerte."
                    }
                  },
                  "required": [
                    "type",
                    "id"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "method_id",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "is_full_amount_pending": {
            "type": "boolean"
          }
        },
        "required": [
          "voucher_type",
          "point_of_sale_id",
          "invoice_date",
          "currency",
          "items",
          "total"
        ],
        "additionalProperties": false,
        "description": "Crea una venta. El tipo de comprobante define cómo se lee items[].unitPrice: neto sin IVA para comprobantes A (1, 2 y 3) y final con IVA incluido para comprobantes a consumidor final como B (6, 7 y 8). total se compara con el total canónico y la venta se rechaza si no coinciden."
      },
      "ApiSaleTransactionSuccessResponse": {
        "$ref": "#/components/schemas/ApiSaleCommitResponse"
      },
      "ApiAccountingEvidence": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "accounting_evidence"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum8b51d9e8f5"
          },
          "journal_entry_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "journal_entries_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject76de9df039"
            }
          }
        },
        "required": [
          "object",
          "status",
          "journal_entry_ids",
          "journal_entries_url",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiAccount": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "account"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "id",
          "code",
          "name"
        ],
        "additionalProperties": false
      },
      "ApiJournalEntryLine": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "journal_entry_line"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "account": {
            "$ref": "#/components/schemas/ApiSharedObject18d478a65b"
          },
          "debit": {
            "type": "integer"
          },
          "credit": {
            "type": "integer"
          },
          "entered_debit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "entered_credit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string"
          },
          "contact": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject4529837fc2"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_centers": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "account",
          "debit",
          "credit",
          "entered_debit",
          "entered_credit",
          "currency",
          "contact",
          "cost_centers",
          "description"
        ],
        "additionalProperties": false
      },
      "ApiJournalEntry": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "journal_entry"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "entry_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": "string"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string"
          },
          "exchange_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "circuit_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Circuito contable del asiento. null es el circuito General."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectbed5d5812a"
            }
          }
        },
        "required": [
          "object",
          "id",
          "entry_number",
          "date",
          "description",
          "reference",
          "source_type",
          "source_id",
          "currency",
          "exchange_rate",
          "circuit_id",
          "created_at",
          "updated_at",
          "lines"
        ],
        "additionalProperties": false
      },
      "ApiJournalEntriesListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "effective_scope": {
            "anyOf": [
              {
                "type": "string",
                "const": "all"
              },
              {
                "$ref": "#/components/schemas/ApiSharedObjectbd6833a5e8"
              }
            ],
            "description": "Circuito sobre el que corrió el reporte: `all` para todos los circuitos, o el circuito pedido (`circuit_id` null es General)."
          },
          "object": {
            "type": "string",
            "const": "list"
          },
          "url": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "journal_entry"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "entry_number": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "description": {
                  "type": "string"
                },
                "reference": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "source_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "source_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "currency": {
                  "type": "string"
                },
                "exchange_rate": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "circuit_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Circuito contable del asiento. null es el circuito General."
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "lines": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiSharedObjectbed5d5812a"
                  }
                }
              },
              "required": [
                "object",
                "id",
                "entry_number",
                "date",
                "description",
                "reference",
                "source_type",
                "source_id",
                "currency",
                "exchange_rate",
                "circuit_id",
                "created_at",
                "updated_at",
                "lines"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "request_id",
          "effective_scope",
          "object",
          "url",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ApiAccountLedgerLine": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "account_ledger_line"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "journal_entry_id": {
            "type": "string",
            "format": "uuid"
          },
          "circuit_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Circuito contable del asiento. null es el circuito General."
          },
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "type": "string"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "counterparty_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center1_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center2_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center3_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "debit": {
            "type": "integer"
          },
          "credit": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "balance": {
            "type": "integer"
          }
        },
        "required": [
          "object",
          "id",
          "date",
          "journal_entry_id",
          "circuit_id",
          "account_id",
          "source_type",
          "source_id",
          "description",
          "reference",
          "counterparty_name",
          "contact_id",
          "cost_center1_id",
          "cost_center2_id",
          "cost_center3_id",
          "debit",
          "credit",
          "currency",
          "balance"
        ],
        "additionalProperties": false
      },
      "ApiAccountLedger": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "account_ledger"
          },
          "account": {
            "$ref": "#/components/schemas/ApiSharedObject18d478a65b"
          },
          "opening_balance": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject308596969e"
            }
          },
          "closing_balance": {
            "type": "integer"
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "account",
          "opening_balance",
          "currency",
          "lines",
          "closing_balance",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ApiAccountLedgerResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "effective_scope": {
            "anyOf": [
              {
                "type": "string",
                "const": "all"
              },
              {
                "$ref": "#/components/schemas/ApiSharedObjectbd6833a5e8"
              }
            ],
            "description": "Circuito sobre el que corrió el reporte: `all` para todos los circuitos, o el circuito pedido (`circuit_id` null es General)."
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "account_ledger"
              },
              "account": {
                "$ref": "#/components/schemas/ApiSharedObject18d478a65b"
              },
              "opening_balance": {
                "type": "integer"
              },
              "currency": {
                "type": "string"
              },
              "lines": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedObject308596969e"
                }
              },
              "closing_balance": {
                "type": "integer"
              },
              "has_more": {
                "type": "boolean"
              },
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "object",
              "account",
              "opening_balance",
              "currency",
              "lines",
              "closing_balance",
              "has_more",
              "next_cursor"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "effective_scope",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiAccountingAccount": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "account"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "$ref": "#/components/schemas/ApiSharedEnum5433445ffc"
          },
          "normal_balance": {
            "$ref": "#/components/schemas/ApiSharedEnum1d20f1f7e9"
          },
          "system_role": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum87e38e3147"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_active": {
            "type": "boolean"
          },
          "is_postable": {
            "type": "boolean"
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "income_statement_category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnuma6084829bf"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_inflation_adjustable": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "id",
          "code",
          "name",
          "description",
          "type",
          "normal_balance",
          "system_role",
          "is_active",
          "is_postable",
          "parent_id",
          "income_statement_category",
          "is_inflation_adjustable"
        ],
        "additionalProperties": false
      },
      "ApiAccountingAccountCreateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "type": {
            "$ref": "#/components/schemas/ApiSharedEnum5433445ffc"
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_postable": {
            "type": "boolean"
          },
          "is_active": {
            "description": "Si se omite, la cuenta se crea activa.",
            "type": "boolean"
          },
          "income_statement_category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnuma6084829bf"
              },
              {
                "type": "null"
              }
            ]
          },
          "system_role": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum87e38e3147"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_inflation_adjustable": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "type",
          "parent_id",
          "is_postable"
        ],
        "additionalProperties": false
      },
      "ApiAccountingAccountPatchRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "type": {
            "$ref": "#/components/schemas/ApiSharedEnum5433445ffc"
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_postable": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          },
          "income_statement_category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnuma6084829bf"
              },
              {
                "type": "null"
              }
            ]
          },
          "system_role": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum87e38e3147"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_inflation_adjustable": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ApiAccountingAccountWriteResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "account"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "$ref": "#/components/schemas/ApiSharedEnum5433445ffc"
              },
              "normal_balance": {
                "$ref": "#/components/schemas/ApiSharedEnum1d20f1f7e9"
              },
              "system_role": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedEnum87e38e3147"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "is_active": {
                "type": "boolean"
              },
              "is_postable": {
                "type": "boolean"
              },
              "parent_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "income_statement_category": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedEnuma6084829bf"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "is_inflation_adjustable": {
                "type": "boolean"
              }
            },
            "required": [
              "object",
              "id",
              "code",
              "name",
              "description",
              "type",
              "normal_balance",
              "system_role",
              "is_active",
              "is_postable",
              "parent_id",
              "income_statement_category",
              "is_inflation_adjustable"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiCostCenterDimension": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "cost_center_dimension"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3
          },
          "is_active": {
            "type": "boolean"
          },
          "is_required": {
            "type": "boolean"
          },
          "show_in_sales": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "position",
          "is_active",
          "is_required",
          "show_in_sales"
        ],
        "additionalProperties": false
      },
      "ApiCostCenter": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "cost_center"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "dimension_id": {
            "type": "string",
            "format": "uuid"
          },
          "dimension_name": {
            "type": "string"
          },
          "dimension_position": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3
          },
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "id",
          "dimension_id",
          "dimension_name",
          "dimension_position",
          "code",
          "name",
          "parent_id",
          "is_active"
        ],
        "additionalProperties": false
      },
      "ApiManualJournalEntryRequest": {
        "type": "object",
        "properties": {
          "occurred_at": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": "string"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "exchange_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "expected_updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "account_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "currency": {
                  "$ref": "#/components/schemas/ApiSharedEnume7d4eca700"
                },
                "debit": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "credit": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "entered_debit": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "entered_credit": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cost_center1_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cost_center2_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cost_center3_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "contact_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "account_id"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "occurred_at",
          "description",
          "lines"
        ],
        "additionalProperties": false
      },
      "ApiManualJournalEntryUpdateRequest": {
        "type": "object",
        "properties": {
          "occurred_at": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": "string"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "exchange_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "expected_updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "unapply_allocated_lines": {
            "type": "boolean"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "account_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "currency": {
                  "$ref": "#/components/schemas/ApiSharedEnume7d4eca700"
                },
                "debit": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "credit": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "entered_debit": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "entered_credit": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cost_center1_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cost_center2_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cost_center3_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "contact_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "account_id"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "occurred_at",
          "description",
          "lines"
        ],
        "additionalProperties": false
      },
      "ApiJournalEntryWriteResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "journal_entry": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "const": "journal_entry"
                  },
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "object",
                  "id"
                ],
                "additionalProperties": false
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "journal_entry"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiInflationAdjustmentPreviewRequest": {
        "type": "object",
        "properties": {
          "period_start": {
            "type": "string",
            "format": "date"
          },
          "closing_date": {
            "type": "string",
            "format": "date"
          },
          "treatments_confirmed": {
            "type": "boolean"
          },
          "account_treatments": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject0e307df43a"
            }
          },
          "opening_balance_bases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectcd635e5b25"
            }
          },
          "index_overrides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjecte224c09452"
            }
          },
          "circuit_id": {
            "description": "Circuito contable que cubre el ajuste y donde se registra: `general` o el id de un circuito de la organización (ver `accounting_circuits` en GET /api/v1/organization). Omitilo para cubrir todos los circuitos y registrar el ajuste en General.",
            "type": "string"
          }
        },
        "required": [
          "period_start",
          "closing_date"
        ],
        "additionalProperties": false
      },
      "ApiInflationAdjustmentCreateRequest": {
        "type": "object",
        "properties": {
          "period_start": {
            "type": "string",
            "format": "date"
          },
          "closing_date": {
            "type": "string",
            "format": "date"
          },
          "treatments_confirmed": {
            "type": "boolean"
          },
          "account_treatments": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject0e307df43a"
            }
          },
          "opening_balance_bases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectcd635e5b25"
            }
          },
          "index_overrides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjecte224c09452"
            }
          },
          "circuit_id": {
            "description": "Circuito contable que cubre el ajuste y donde se registra: `general` o el id de un circuito de la organización (ver `accounting_circuits` en GET /api/v1/organization). Omitilo para cubrir todos los circuitos y registrar el ajuste en General.",
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "period_start",
          "closing_date"
        ],
        "additionalProperties": false
      },
      "ApiTransferIssue": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "field": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "ApiTransferSnapshot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "organization_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "target_warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "transfer_number": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "formatted_transfer_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "transfer_date": {
            "type": "string",
            "format": "date-time"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum736f0d077b"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "updated_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_warehouse": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "target_warehouse": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectfc454d8721"
            }
          }
        },
        "required": [
          "id",
          "organization_id",
          "source_warehouse_id",
          "target_warehouse_id",
          "transfer_number",
          "formatted_transfer_number",
          "transfer_date",
          "notes",
          "status",
          "created_at",
          "updated_at",
          "created_by",
          "updated_by",
          "source_warehouse",
          "target_warehouse",
          "items"
        ],
        "additionalProperties": false
      },
      "ApiStockTransferRequest": {
        "type": "object",
        "properties": {
          "source_warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "target_warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "transfer_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "string",
                "format": "date-time"
              }
            ],
            "description": "Fecha ISO (YYYY-MM-DD) u hora ISO 8601 completa."
          },
          "notes": {
            "type": "string"
          },
          "items": {
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "product_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "required": [
                "product_id",
                "quantity"
              ],
              "additionalProperties": false
            }
          },
          "save_as_draft": {
            "type": "boolean"
          },
          "mark_as_received": {
            "type": "boolean"
          }
        },
        "required": [
          "source_warehouse_id",
          "target_warehouse_id",
          "transfer_date",
          "items"
        ],
        "additionalProperties": false
      },
      "ApiStockTransferSuccessResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "transfer": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "organization_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "source_warehouse_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "target_warehouse_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transfer_number": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "exclusiveMinimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "formatted_transfer_number": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "transfer_date": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "notes": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "$ref": "#/components/schemas/ApiSharedEnum736f0d077b"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "updated_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "created_by": {
                    "type": "string"
                  },
                  "updated_by": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "source_warehouse": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "target_warehouse": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ApiSharedObjectfc454d8721"
                    }
                  }
                },
                "required": [
                  "id",
                  "organization_id",
                  "source_warehouse_id",
                  "target_warehouse_id",
                  "transfer_number",
                  "formatted_transfer_number",
                  "transfer_date",
                  "notes",
                  "status",
                  "created_at",
                  "updated_at",
                  "created_by",
                  "updated_by",
                  "source_warehouse",
                  "target_warehouse",
                  "items"
                ],
                "additionalProperties": false
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "transfer",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectc671832641"
            }
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiSupplierListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "supplier"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "company_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "email": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "phone": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tax_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tax_id_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tax_category": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "payment_term_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "payment_term_days": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 365,
                      "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "is_active": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
                  }
                }
              },
              "required": [
                "object",
                "id",
                "name",
                "company_name",
                "description",
                "email",
                "phone",
                "tax_id",
                "tax_id_type",
                "tax_category",
                "payment_term_id",
                "payment_term_days",
                "is_active",
                "tags"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiSupplierDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObjecte014df5c78"
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiCategoryListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf86e1828bb"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiCategoryDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObjectf86e1828bb"
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiProductListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "category": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "sku": {
                  "type": "string"
                },
                "barcode": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "image_url": {
                  "description": "External product image URL reference. La Pyme displays it best effort and does not copy, ingest, or host the image.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "currency": {
                  "type": "string"
                },
                "cost": {
                  "description": "Product cost in cents. Null when the delegated user cannot view product costs.",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "price": {
                  "type": "number"
                },
                "tax_rate": {
                  "$ref": "#/components/schemas/ApiSharedObjectee5eae48b0"
                },
                "default_supplier": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "product_type": {
                  "$ref": "#/components/schemas/ApiSharedEnumff49232140"
                },
                "visibility": {
                  "$ref": "#/components/schemas/ApiSharedEnuma7f3605118"
                },
                "is_active": {
                  "type": "boolean"
                },
                "organization_slug": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "components": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiSharedObject564df4258f"
                  }
                },
                "effective_price": {
                  "type": "number"
                },
                "price_source": {
                  "$ref": "#/components/schemas/ApiSharedEnumfe93f70a59"
                },
                "applied_price_list": {
                  "$ref": "#/components/schemas/ApiSharedObject3b83f74923"
                },
                "object": {
                  "type": "string",
                  "const": "product"
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
                  }
                }
              },
              "required": [
                "id",
                "name",
                "description",
                "category",
                "sku",
                "barcode",
                "image_url",
                "currency",
                "cost",
                "price",
                "tax_rate",
                "default_supplier",
                "product_type",
                "visibility",
                "is_active",
                "organization_slug",
                "created_at",
                "updated_at",
                "object",
                "tags"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiProductMutationRequest": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ApiSharedObject50a930638e"
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "description": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 500
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "category_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "visibility": {
                "$ref": "#/components/schemas/ApiSharedEnum026059bce8"
              },
              "image_url": {
                "description": "External product image URL reference. La Pyme displays it best effort and does not copy, ingest, or host the image.",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "product_type": {
                "default": "product",
                "type": "string",
                "enum": [
                  "product",
                  "service",
                  "kit"
                ]
              },
              "sku": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "barcode": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 100
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "unit_of_measure": {
                "$ref": "#/components/schemas/ApiSharedEnum5f0db377e3"
              },
              "currency": {
                "$ref": "#/components/schemas/ApiSharedEnumc519f4ab77"
              },
              "cost": {
                "default": 0,
                "type": "integer",
                "minimum": 0
              },
              "price": {
                "description": "Manual sale price in cents. Mutually exclusive with markup_percentage; send price for manual pricing or markup_percentage for markup pricing.",
                "type": "integer",
                "minimum": 0
              },
              "promotional_price": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "markup_percentage": {
                "description": "Markup percentage used to calculate the sale price from cost and organization rounding rules. The price adds the product's IVA rate only when the organization's sales prices include IVA. Mutually exclusive with price; send null to switch back to manual pricing.",
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 10000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tax_rate_id": {
                "default": 5,
                "type": "integer"
              },
              "is_exempt": {
                "default": false,
                "type": "boolean"
              },
              "default_supplier_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "default_sales_account_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "default_purchase_account_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "warehouse_stocks": {
                "default": [],
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedObject6dbe49c4ef"
                }
              },
              "is_active": {
                "default": true,
                "type": "boolean"
              },
              "metafields": {
                "description": "Group-level custom field values addressed by canonical key. Available when custom fields are enabled for the organization.",
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedObject881708c96a"
                }
              }
            },
            "required": [
              "name",
              "sku"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "description": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 500
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "category_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "visibility": {
                "$ref": "#/components/schemas/ApiSharedEnum026059bce8"
              },
              "image_url": {
                "description": "External product image URL reference. La Pyme displays it best effort and does not copy, ingest, or host the image.",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "default_supplier_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "default_sales_account_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "default_purchase_account_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "is_active": {
                "default": true,
                "type": "boolean"
              },
              "metafields": {
                "description": "Group-level custom field values addressed by canonical key. Available when custom fields are enabled for the organization.",
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedObject881708c96a"
                }
              },
              "product_type": {
                "default": "product",
                "type": "string",
                "const": "product"
              },
              "options": {
                "minItems": 1,
                "maxItems": 3,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "description": "Nombres ordenados de las opciones de variantes, por ejemplo Material, Color y Talle."
              },
              "variants": {
                "minItems": 1,
                "maxItems": 250,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "image_url": {
                      "description": "External product image URL reference. La Pyme displays it best effort and does not copy, ingest, or host the image.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sku": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "barcode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 100
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unit_of_measure": {
                      "$ref": "#/components/schemas/ApiSharedEnum5f0db377e3"
                    },
                    "currency": {
                      "$ref": "#/components/schemas/ApiSharedEnumc519f4ab77"
                    },
                    "cost": {
                      "default": 0,
                      "type": "integer",
                      "minimum": 0
                    },
                    "price": {
                      "description": "Manual sale price in cents. Mutually exclusive with markup_percentage; send price for manual pricing or markup_percentage for markup pricing.",
                      "type": "integer",
                      "minimum": 0
                    },
                    "promotional_price": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "markup_percentage": {
                      "description": "Markup percentage used to calculate the sale price from cost and organization rounding rules. The price adds the product's IVA rate only when the organization's sales prices include IVA. Mutually exclusive with price; send null to switch back to manual pricing.",
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 10000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tax_rate_id": {
                      "default": 5,
                      "type": "integer"
                    },
                    "is_exempt": {
                      "default": false,
                      "type": "boolean"
                    },
                    "warehouse_stocks": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiSharedObject6dbe49c4ef"
                      }
                    },
                    "option_values": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "additionalProperties": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "description": "Mapa con exactamente un valor por cada nombre declarado en options."
                    }
                  },
                  "required": [
                    "sku",
                    "option_values"
                  ],
                  "additionalProperties": false
                },
                "description": "Variantes vendibles que se crearán dentro del producto."
              }
            },
            "required": [
              "name",
              "options",
              "variants"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ApiProductUpdateRequest": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ApiSharedObject50a930638e"
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "description": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 500
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "category_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "visibility": {
                "$ref": "#/components/schemas/ApiSharedEnuma7f3605118"
              },
              "image_url": {
                "description": "External product image URL reference. La Pyme displays it best effort and does not copy, ingest, or host the image.",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "product_type": {
                "type": "string",
                "enum": [
                  "product",
                  "service",
                  "kit"
                ]
              },
              "sku": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "barcode": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 100
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "unit_of_measure": {
                "type": "string",
                "enum": [
                  "10",
                  "11",
                  "12",
                  "13",
                  "14",
                  "15",
                  "16",
                  "17",
                  "18",
                  "19",
                  "20",
                  "21",
                  "22",
                  "23",
                  "24",
                  "25",
                  "26",
                  "27",
                  "28",
                  "29",
                  "30",
                  "31",
                  "32",
                  "33",
                  "34",
                  "35",
                  "36",
                  "37",
                  "41",
                  "47",
                  "48",
                  "49",
                  "50",
                  "51",
                  "52",
                  "53",
                  "54",
                  "55",
                  "61",
                  "62",
                  "63",
                  "97",
                  "98",
                  "99",
                  "00",
                  "01",
                  "02",
                  "03",
                  "04",
                  "05",
                  "06",
                  "07",
                  "08",
                  "09"
                ]
              },
              "currency": {
                "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
              },
              "cost": {
                "type": "integer",
                "minimum": 0
              },
              "price": {
                "description": "Manual sale price in cents. Mutually exclusive with markup_percentage; send price for manual pricing or markup_percentage for markup pricing.",
                "type": "integer",
                "minimum": 0
              },
              "promotional_price": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "markup_percentage": {
                "description": "Markup percentage used to calculate the sale price from cost and organization rounding rules. The price adds the product's IVA rate only when the organization's sales prices include IVA. Mutually exclusive with price; send null to switch back to manual pricing.",
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 10000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tax_rate_id": {
                "type": "integer"
              },
              "is_exempt": {
                "type": "boolean"
              },
              "default_supplier_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "default_sales_account_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "default_purchase_account_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "warehouse_stocks": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedObject6dbe49c4ef"
                }
              },
              "is_active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "ApiProductBulkAdjustmentRequest": {
        "type": "object",
        "properties": {
          "target": {
            "type": "string",
            "enum": [
              "cost",
              "price"
            ]
          },
          "operation_type": {
            "type": "string",
            "enum": [
              "increase",
              "decrease"
            ]
          },
          "adjustment_type": {
            "type": "string",
            "enum": [
              "percentage",
              "fixed"
            ]
          },
          "adjustment_value": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "search": {
            "type": "string"
          },
          "category": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "product_type": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedEnumff49232140"
            }
          },
          "default_supplier_id": {
            "type": "string",
            "format": "uuid"
          },
          "selection": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "all"
                  },
                  "excluded_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "specific"
                  },
                  "ids": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "required": [
                  "type",
                  "ids"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "target",
          "operation_type",
          "adjustment_type",
          "adjustment_value",
          "selection"
        ],
        "additionalProperties": false
      },
      "ApiProductMetafieldPatchRequest": {
        "type": "object",
        "properties": {
          "entries": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "value": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 10000
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "key",
                "value"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "entries"
        ],
        "additionalProperties": false
      },
      "ApiProductMetafieldDefinitionsResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "definitions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "field_type": {
                      "$ref": "#/components/schemas/ApiSharedEnumf7fe6bfeb0"
                    },
                    "validations": {
                      "type": "object",
                      "properties": {
                        "required": {
                          "type": "boolean"
                        },
                        "min_length": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "max_length": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "min": {
                          "type": "number"
                        },
                        "max": {
                          "type": "number"
                        },
                        "options": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "required"
                      ],
                      "additionalProperties": false
                    },
                    "values": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string"
                          },
                          "configured": {
                            "type": "boolean"
                          },
                          "observed": {
                            "type": "boolean"
                          },
                          "product_count": {
                            "type": "integer",
                            "minimum": 0
                          }
                        },
                        "required": [
                          "value",
                          "configured",
                          "observed",
                          "product_count"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "key",
                    "name",
                    "description",
                    "field_type",
                    "validations"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "definitions"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiProductDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "sku": {
            "type": "string"
          },
          "barcode": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "description": "External product image URL reference. La Pyme displays it best effort and does not copy, ingest, or host the image.",
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "cost": {
            "description": "Product cost in cents. Null when the delegated user cannot view product costs.",
            "type": [
              "number",
              "null"
            ]
          },
          "price": {
            "type": "number"
          },
          "tax_rate": {
            "$ref": "#/components/schemas/ApiSharedObjectee5eae48b0"
          },
          "default_supplier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "product_type": {
            "$ref": "#/components/schemas/ApiSharedEnumff49232140"
          },
          "visibility": {
            "$ref": "#/components/schemas/ApiSharedEnuma7f3605118"
          },
          "is_active": {
            "type": "boolean"
          },
          "organization_slug": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject564df4258f"
            }
          },
          "effective_price": {
            "type": "number"
          },
          "price_source": {
            "$ref": "#/components/schemas/ApiSharedEnumfe93f70a59"
          },
          "applied_price_list": {
            "$ref": "#/components/schemas/ApiSharedObject3b83f74923"
          },
          "object": {
            "type": "string",
            "const": "product"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          },
          "variant_group_id": {
            "type": "string",
            "format": "uuid"
          },
          "variant_options": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "is_exempt": {
            "type": "boolean"
          },
          "metafields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject0347948139"
            }
          },
          "stock_summary": {
            "$ref": "#/components/schemas/ApiSharedObjecta9f7340006"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "category",
          "sku",
          "barcode",
          "image_url",
          "currency",
          "cost",
          "price",
          "tax_rate",
          "default_supplier",
          "product_type",
          "visibility",
          "is_active",
          "organization_slug",
          "created_at",
          "updated_at",
          "components",
          "object",
          "tags",
          "variant_group_id",
          "variant_options",
          "is_exempt",
          "metafields",
          "stock_summary"
        ],
        "additionalProperties": false
      },
      "ApiProductDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObject8314097d1f"
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiProductCreateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "product": {
                "$ref": "#/components/schemas/ApiSharedObject8314097d1f"
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "product",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiProductUpdateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "product": {
                "$ref": "#/components/schemas/ApiSharedObject8314097d1f"
              }
            },
            "required": [
              "product"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiProductBulkAdjustmentResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "product_bulk_adjustment": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "const": "product_bulk_adjustment"
                  },
                  "updated": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "skipped": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "skipped_by_reason": {
                    "type": "object",
                    "properties": {
                      "composite_pricing": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "zero_base_for_percentage": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "negative_result": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "unchanged": {
                        "type": "integer",
                        "minimum": 0
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "object",
                  "updated",
                  "skipped",
                  "skipped_by_reason"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "product_bulk_adjustment"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiWarehouseListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "warehouse"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "is_default": {
                  "type": "boolean"
                },
                "is_active": {
                  "type": "boolean"
                },
                "points_of_sale_count": {
                  "type": "integer",
                  "minimum": 0
                },
                "member_count": {
                  "type": "integer",
                  "minimum": 0
                },
                "register_count": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "object",
                "id",
                "name",
                "address",
                "is_default",
                "is_active",
                "points_of_sale_count",
                "member_count",
                "register_count"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiWarehouseDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObject743a1706af"
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiPriceList": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "is_automatic": {
            "type": "boolean"
          },
          "automatic_pricing_mode": {
            "$ref": "#/components/schemas/ApiSharedEnum3c5633618c"
          },
          "adjustment_percentage": {
            "type": [
              "number",
              "null"
            ]
          },
          "source_price_list_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_inclusive": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "object": {
            "type": "string",
            "const": "price_list"
          }
        },
        "required": [
          "id",
          "name",
          "is_automatic",
          "automatic_pricing_mode",
          "adjustment_percentage",
          "source_price_list_id",
          "tax_inclusive",
          "created_at",
          "object"
        ],
        "additionalProperties": false
      },
      "ApiPriceListMutationRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 50
          },
          "is_automatic": {
            "default": true,
            "type": "boolean"
          },
          "automatic_pricing_mode": {
            "default": "base_price_adjustment",
            "type": "string",
            "enum": [
              "base_price_adjustment",
              "cost_markup"
            ]
          },
          "adjustment_percentage": {
            "anyOf": [
              {
                "type": "number",
                "minimum": -100,
                "maximum": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "source_price_list_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_economic_activity": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{6}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_inclusive": {
            "default": true,
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "ApiPriceListListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectaaccd788d6"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiPriceListDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObjectaaccd788d6"
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiPriceListPrice": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ApiSharedObjectb990586284"
          },
          {
            "$ref": "#/components/schemas/ApiSharedObjectcc3aec15bc"
          }
        ]
      },
      "ApiPriceListPricesListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "list"
          },
          "url": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ApiSharedObjectb990586284"
                },
                {
                  "$ref": "#/components/schemas/ApiSharedObjectcc3aec15bc"
                }
              ]
            }
          },
          "pricing_revision": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "request_id",
          "object",
          "url",
          "data",
          "pricing_revision",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ApiPriceListPriceDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectb990586284"
              },
              {
                "$ref": "#/components/schemas/ApiSharedObjectcc3aec15bc"
              }
            ]
          },
          "pricing_revision": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          }
        },
        "required": [
          "request_id",
          "data",
          "pricing_revision"
        ],
        "additionalProperties": false
      },
      "ApiPriceListCreateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "price_list": {
                "$ref": "#/components/schemas/ApiSharedObjectaaccd788d6"
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "price_list",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiPriceListUpdateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "price_list": {
                "$ref": "#/components/schemas/ApiSharedObjectaaccd788d6"
              },
              "should_sync_prices": {
                "type": "boolean"
              }
            },
            "required": [
              "price_list",
              "should_sync_prices"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiPriceListDeleteResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "price_list_id": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "price_list_id"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseListItem": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "purchase"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "voucher_type": {
            "type": "string"
          },
          "invoice_date": {
            "description": "Fecha del comprobante en formato YYYY-MM-DD.",
            "type": [
              "string",
              "null"
            ]
          },
          "account_date": {
            "description": "Fecha contable de la compra en formato YYYY-MM-DD.",
            "type": [
              "string",
              "null"
            ]
          },
          "due_date": {
            "description": "Fecha de vencimiento en formato YYYY-MM-DD.",
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "balance": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string"
          },
          "exchange_rate": {
            "type": "string"
          },
          "supplier_invoice_number": {
            "description": "Numero de comprobante del proveedor. Hasta 120 caracteres.",
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "supplier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject91cc200368"
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          }
        },
        "required": [
          "object",
          "id",
          "voucher_type",
          "invoice_date",
          "account_date",
          "due_date",
          "total",
          "balance",
          "warehouse_id",
          "currency",
          "exchange_rate",
          "supplier_invoice_number",
          "created_at",
          "supplier",
          "tags"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "purchase"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "voucher_type": {
                  "type": "string"
                },
                "invoice_date": {
                  "description": "Fecha del comprobante en formato YYYY-MM-DD.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "account_date": {
                  "description": "Fecha contable de la compra en formato YYYY-MM-DD.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "due_date": {
                  "description": "Fecha de vencimiento en formato YYYY-MM-DD.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "total": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "balance": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "warehouse_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "currency": {
                  "type": "string"
                },
                "exchange_rate": {
                  "type": "string"
                },
                "supplier_invoice_number": {
                  "description": "Numero de comprobante del proveedor. Hasta 120 caracteres.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "supplier": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject91cc200368"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
                  }
                }
              },
              "required": [
                "object",
                "id",
                "voucher_type",
                "invoice_date",
                "account_date",
                "due_date",
                "total",
                "balance",
                "warehouse_id",
                "currency",
                "exchange_rate",
                "supplier_invoice_number",
                "created_at",
                "supplier",
                "tags"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiDocumentLink": {
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum1ba2b57809"
          },
          "url": {
            "description": "Stable authenticated La Pyme API path. Present only when status is ready; follow redirects when downloading.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "status",
          "url"
        ],
        "additionalProperties": false,
        "description": "Document availability. The URL requires bearer authentication and never contains a storage path or signed query string."
      },
      "ApiPurchaseDetail": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "purchase"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          },
          "accounting": {
            "$ref": "#/components/schemas/ApiSharedObjectb708221d2f"
          },
          "voucher_type": {
            "type": "string"
          },
          "import_document_role": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum9e7af09974"
              },
              {
                "type": "null"
              }
            ],
            "description": "Rol del comprobante dentro del flujo de importacion."
          },
          "import_source_purchase_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID de la factura comercial asociada al despacho aduanero."
          },
          "import_nationalization_status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumf0d69c3d87"
              },
              {
                "type": "null"
              }
            ],
            "description": "Estado de nacionalizacion de la factura comercial de importacion."
          },
          "customs_dispatch_number": {
            "description": "Numero de despacho aduanero informado por el proveedor. Hasta 32 caracteres.",
            "type": [
              "string",
              "null"
            ]
          },
          "supplier_invoice_number": {
            "description": "Numero de comprobante del proveedor. Hasta 120 caracteres.",
            "type": [
              "string",
              "null"
            ]
          },
          "invoice_date": {
            "description": "Fecha del comprobante en formato YYYY-MM-DD.",
            "type": [
              "string",
              "null"
            ]
          },
          "account_date": {
            "description": "Fecha contable de la compra en formato YYYY-MM-DD.",
            "type": [
              "string",
              "null"
            ]
          },
          "due_date": {
            "description": "Fecha de vencimiento en formato YYYY-MM-DD.",
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumd34af90520"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_perception_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "national_tax_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "gross_income_tax_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "gross_income_tax_breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject95929ea589"
            }
          },
          "municipal_tax_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "internal_tax_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "other_tax_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "subtotal": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "exempt_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "balance": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "discount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectfb7405a472"
            }
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "vat_category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum822a963f55"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string"
          },
          "exchange_rate": {
            "type": "string"
          },
          "pdf_path": {
            "description": "Deprecated internal storage key retained for V1 compatibility. Use document.url instead; it is stable, authenticated, and storage-provider-neutral.",
            "type": [
              "string",
              "null"
            ],
            "deprecated": true
          },
          "document": {
            "$ref": "#/components/schemas/ApiSharedObject9c9e4b0e0d"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "supplier": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "email": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "phone": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tax_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tax_id_type": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tax_category": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "address": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "city": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "province_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "postal_code": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "payment_term_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "payment_term_days": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 365,
                        "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "name",
                  "email",
                  "phone",
                  "tax_id",
                  "tax_id_type",
                  "tax_category",
                  "address",
                  "city",
                  "province_id",
                  "postal_code",
                  "payment_term_id",
                  "payment_term_days"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "warehouse": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "products_received": {
            "type": "boolean"
          },
          "products_returned": {
            "type": "boolean"
          },
          "inventory_effect": {
            "type": "string",
            "enum": [
              "none",
              "receive",
              "return_to_supplier",
              "legacy_inconsistent"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "quantity": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "unit_cost": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "subtotal": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "tax_rate_id": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "is_exempt": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "total": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "discount_percentage": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "purchase_order_item_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "vat_category": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedEnum822a963f55"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "product": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "sku": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "product_type": {
                          "anyOf": [
                            {
                              "$ref": "#/components/schemas/ApiSharedEnumff49232140"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "sku",
                        "name",
                        "product_type"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "purchase_order": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "formatted_order_number": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "formatted_order_number"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "name",
                "quantity",
                "unit_cost",
                "subtotal",
                "tax_rate_id",
                "is_exempt",
                "total",
                "discount_percentage",
                "purchase_order_item_id",
                "vat_category",
                "product",
                "purchase_order"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "object",
          "id",
          "tags",
          "voucher_type",
          "import_document_role",
          "import_source_purchase_id",
          "import_nationalization_status",
          "customs_dispatch_number",
          "supplier_invoice_number",
          "invoice_date",
          "account_date",
          "due_date",
          "payment_term_id",
          "payment_term_days",
          "vat_perception_amount",
          "national_tax_amount",
          "gross_income_tax_amount",
          "gross_income_tax_breakdown",
          "municipal_tax_amount",
          "internal_tax_amount",
          "other_tax_amount",
          "subtotal",
          "tax_amount",
          "exempt_amount",
          "total",
          "balance",
          "discount",
          "vat_breakdown",
          "notes",
          "vat_category",
          "currency",
          "exchange_rate",
          "pdf_path",
          "document",
          "created_at",
          "supplier",
          "warehouse",
          "products_received",
          "products_returned",
          "inventory_effect",
          "items"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseDetailResponse": {
        "type": "object",
        "required": [
          "request_id",
          "data"
        ],
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiPurchaseDetail"
          }
        }
      },
      "ApiPurchaseDeleteResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "purchase": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "const": "purchase"
                  },
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "deleted": {
                    "type": "boolean"
                  },
                  "stock_undone": {
                    "type": "boolean"
                  },
                  "purchase_orders_affected": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "object",
                  "id",
                  "deleted",
                  "stock_undone",
                  "purchase_orders_affected"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "purchase"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseOrderListItem": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "purchase_order"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "order_number": {
            "type": "integer"
          },
          "formatted_order_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnumf2073aa092"
          },
          "order_date": {
            "type": "string",
            "format": "date"
          },
          "expected_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string"
          },
          "supplier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "warehouse": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          }
        },
        "required": [
          "object",
          "id",
          "order_number",
          "formatted_order_number",
          "status",
          "order_date",
          "expected_date",
          "currency",
          "supplier",
          "warehouse",
          "created_at",
          "tags"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseOrderListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "purchase_order"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "order_number": {
                  "type": "integer"
                },
                "formatted_order_number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "$ref": "#/components/schemas/ApiSharedEnumf2073aa092"
                },
                "order_date": {
                  "type": "string",
                  "format": "date"
                },
                "expected_date": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "currency": {
                  "type": "string"
                },
                "supplier": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "warehouse": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
                  }
                }
              },
              "required": [
                "object",
                "id",
                "order_number",
                "formatted_order_number",
                "status",
                "order_date",
                "expected_date",
                "currency",
                "supplier",
                "warehouse",
                "created_at",
                "tags"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseOrderDetail": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "purchase_order"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "order_number": {
            "type": "integer"
          },
          "formatted_order_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnumf2073aa092"
          },
          "order_date": {
            "type": "string",
            "format": "date"
          },
          "expected_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string"
          },
          "supplier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectfaafd59b8b"
              },
              {
                "type": "null"
              }
            ]
          },
          "warehouse": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          },
          "warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjecta50ed243b8"
            }
          }
        },
        "required": [
          "object",
          "id",
          "order_number",
          "formatted_order_number",
          "status",
          "order_date",
          "expected_date",
          "currency",
          "supplier",
          "warehouse",
          "created_at",
          "tags",
          "warehouse_id",
          "notes",
          "items"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseOrderDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObjecteffe384a18"
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseOrderRequest": {
        "type": "object",
        "properties": {
          "supplier_id": {
            "type": "string",
            "format": "uuid"
          },
          "order_date": {
            "type": "string",
            "format": "date"
          },
          "expected_date": {
            "type": "string",
            "format": "date"
          },
          "warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "notes": {
            "type": "string",
            "maxLength": 4000
          },
          "items": {
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "product_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "ordered_quantity": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "expected_unit_cost": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "product_id",
                "ordered_quantity"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "supplier_id",
          "order_date",
          "warehouse_id",
          "items"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseOrderWriteResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "purchase_order": {
                "$ref": "#/components/schemas/ApiSharedObjecteffe384a18"
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "purchase_order",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseOrderDeleteResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "purchase_order": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "const": "purchase_order"
                  },
                  "purchase_order_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "deleted": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "object",
                  "purchase_order_id",
                  "deleted"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "purchase_order"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseOrderReceiptRequest": {
        "type": "object",
        "properties": {
          "items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "purchase_order_item_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "product_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "received_quantity": {
                  "type": "number"
                }
              },
              "required": [
                "purchase_order_item_id",
                "product_id",
                "received_quantity"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "ApiPurchaseOrderReceiptResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "receipt": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "const": "receipt"
                  },
                  "id": {
                    "type": "string"
                  },
                  "purchase_order_warehouse_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "affected_products": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "sku": {
                          "type": "string"
                        },
                        "warehouse_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "sku",
                        "warehouse_id"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "object",
                  "id",
                  "purchase_order_warehouse_id",
                  "affected_products"
                ],
                "additionalProperties": false
              },
              "purchase_order": {
                "$ref": "#/components/schemas/ApiSharedObjecteffe384a18"
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "receipt",
              "purchase_order",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiOrderListItem": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "order"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "order_number": {
            "type": "string"
          },
          "raw_order_number": {
            "type": "integer"
          },
          "order_date": {
            "type": "string",
            "format": "date-time"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_name": {
            "type": "string"
          },
          "customer_tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "items_count": {
            "type": "integer"
          },
          "total_units": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          },
          "discount_amount": {
            "type": "integer",
            "minimum": 0
          },
          "subtotal": {
            "type": "integer",
            "minimum": 0
          },
          "tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "order_status": {
            "$ref": "#/components/schemas/ApiSharedEnum4ac9200c4a"
          },
          "preparation_status": {
            "$ref": "#/components/schemas/ApiSharedEnumb49e56b125"
          },
          "invoicing_status": {
            "$ref": "#/components/schemas/ApiSharedEnum2f67ddf0e8"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by_name": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "id",
          "order_number",
          "raw_order_number",
          "order_date",
          "customer_id",
          "customer_name",
          "customer_tax_id",
          "items_count",
          "total_units",
          "discount_amount",
          "subtotal",
          "tax_amount",
          "total",
          "currency",
          "order_status",
          "preparation_status",
          "invoicing_status",
          "notes",
          "created_at",
          "updated_at",
          "created_by_name"
        ],
        "additionalProperties": false
      },
      "ApiOrderListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "order"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "order_number": {
                  "type": "string"
                },
                "raw_order_number": {
                  "type": "integer"
                },
                "order_date": {
                  "type": "string",
                  "format": "date-time"
                },
                "customer_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "customer_name": {
                  "type": "string"
                },
                "customer_tax_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "items_count": {
                  "type": "integer"
                },
                "total_units": {
                  "type": "number",
                  "minimum": 0,
                  "multipleOf": 0.0001
                },
                "discount_amount": {
                  "type": "integer",
                  "minimum": 0
                },
                "subtotal": {
                  "type": "integer",
                  "minimum": 0
                },
                "tax_amount": {
                  "type": "integer",
                  "minimum": 0
                },
                "total": {
                  "type": "integer",
                  "minimum": 0
                },
                "currency": {
                  "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
                },
                "order_status": {
                  "$ref": "#/components/schemas/ApiSharedEnum4ac9200c4a"
                },
                "preparation_status": {
                  "$ref": "#/components/schemas/ApiSharedEnumb49e56b125"
                },
                "invoicing_status": {
                  "$ref": "#/components/schemas/ApiSharedEnum2f67ddf0e8"
                },
                "notes": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "created_by_name": {
                  "type": "string"
                }
              },
              "required": [
                "object",
                "id",
                "order_number",
                "raw_order_number",
                "order_date",
                "customer_id",
                "customer_name",
                "customer_tax_id",
                "items_count",
                "total_units",
                "discount_amount",
                "subtotal",
                "tax_amount",
                "total",
                "currency",
                "order_status",
                "preparation_status",
                "invoicing_status",
                "notes",
                "created_at",
                "updated_at",
                "created_by_name"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiOrderDetail": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "order"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "order_number": {
            "type": "string"
          },
          "raw_order_number": {
            "type": "integer"
          },
          "order_date": {
            "type": "string",
            "format": "date-time"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_name": {
            "type": "string"
          },
          "customer_tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "items_count": {
            "type": "integer"
          },
          "total_units": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          },
          "discount_amount": {
            "type": "integer",
            "minimum": 0
          },
          "subtotal": {
            "type": "integer",
            "minimum": 0
          },
          "tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "order_status": {
            "$ref": "#/components/schemas/ApiSharedEnum4ac9200c4a"
          },
          "preparation_status": {
            "$ref": "#/components/schemas/ApiSharedEnumb49e56b125"
          },
          "invoicing_status": {
            "$ref": "#/components/schemas/ApiSharedEnum2f67ddf0e8"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by_name": {
            "type": "string"
          },
          "created_by": {
            "type": "string",
            "format": "uuid"
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectb74541d41a"
            }
          },
          "active_warehouses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject6e2450633e"
            }
          },
          "pending_preparation_warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "preparation_groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectc8647a846a"
            }
          },
          "preparations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject81e5b4b232"
            }
          },
          "invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectd4414f57ad"
            }
          }
        },
        "required": [
          "object",
          "id",
          "order_number",
          "raw_order_number",
          "order_date",
          "customer_id",
          "customer_name",
          "customer_tax_id",
          "items_count",
          "total_units",
          "discount_amount",
          "subtotal",
          "tax_amount",
          "total",
          "currency",
          "order_status",
          "preparation_status",
          "invoicing_status",
          "notes",
          "created_at",
          "updated_at",
          "created_by_name",
          "created_by",
          "line_items",
          "active_warehouses",
          "pending_preparation_warehouse_id",
          "preparation_groups",
          "preparations",
          "invoices"
        ],
        "additionalProperties": false
      },
      "ApiOrderDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObject251954f6f7"
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiOrderCreateRequest": {
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "assigned_warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "delivery_method": {
            "$ref": "#/components/schemas/ApiSharedEnumcc76b6d63a"
          },
          "order_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "string",
                "format": "date-time"
              }
            ],
            "description": "Fecha ISO (YYYY-MM-DD) u hora ISO 8601 completa."
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "notes": {
            "type": "string",
            "maxLength": 2000
          },
          "discount_amount": {
            "type": "integer",
            "minimum": 0
          },
          "totals": {
            "description": "Opcional. Si se envía, se verifica contra los totales calculados y un desvío rechaza el pedido. Si se omite, se calculan a partir de las líneas.",
            "type": "object",
            "properties": {
              "subtotal": {
                "type": "integer",
                "minimum": 0
              },
              "tax_amount": {
                "type": "integer",
                "minimum": 0
              },
              "total": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "subtotal",
              "tax_amount",
              "total"
            ],
            "additionalProperties": false
          },
          "lines": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "product_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "product_name_snapshot": {
                  "type": "string"
                },
                "sku_snapshot": {
                  "type": "string"
                },
                "ordered_quantity": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "multipleOf": 0.0001
                },
                "unit_price": {
                  "type": "integer",
                  "minimum": 0
                },
                "tax_rate_id": {
                  "type": "integer"
                },
                "discount_amount": {
                  "type": "integer",
                  "minimum": 0
                },
                "discount_percentage": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100
                }
              },
              "required": [
                "product_name_snapshot",
                "sku_snapshot",
                "ordered_quantity",
                "unit_price"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "customer_id",
          "assigned_warehouse_id",
          "lines"
        ],
        "additionalProperties": false
      },
      "ApiOrderNotesPatchRequest": {
        "type": "object",
        "properties": {
          "notes": {
            "type": "string",
            "maxLength": 2000
          }
        },
        "additionalProperties": false
      },
      "ApiOrderEditRequest": {
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "price_list_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "assigned_warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "delivery_method": {
            "$ref": "#/components/schemas/ApiSharedEnumcc76b6d63a"
          },
          "expected_updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "order_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "string",
                "format": "date-time"
              }
            ],
            "description": "Fecha ISO (YYYY-MM-DD) u hora ISO 8601 completa."
          },
          "notes": {
            "type": "string",
            "maxLength": 2000
          },
          "tax_inclusive": {
            "type": "boolean"
          },
          "discount_amount": {
            "type": "integer",
            "minimum": 0
          },
          "lines": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "order_line_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "product_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "product_name_snapshot": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 500
                },
                "sku_snapshot": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                },
                "variant_options_snapshot": {
                  "anyOf": [
                    {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_names_snapshot": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "ordered_quantity": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "multipleOf": 0.0001
                },
                "unit_price": {
                  "type": "integer",
                  "minimum": 0
                },
                "tax_rate_id": {
                  "type": "integer"
                },
                "discount_amount": {
                  "type": "integer",
                  "minimum": 0
                },
                "discount_percentage": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100
                }
              },
              "required": [
                "product_name_snapshot",
                "sku_snapshot",
                "ordered_quantity",
                "unit_price"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "assigned_warehouse_id",
          "lines"
        ],
        "additionalProperties": false
      },
      "ApiOrderWriteResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "order": {
                "$ref": "#/components/schemas/ApiSharedObject251954f6f7"
              },
              "idempotent_replay": {
                "type": "boolean"
              },
              "result": {}
            },
            "required": [
              "order"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiOrderPreparationCreateRequest": {
        "type": "object",
        "properties": {
          "preparation_group_id": {
            "type": "string",
            "format": "uuid"
          },
          "warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectc2dbdba87b"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "ApiOrderPreparationUpdateRequest": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "in_progress"
            ]
          },
          "preparation_group_id": {
            "type": "string",
            "format": "uuid"
          },
          "warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectc2dbdba87b"
            }
          }
        },
        "additionalProperties": false
      },
      "ApiOrderPreparation": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "order_preparation"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "prepared_at": {
            "type": "string",
            "format": "date-time"
          },
          "warehouse_name": {
            "type": "string"
          },
          "delivery_method": {
            "$ref": "#/components/schemas/ApiSharedEnumcc76b6d63a"
          },
          "remito_delivery_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "formatted_remito_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjecta83bae2379"
            }
          }
        },
        "required": [
          "object",
          "id",
          "prepared_at",
          "warehouse_name",
          "delivery_method",
          "remito_delivery_id",
          "formatted_remito_number",
          "lines"
        ],
        "additionalProperties": false
      },
      "ApiOrderPreparationGroup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum19a9b49403"
          },
          "warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "warehouse_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery_method": {
            "$ref": "#/components/schemas/ApiSharedEnumcc76b6d63a"
          },
          "requested_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "closed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "cancelled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject4052bad07b"
            }
          }
        },
        "required": [
          "id",
          "status",
          "warehouse_id",
          "warehouse_name",
          "delivery_method",
          "requested_at",
          "started_at",
          "closed_at",
          "cancelled_at",
          "notes",
          "lines"
        ],
        "additionalProperties": false
      },
      "ApiOrderOptionalReasonRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "maxLength": 500
          }
        },
        "additionalProperties": false
      },
      "ApiOrderInvoiceRequest": {
        "type": "object",
        "properties": {
          "voucher_type": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "point_of_sale_id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "due_date": {
            "type": "string",
            "format": "date"
          },
          "notes": {
            "type": "string",
            "maxLength": 2000
          },
          "lines": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "order_line_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "quantity_to_invoice": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "multipleOf": 0.0001
                }
              },
              "required": [
                "order_line_id",
                "quantity_to_invoice"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "voucher_type",
          "point_of_sale_id",
          "invoice_date",
          "lines"
        ],
        "additionalProperties": false
      },
      "ApiSaleListItem": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "sale"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_pdf": {
            "type": [
              "string",
              "null"
            ]
          },
          "accounting": {
            "$ref": "#/components/schemas/ApiSharedObjectb708221d2f"
          },
          "document": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "customer": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "amounts": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "payments": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "applications": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "fiscal": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "integration": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "reverses_voucher": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "audit": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          }
        },
        "additionalProperties": {}
      },
      "ApiSaleListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "sale"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "invoice_pdf": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "accounting": {
                  "$ref": "#/components/schemas/ApiSharedObjectb708221d2f"
                },
                "document": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                "customer": {
                  "anyOf": [
                    {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "amounts": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "payments": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                "applications": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                "fiscal": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                "integration": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                "reverses_voucher": {
                  "anyOf": [
                    {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "audit": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
                  }
                }
              },
              "additionalProperties": {}
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiSalePayment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "payment_id": {
            "type": "string",
            "format": "uuid"
          },
          "formatted_payment_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_date": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "payment_method": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject97f4e132e6"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "terminal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject7afcf3dcbb"
              },
              {
                "type": "null"
              }
            ]
          },
          "card_batch_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_coupon_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_installment_plan_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_brand": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "payment_id",
          "formatted_payment_number",
          "payment_number",
          "payment_date",
          "amount",
          "currency",
          "payment_method",
          "notes",
          "created_at",
          "terminal",
          "card_batch_number",
          "card_coupon_number",
          "card_installment_plan_code",
          "card_brand"
        ],
        "additionalProperties": false
      },
      "ApiSaleApplication": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "applied_amount": {
            "type": "integer"
          },
          "sale_id": {
            "type": "string",
            "format": "uuid"
          },
          "sale_formatted_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "sale_voucher_type": {
            "type": "string"
          },
          "sale_total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "id",
          "created_at",
          "applied_amount",
          "sale_id",
          "sale_formatted_number",
          "sale_voucher_type",
          "sale_total"
        ],
        "additionalProperties": false
      },
      "ApiSaleDetailItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "number"
          },
          "unit_price": {
            "type": "integer",
            "minimum": 0
          },
          "unit_cost": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "discount_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "discount_percentage": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_rate_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "line_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum4e55733f20"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_exempt": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "is_custom": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "variant_options": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "option_names": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "product": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject2d9f8803d7"
              },
              {
                "type": "null"
              }
            ]
          },
          "warehouse": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "subtotal": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center1": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject7e70bcc878"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center2": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject7e70bcc878"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center3": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject7e70bcc878"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "quantity",
          "unit_price",
          "unit_cost",
          "discount_amount",
          "discount_percentage",
          "tax_rate_id",
          "account_id",
          "line_type",
          "is_exempt",
          "is_custom",
          "name",
          "notes",
          "variant_options",
          "option_names",
          "product",
          "warehouse",
          "subtotal",
          "tax_amount",
          "total",
          "cost_center1",
          "cost_center2",
          "cost_center3"
        ],
        "additionalProperties": false
      },
      "ApiSaleDetailFullShape": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "sale"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "voucher_type": {
            "type": "string"
          },
          "customer_tax_category_override": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoice_status": {
            "type": "string"
          },
          "invoice_date": {
            "type": "string"
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "service_from": {
            "type": [
              "string",
              "null"
            ]
          },
          "service_to": {
            "type": [
              "string",
              "null"
            ]
          },
          "subtotal": {
            "type": "integer",
            "minimum": 0
          },
          "tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "balance": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "tributes_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "national_perception_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "gross_income_perception_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "gross_income_tax_breakdown": {},
          "municipal_perception_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "internal_tribute_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "uncategorized_vat_perception_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "other_tribute_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "discount_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "discount_value": {
            "type": [
              "number",
              "null"
            ]
          },
          "discount_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "fiscal_notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "cae": {
            "type": [
              "string",
              "null"
            ]
          },
          "cae_expiry": {
            "type": [
              "string",
              "null"
            ]
          },
          "pdf_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "pdf_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "trigger_job_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "email_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "email_sent_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "formatted_invoice_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "original_sale_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "integration_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "integration_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "afip_error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "register_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "manual_associated_documents": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "customer_invoice_readiness": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "ready",
                  "missing_data"
                ]
              },
              "missing_fields": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "customer",
                    "name",
                    "taxIdType",
                    "taxId",
                    "taxCategory",
                    "province"
                  ]
                }
              }
            },
            "required": [
              "status",
              "missing_fields"
            ],
            "additionalProperties": false
          },
          "customer": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "email": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "phone": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tax_id_type": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tax_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tax_category": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "default_price_list_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "payment_term_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "payment_term_days": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 365,
                        "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "address": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "apartment": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "city": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "province": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "postal_code": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "id",
                  "name",
                  "description",
                  "email",
                  "phone",
                  "tax_id_type",
                  "tax_id",
                  "tax_category",
                  "default_price_list_id",
                  "payment_term_id",
                  "payment_term_days",
                  "address",
                  "apartment",
                  "city",
                  "province",
                  "postal_code"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "point_of_sale": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject94c0cab352"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject2bc2c4916e"
              },
              {
                "type": "null"
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "quantity": {
                  "type": "number"
                },
                "unit_price": {
                  "type": "integer",
                  "minimum": 0
                },
                "unit_cost": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "discount_amount": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "discount_percentage": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tax_rate_id": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "account_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "line_type": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedEnum4e55733f20"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "is_exempt": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "is_custom": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "notes": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "variant_options": {
                  "anyOf": [
                    {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_names": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "product": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject2d9f8803d7"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "warehouse": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "subtotal": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "tax_amount": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "total": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cost_center1": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject7e70bcc878"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cost_center2": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject7e70bcc878"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cost_center3": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject7e70bcc878"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "quantity",
                "unit_price",
                "unit_cost",
                "discount_amount",
                "discount_percentage",
                "tax_rate_id",
                "account_id",
                "line_type",
                "is_exempt",
                "is_custom",
                "name",
                "notes",
                "variant_options",
                "option_names",
                "product",
                "warehouse",
                "subtotal",
                "tax_amount",
                "total",
                "cost_center1",
                "cost_center2",
                "cost_center3"
              ],
              "additionalProperties": false
            }
          },
          "payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject3ef6d7a544"
            }
          },
          "original_payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject3ef6d7a544"
            }
          },
          "return_payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject3ef6d7a544"
            }
          },
          "payment_fees_amount": {
            "type": "integer"
          },
          "credit_note_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject00e1b911ed"
            }
          },
          "applied_to_invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject00e1b911ed"
            }
          }
        },
        "required": [
          "object",
          "id",
          "invoice_number",
          "voucher_type",
          "customer_tax_category_override",
          "invoice_status",
          "invoice_date",
          "due_date",
          "service_from",
          "service_to",
          "subtotal",
          "tax_amount",
          "total",
          "balance",
          "tributes_amount",
          "national_perception_amount",
          "gross_income_perception_amount",
          "gross_income_tax_breakdown",
          "municipal_perception_amount",
          "internal_tribute_amount",
          "uncategorized_vat_perception_amount",
          "other_tribute_amount",
          "discount_type",
          "discount_value",
          "discount_amount",
          "notes",
          "fiscal_notes",
          "cae",
          "cae_expiry",
          "pdf_path",
          "pdf_status",
          "trigger_job_id",
          "email_status",
          "email_sent_at",
          "formatted_invoice_number",
          "original_sale_id",
          "integration_source",
          "integration_id",
          "afip_error_code",
          "currency",
          "register_id",
          "manual_associated_documents",
          "created_at",
          "updated_at",
          "customer_invoice_readiness",
          "customer",
          "point_of_sale",
          "created_by",
          "items",
          "payments",
          "original_payments",
          "return_payments",
          "payment_fees_amount",
          "credit_note_applications",
          "applied_to_invoices"
        ],
        "additionalProperties": false
      },
      "ApiSaleDetail": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "sale"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_pdf": {
            "type": [
              "string",
              "null"
            ]
          },
          "accounting": {
            "$ref": "#/components/schemas/ApiSharedObjectb708221d2f"
          },
          "document": {
            "$ref": "#/components/schemas/ApiSharedObjectdacb842378"
          },
          "customer": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "amounts": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "payments": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "applications": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "fiscal": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "integration": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "reverses_voucher": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "audit": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          }
        },
        "additionalProperties": {}
      },
      "ApiSaleMetadataPatchRequest": {
        "type": "object",
        "properties": {
          "notes": {
            "description": "Notas operativas de la venta. Enviar null o string vacio para limpiar.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "integration_source": {
            "description": "Fuente de integracion externa. Debe enviarse junto con integrationId.",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "integration_id": {
            "description": "ID de referencia externa. Debe enviarse junto con integrationSource.",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "salesperson_id": {
            "description": "ID del miembro/vendedor que debe quedar asociado a la venta.",
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false,
        "description": "Actualizacion parcial de metadatos operativos de venta. Envia al menos un campo. integration_source e integration_id deben enviarse juntos; para limpiar la referencia externa, envia ambos en null.",
        "minProperties": 1
      },
      "ApiSaleDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "sale"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "invoice_pdf": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "accounting": {
                "$ref": "#/components/schemas/ApiSharedObjectb708221d2f"
              },
              "document": {
                "$ref": "#/components/schemas/ApiSharedObjectdacb842378"
              },
              "customer": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amounts": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                }
              },
              "payments": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "applications": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "fiscal": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "integration": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "reverses_voucher": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "audit": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "tags": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
                }
              }
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiExistingSaleInvoiceResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "sale_id": {
                "type": "string",
                "format": "uuid"
              },
              "status": {
                "type": "string",
                "enum": [
                  "issued",
                  "deferred"
                ]
              },
              "invoice_status": {
                "$ref": "#/components/schemas/ApiSharedEnum9ac70a3316"
              },
              "pdf_status": {
                "type": "string",
                "enum": [
                  "pending",
                  "stored",
                  "failed"
                ]
              },
              "invoice_number": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "formatted_invoice_number": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "idempotent_replay": {
                "type": "boolean"
              },
              "failure_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "retryable": {
                "type": "boolean"
              }
            },
            "required": [
              "sale_id",
              "status",
              "invoice_status",
              "pdf_status",
              "invoice_number",
              "formatted_invoice_number",
              "idempotent_replay",
              "failure_code",
              "retryable"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiQuoteRequest": {
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "pricing_ars_per_usd_rate": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "currency_change_mode": {
            "type": "string",
            "enum": [
              "keep",
              "convert"
            ]
          },
          "price_list_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "salesperson_member_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "product_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "warehouse_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "quantity": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "multipleOf": 0.0001
                },
                "unit_price": {
                  "type": "integer",
                  "minimum": 0
                },
                "discount": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "percentage"
                        },
                        "value": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 100
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "$ref": "#/components/schemas/ApiSharedObject06b16aade1"
                    }
                  ]
                }
              },
              "required": [
                "product_id",
                "quantity",
                "unit_price"
              ],
              "additionalProperties": false
            }
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "global_discount_amount": {
            "type": "integer",
            "minimum": 0
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "reservation": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "reserved_through_date": {
                "type": "string",
                "format": "date"
              }
            },
            "required": [
              "enabled"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "customer_id",
          "items"
        ],
        "additionalProperties": false
      },
      "ApiQuoteListItem": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "quote"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "formatted_number": {
            "type": "string"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnumfbc137f7cc"
          },
          "converted_sale_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "reservation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectc82a2ff2d4"
              },
              {
                "type": "null"
              }
            ]
          },
          "items_count": {
            "type": "integer",
            "minimum": 0
          },
          "subtotal": {
            "type": "integer",
            "minimum": 0
          },
          "tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "discount_amount": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "number",
          "formatted_number",
          "customer_id",
          "currency",
          "status",
          "converted_sale_id",
          "reservation",
          "items_count",
          "subtotal",
          "tax_amount",
          "discount_amount",
          "total",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiQuoteListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "quote"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "formatted_number": {
                  "type": "string"
                },
                "customer_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "currency": {
                  "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
                },
                "status": {
                  "$ref": "#/components/schemas/ApiSharedEnumfbc137f7cc"
                },
                "converted_sale_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "reservation": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObjectc82a2ff2d4"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "items_count": {
                  "type": "integer",
                  "minimum": 0
                },
                "subtotal": {
                  "type": "integer",
                  "minimum": 0
                },
                "tax_amount": {
                  "type": "integer",
                  "minimum": 0
                },
                "discount_amount": {
                  "type": "integer",
                  "minimum": 0
                },
                "total": {
                  "type": "integer",
                  "minimum": 0
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "object",
                "id",
                "number",
                "formatted_number",
                "customer_id",
                "currency",
                "status",
                "converted_sale_id",
                "reservation",
                "items_count",
                "subtotal",
                "tax_amount",
                "discount_amount",
                "total",
                "created_at",
                "updated_at"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiQuote": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "quote"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "formatted_number": {
            "type": "string"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnumfbc137f7cc"
          },
          "converted_sale_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "reservation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectc82a2ff2d4"
              },
              {
                "type": "null"
              }
            ]
          },
          "subtotal": {
            "type": "integer",
            "minimum": 0
          },
          "tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "discount_amount": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "salesperson_member_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "price_list_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "prices_include_tax": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "pricing_ars_per_usd_rate": {
            "type": [
              "string",
              "null"
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject6e2dab2a90"
            }
          }
        },
        "required": [
          "object",
          "id",
          "number",
          "formatted_number",
          "customer_id",
          "currency",
          "status",
          "converted_sale_id",
          "reservation",
          "subtotal",
          "tax_amount",
          "discount_amount",
          "total",
          "created_at",
          "updated_at",
          "salesperson_member_id",
          "price_list_id",
          "prices_include_tax",
          "pricing_ars_per_usd_rate",
          "expires_at",
          "notes",
          "items"
        ],
        "additionalProperties": false
      },
      "ApiQuoteDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "quote"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "number": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "formatted_number": {
                "type": "string"
              },
              "customer_id": {
                "type": "string",
                "format": "uuid"
              },
              "currency": {
                "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
              },
              "status": {
                "$ref": "#/components/schemas/ApiSharedEnumfbc137f7cc"
              },
              "converted_sale_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reservation": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObjectc82a2ff2d4"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subtotal": {
                "type": "integer",
                "minimum": 0
              },
              "tax_amount": {
                "type": "integer",
                "minimum": 0
              },
              "discount_amount": {
                "type": "integer",
                "minimum": 0
              },
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              },
              "salesperson_member_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "price_list_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "prices_include_tax": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "pricing_ars_per_usd_rate": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "expires_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "notes": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedObject6e2dab2a90"
                }
              }
            },
            "required": [
              "object",
              "id",
              "number",
              "formatted_number",
              "customer_id",
              "currency",
              "status",
              "converted_sale_id",
              "reservation",
              "subtotal",
              "tax_amount",
              "discount_amount",
              "total",
              "created_at",
              "updated_at",
              "salesperson_member_id",
              "price_list_id",
              "prices_include_tax",
              "pricing_ars_per_usd_rate",
              "expires_at",
              "notes",
              "items"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiQuoteWriteResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "quote"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "number": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "formatted_number": {
                "type": "string"
              },
              "customer_id": {
                "type": "string",
                "format": "uuid"
              },
              "currency": {
                "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
              },
              "status": {
                "$ref": "#/components/schemas/ApiSharedEnumfbc137f7cc"
              },
              "converted_sale_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reservation": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObjectc82a2ff2d4"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subtotal": {
                "type": "integer",
                "minimum": 0
              },
              "tax_amount": {
                "type": "integer",
                "minimum": 0
              },
              "discount_amount": {
                "type": "integer",
                "minimum": 0
              },
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              },
              "salesperson_member_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "price_list_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "prices_include_tax": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "pricing_ars_per_usd_rate": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "expires_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "notes": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedObject6e2dab2a90"
                }
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "object",
              "id",
              "number",
              "formatted_number",
              "customer_id",
              "currency",
              "status",
              "converted_sale_id",
              "reservation",
              "subtotal",
              "tax_amount",
              "discount_amount",
              "total",
              "created_at",
              "updated_at",
              "salesperson_member_id",
              "price_list_id",
              "prices_include_tax",
              "pricing_ars_per_usd_rate",
              "expires_at",
              "notes",
              "items",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "product_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "warehouse_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "requested_quantity": {
                  "type": "number"
                },
                "available_quantity": {
                  "type": "number"
                }
              },
              "required": [
                "product_id",
                "warehouse_id",
                "requested_quantity",
                "available_quantity"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiQuoteDeleteResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "quote"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "deleted": {
                "type": "boolean",
                "const": true
              },
              "reservation_released": {
                "type": "boolean"
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "object",
              "id",
              "deleted",
              "reservation_released",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {
              "not": {}
            }
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiRemitoListItem": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "remito"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "customer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject5e70e1df84"
              },
              {
                "type": "null"
              }
            ]
          },
          "origin": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectc15d6ab2fa"
              },
              {
                "$ref": "#/components/schemas/ApiSharedObject5a978938b1"
              },
              {
                "$ref": "#/components/schemas/ApiSharedObject05f64e43bb"
              }
            ]
          },
          "created": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "number",
          "date",
          "customer",
          "origin",
          "created"
        ],
        "additionalProperties": false
      },
      "ApiRemitoListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "remito"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "customer": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject5e70e1df84"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "origin": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObjectc15d6ab2fa"
                    },
                    {
                      "$ref": "#/components/schemas/ApiSharedObject5a978938b1"
                    },
                    {
                      "$ref": "#/components/schemas/ApiSharedObject05f64e43bb"
                    }
                  ]
                },
                "created": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "number",
                "date",
                "customer",
                "origin",
                "created"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiRemitoDetail": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "remito"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "customer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject5e70e1df84"
              },
              {
                "type": "null"
              }
            ]
          },
          "origin": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectc15d6ab2fa"
              },
              {
                "$ref": "#/components/schemas/ApiSharedObject5a978938b1"
              },
              {
                "$ref": "#/components/schemas/ApiSharedObject05f64e43bb"
              }
            ]
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "issuer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectd6ec566aaf"
              },
              {
                "type": "null"
              }
            ]
          },
          "remito_number": {
            "type": "integer"
          },
          "point_of_sale": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject94c0cab352"
              },
              {
                "type": "null"
              }
            ]
          },
          "carrier": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "scheduled_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "delivered_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "recipient_dni": {
            "type": [
              "string",
              "null"
            ]
          },
          "driver_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject912052d04a"
            }
          },
          "updated": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "number",
          "date",
          "customer",
          "origin",
          "created",
          "issuer",
          "remito_number",
          "point_of_sale",
          "carrier",
          "delivery_address",
          "scheduled_date",
          "delivered_at",
          "recipient_name",
          "recipient_dni",
          "driver_id",
          "notes",
          "items",
          "updated"
        ],
        "additionalProperties": false
      },
      "ApiRemitoDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "remito"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "number": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "date": {
                "type": "string",
                "format": "date"
              },
              "customer": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObject5e70e1df84"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "origin": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObjectc15d6ab2fa"
                  },
                  {
                    "$ref": "#/components/schemas/ApiSharedObject5a978938b1"
                  },
                  {
                    "$ref": "#/components/schemas/ApiSharedObject05f64e43bb"
                  }
                ]
              },
              "created": {
                "type": "string",
                "format": "date-time"
              },
              "issuer": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObjectd6ec566aaf"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "remito_number": {
                "type": "integer"
              },
              "point_of_sale": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObject94c0cab352"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "carrier": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "delivery_address": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "scheduled_date": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "delivered_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "recipient_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "recipient_dni": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "driver_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "notes": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedObject912052d04a"
                }
              },
              "updated": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "number",
              "date",
              "customer",
              "origin",
              "created",
              "issuer",
              "remito_number",
              "point_of_sale",
              "carrier",
              "delivery_address",
              "scheduled_date",
              "delivered_at",
              "recipient_name",
              "recipient_dni",
              "driver_id",
              "notes",
              "items",
              "updated"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiDeliveryNoteIssueRequest": {
        "type": "object",
        "properties": {
          "talonario_id": {
            "type": "string",
            "format": "uuid"
          },
          "expected_revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "expected_content_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "expected_number": {
            "type": "integer",
            "minimum": 1,
            "maximum": 99999999
          }
        },
        "required": [
          "talonario_id",
          "expected_revision",
          "expected_content_hash"
        ],
        "additionalProperties": false
      },
      "ApiDeliveryNoteVoidRequest": {
        "type": "object",
        "properties": {
          "issuance_id": {
            "type": "string",
            "format": "uuid"
          },
          "reason": {
            "type": "string",
            "minLength": 3,
            "maxLength": 500
          }
        },
        "required": [
          "issuance_id",
          "reason"
        ],
        "additionalProperties": false
      },
      "ApiDeliveryNoteCreateRequest": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "notes": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "carrier": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "delivery_address": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "scheduled_date": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "recipient_name": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "recipient_document": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 50
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "origin": {
                "$ref": "#/components/schemas/ApiSharedObjectc15d6ab2fa"
              }
            },
            "required": [
              "origin"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "notes": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "carrier": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "delivery_address": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "scheduled_date": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "recipient_name": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "recipient_document": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 50
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "origin": {
                "$ref": "#/components/schemas/ApiSharedObject05f64e43bb"
              },
              "customer_id": {
                "type": "string",
                "format": "uuid"
              },
              "point_of_sale_id": {
                "type": "string",
                "format": "uuid"
              },
              "items": {
                "minItems": 1,
                "maxItems": 500,
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "product_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "warehouse_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "is_custom": {
                          "type": "boolean",
                          "const": false
                        },
                        "quantity": {
                          "type": "number",
                          "exclusiveMinimum": 0
                        }
                      },
                      "required": [
                        "product_id",
                        "quantity"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "is_custom": {
                          "type": "boolean",
                          "const": true
                        },
                        "quantity": {
                          "type": "number",
                          "exclusiveMinimum": 0
                        }
                      },
                      "required": [
                        "name",
                        "is_custom",
                        "quantity"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            },
            "required": [
              "origin",
              "customer_id",
              "point_of_sale_id",
              "items"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ApiDeliveryNoteListItem": {
        "type": "object",
        "properties": {
          "numbering_mode": {
            "$ref": "#/components/schemas/ApiSharedEnum4b1b5db8e0"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "legal_issuance": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject5a67c4e4e1"
              },
              {
                "type": "null"
              }
            ]
          },
          "object": {
            "type": "string",
            "const": "delivery_note"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "customer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject5e70e1df84"
              },
              {
                "type": "null"
              }
            ]
          },
          "origin": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectc15d6ab2fa"
              },
              {
                "$ref": "#/components/schemas/ApiSharedObject5a978938b1"
              },
              {
                "$ref": "#/components/schemas/ApiSharedObject05f64e43bb"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "numbering_mode",
          "revision",
          "legal_issuance",
          "object",
          "id",
          "number",
          "date",
          "customer",
          "origin",
          "created_at"
        ],
        "additionalProperties": false
      },
      "ApiDeliveryNoteListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "list"
          },
          "url": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "numbering_mode": {
                  "$ref": "#/components/schemas/ApiSharedEnum4b1b5db8e0"
                },
                "revision": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "legal_issuance": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject5a67c4e4e1"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "object": {
                  "type": "string",
                  "const": "delivery_note"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "customer": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject5e70e1df84"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "origin": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObjectc15d6ab2fa"
                    },
                    {
                      "$ref": "#/components/schemas/ApiSharedObject5a978938b1"
                    },
                    {
                      "$ref": "#/components/schemas/ApiSharedObject05f64e43bb"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "numbering_mode",
                "revision",
                "legal_issuance",
                "object",
                "id",
                "number",
                "date",
                "customer",
                "origin",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "request_id",
          "object",
          "url",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ApiDeliveryNoteDetail": {
        "type": "object",
        "properties": {
          "numbering_mode": {
            "$ref": "#/components/schemas/ApiSharedEnum4b1b5db8e0"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "legal_issuance": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject5a67c4e4e1"
              },
              {
                "type": "null"
              }
            ]
          },
          "object": {
            "type": "string",
            "const": "delivery_note"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "customer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject5e70e1df84"
              },
              {
                "type": "null"
              }
            ]
          },
          "origin": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectc15d6ab2fa"
              },
              {
                "$ref": "#/components/schemas/ApiSharedObject5a978938b1"
              },
              {
                "$ref": "#/components/schemas/ApiSharedObject05f64e43bb"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "content_hash": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Huella de los datos de impresión revisados. Enviá este valor como expected_content_hash al emitir un borrador."
          },
          "issuer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectd6ec566aaf"
              },
              {
                "type": "null"
              }
            ]
          },
          "eligible_talonarios": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf3b611a53b"
            },
            "description": "Talonarios vigentes para el borrador y su ubicación. La hoja propuesta se confirma al emitir."
          },
          "delivery_note_number": {
            "type": "integer"
          },
          "point_of_sale": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject94c0cab352"
              },
              {
                "type": "null"
              }
            ]
          },
          "carrier": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "scheduled_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "delivered_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "recipient_document": {
            "type": [
              "string",
              "null"
            ]
          },
          "driver_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject912052d04a"
            }
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "numbering_mode",
          "revision",
          "legal_issuance",
          "object",
          "id",
          "number",
          "date",
          "customer",
          "origin",
          "created_at",
          "content_hash",
          "issuer",
          "eligible_talonarios",
          "delivery_note_number",
          "point_of_sale",
          "carrier",
          "delivery_address",
          "scheduled_date",
          "delivered_at",
          "recipient_name",
          "recipient_document",
          "driver_id",
          "notes",
          "items",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiDeliveryNoteDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "numbering_mode": {
                "$ref": "#/components/schemas/ApiSharedEnum4b1b5db8e0"
              },
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "legal_issuance": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObject5a67c4e4e1"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "object": {
                "type": "string",
                "const": "delivery_note"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "number": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "date": {
                "type": "string",
                "format": "date"
              },
              "customer": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObject5e70e1df84"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "origin": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObjectc15d6ab2fa"
                  },
                  {
                    "$ref": "#/components/schemas/ApiSharedObject5a978938b1"
                  },
                  {
                    "$ref": "#/components/schemas/ApiSharedObject05f64e43bb"
                  }
                ]
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "content_hash": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Huella de los datos de impresión revisados. Enviá este valor como expected_content_hash al emitir un borrador."
              },
              "issuer": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObjectd6ec566aaf"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "eligible_talonarios": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedObjectf3b611a53b"
                },
                "description": "Talonarios vigentes para el borrador y su ubicación. La hoja propuesta se confirma al emitir."
              },
              "delivery_note_number": {
                "type": "integer"
              },
              "point_of_sale": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObject94c0cab352"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "carrier": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "delivery_address": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "scheduled_date": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "delivered_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "recipient_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "recipient_document": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "driver_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "notes": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedObject912052d04a"
                }
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "numbering_mode",
              "revision",
              "legal_issuance",
              "object",
              "id",
              "number",
              "date",
              "customer",
              "origin",
              "created_at",
              "content_hash",
              "issuer",
              "eligible_talonarios",
              "delivery_note_number",
              "point_of_sale",
              "carrier",
              "delivery_address",
              "scheduled_date",
              "delivered_at",
              "recipient_name",
              "recipient_document",
              "driver_id",
              "notes",
              "items",
              "updated_at"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiDeliveryNoteWriteResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "numbering_mode": {
                "$ref": "#/components/schemas/ApiSharedEnum4b1b5db8e0"
              },
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "legal_issuance": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObject5a67c4e4e1"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "object": {
                "type": "string",
                "const": "delivery_note"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "number": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "date": {
                "type": "string",
                "format": "date"
              },
              "customer": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObject5e70e1df84"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "origin": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObjectc15d6ab2fa"
                  },
                  {
                    "$ref": "#/components/schemas/ApiSharedObject5a978938b1"
                  },
                  {
                    "$ref": "#/components/schemas/ApiSharedObject05f64e43bb"
                  }
                ]
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "content_hash": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Huella de los datos de impresión revisados. Enviá este valor como expected_content_hash al emitir un borrador."
              },
              "issuer": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObjectd6ec566aaf"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "eligible_talonarios": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedObjectf3b611a53b"
                },
                "description": "Talonarios vigentes para el borrador y su ubicación. La hoja propuesta se confirma al emitir."
              },
              "delivery_note_number": {
                "type": "integer"
              },
              "point_of_sale": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObject94c0cab352"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "carrier": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "delivery_address": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "scheduled_date": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "delivered_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "recipient_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "recipient_document": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "driver_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "notes": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedObject912052d04a"
                }
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "numbering_mode",
              "revision",
              "legal_issuance",
              "object",
              "id",
              "number",
              "date",
              "customer",
              "origin",
              "created_at",
              "content_hash",
              "issuer",
              "eligible_talonarios",
              "delivery_note_number",
              "point_of_sale",
              "carrier",
              "delivery_address",
              "scheduled_date",
              "delivered_at",
              "recipient_name",
              "recipient_document",
              "driver_id",
              "notes",
              "items",
              "updated_at",
              "idempotent_replay"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiWebhookEndpoint": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "webhook_endpoint"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "enabled_events": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedEnum09382f5041"
            }
          },
          "api_version": {
            "$ref": "#/components/schemas/ApiSharedEnum5f610d8b6a"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum1c9cda998e"
          },
          "owner_type": {
            "$ref": "#/components/schemas/ApiSharedEnum4b017f6476"
          },
          "failure_count": {
            "type": "integer",
            "minimum": 0
          },
          "last_success_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_failure_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "disabled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "label",
          "url",
          "enabled_events",
          "api_version",
          "status",
          "owner_type",
          "failure_count",
          "last_success_at",
          "last_failure_at",
          "disabled_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiWebhookEndpointListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject21f30ba9b5"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiWebhookEndpointResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObject21f30ba9b5"
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiWebhookEndpointCreateRequest": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "enabled_events": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedEnum09382f5041"
            }
          },
          "api_version": {
            "$ref": "#/components/schemas/ApiSharedEnum5f610d8b6a"
          }
        },
        "required": [
          "label",
          "url",
          "enabled_events"
        ],
        "additionalProperties": false
      },
      "ApiWebhookEndpointUpdateRequest": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "enabled_events": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedEnum09382f5041"
            }
          },
          "api_version": {
            "$ref": "#/components/schemas/ApiSharedEnum5f610d8b6a"
          }
        },
        "additionalProperties": false
      },
      "ApiWebhookEndpointSecretResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "webhook_endpoint"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "label": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "enabled_events": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiSharedEnum09382f5041"
                }
              },
              "api_version": {
                "$ref": "#/components/schemas/ApiSharedEnum5f610d8b6a"
              },
              "status": {
                "$ref": "#/components/schemas/ApiSharedEnum1c9cda998e"
              },
              "owner_type": {
                "$ref": "#/components/schemas/ApiSharedEnum4b017f6476"
              },
              "failure_count": {
                "type": "integer",
                "minimum": 0
              },
              "last_success_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last_failure_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "disabled_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              },
              "signing_secret": {
                "type": "string"
              }
            },
            "required": [
              "object",
              "id",
              "label",
              "url",
              "enabled_events",
              "api_version",
              "status",
              "owner_type",
              "failure_count",
              "last_success_at",
              "last_failure_at",
              "disabled_at",
              "created_at",
              "updated_at",
              "signing_secret"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiWebhookEventTypeReference": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "webhook_event_type_reference"
          },
          "code": {
            "$ref": "#/components/schemas/ApiSharedEnum09382f5041"
          },
          "resource": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "required_scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "api_versions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedEnum5f610d8b6a"
            }
          }
        },
        "required": [
          "object",
          "code",
          "resource",
          "description",
          "required_scopes",
          "api_versions"
        ],
        "additionalProperties": false
      },
      "ApiWebhookEventTypeListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "webhook_event_type_reference"
                },
                "code": {
                  "$ref": "#/components/schemas/ApiSharedEnum09382f5041"
                },
                "resource": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "required_scopes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "api_versions": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiSharedEnum5f610d8b6a"
                  }
                }
              },
              "required": [
                "object",
                "code",
                "resource",
                "description",
                "required_scopes",
                "api_versions"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiWebhookTestResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "webhook_test"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "webhook_endpoint_id": {
                "type": "string",
                "format": "uuid"
              },
              "delivery_id": {
                "type": "string",
                "format": "uuid"
              },
              "status": {
                "type": "string",
                "const": "pending"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "object",
              "id",
              "webhook_endpoint_id",
              "delivery_id",
              "status",
              "created_at"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiTransferReadItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "number"
          },
          "received_quantity": {
            "type": "number"
          },
          "rejected_quantity": {
            "type": "number"
          },
          "product": {
            "$ref": "#/components/schemas/ApiSharedObject5924af92df"
          }
        },
        "required": [
          "id",
          "product_id",
          "quantity",
          "received_quantity",
          "rejected_quantity",
          "product"
        ],
        "additionalProperties": false
      },
      "ApiTransferReadDetail": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "stock_transfer"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "organization_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "target_warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "transfer_date": {
            "type": "string",
            "format": "date-time"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum736f0d077b"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string",
            "format": "uuid"
          },
          "updated_by": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_warehouse": {
            "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
          },
          "target_warehouse": {
            "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject0afbf8c23c"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          }
        },
        "required": [
          "object",
          "id",
          "organization_id",
          "source_warehouse_id",
          "target_warehouse_id",
          "transfer_date",
          "notes",
          "status",
          "created_at",
          "updated_at",
          "created_by",
          "updated_by",
          "source_warehouse",
          "target_warehouse",
          "items",
          "tags"
        ],
        "additionalProperties": false
      },
      "ApiTransferListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject29aea9dac9"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiTransferDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObject29aea9dac9"
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiCustomerMetafieldDefinition": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "metafield_definition"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "field_type": {
            "$ref": "#/components/schemas/ApiSharedEnumf7fe6bfeb0"
          },
          "validations": {
            "$ref": "#/components/schemas/ApiSharedObjectba357c1d29"
          }
        },
        "required": [
          "object",
          "id",
          "key",
          "name",
          "description",
          "field_type",
          "validations"
        ],
        "additionalProperties": false
      },
      "ApiCustomerMetafieldDefinitionsResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "list"
          },
          "url": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "metafield_definition"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "key": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "field_type": {
                  "$ref": "#/components/schemas/ApiSharedEnumf7fe6bfeb0"
                },
                "validations": {
                  "$ref": "#/components/schemas/ApiSharedObjectba357c1d29"
                }
              },
              "required": [
                "object",
                "id",
                "key",
                "name",
                "description",
                "field_type",
                "validations"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "request_id",
          "object",
          "url",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ApiCustomer": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "customer"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "apartment": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery_carrier": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_category": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "default_price_list_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_term_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "province_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_active": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          }
        },
        "required": [
          "object",
          "id",
          "code",
          "name",
          "company_name",
          "description",
          "email",
          "phone",
          "address",
          "apartment",
          "city",
          "delivery_carrier",
          "delivery_address",
          "tax_id",
          "tax_id_type",
          "tax_category",
          "contact_type",
          "default_price_list_id",
          "payment_term_id",
          "payment_term_days",
          "province_id",
          "is_active",
          "created_at",
          "updated_at",
          "tags"
        ],
        "additionalProperties": false
      },
      "ApiCustomerDetail": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "customer"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "apartment": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery_carrier": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_category": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "default_price_list_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_term_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "province_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_active": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          },
          "default_account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "metafields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject23505030dc"
            }
          },
          "arca_destination_country": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 999
              },
              {
                "type": "null"
              }
            ]
          },
          "foreign_tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "arca_country_tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "postal_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "assigned_salesperson_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_ganancias_regimen": {
            "type": [
              "string",
              "null"
            ]
          },
          "assigned_salesperson": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject2bc2c4916e"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_price_list": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "sales_overview": {
            "$ref": "#/components/schemas/ApiSharedObject39b700d58a"
          }
        },
        "required": [
          "object",
          "id",
          "code",
          "name",
          "company_name",
          "description",
          "email",
          "phone",
          "address",
          "apartment",
          "city",
          "delivery_carrier",
          "delivery_address",
          "tax_id",
          "tax_id_type",
          "tax_category",
          "contact_type",
          "default_price_list_id",
          "payment_term_id",
          "payment_term_days",
          "province_id",
          "is_active",
          "created_at",
          "updated_at",
          "tags",
          "default_account_id",
          "metafields",
          "arca_destination_country",
          "foreign_tax_id",
          "arca_country_tax_id",
          "country",
          "postal_code",
          "assigned_salesperson_id",
          "default_ganancias_regimen",
          "assigned_salesperson",
          "default_price_list",
          "sales_overview"
        ],
        "additionalProperties": false
      },
      "ApiCustomerMutationRequest": {
        "type": "object",
        "properties": {
          "default_account_id": {
            "description": "Setting or clearing this field also requires treasury:write. Omit it to preserve the default.",
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "code": {
            "description": "Código visible del contacto; se genera si se omite",
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 70
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "format": "email"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 30
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_id": {
            "description": "Documento sin guiones, o \"0\" cuando tax_id_type es \"Otro\"",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_id_type": {
            "description": "\"Otro\" requiere tax_id=\"0\" y categoría efectiva Consumidor Final",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumcb6fc950ce"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_category": {
            "description": "foreign_customer requiere country, arca_destination_country y foreign_tax_id o arca_country_tax_id. Su identidad reemplaza tax_id, tax_id_type y province; en actualizaciones se conservan los campos omitidos, pero cambiar arca_destination_country requiere enviar también el nuevo country.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumafe76ccc88"
              },
              {
                "type": "null"
              }
            ]
          },
          "arca_destination_country": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 999
              },
              {
                "type": "null"
              }
            ]
          },
          "foreign_tax_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ]
          },
          "arca_country_tax_id": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{11}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "metafields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject23505030dc"
            }
          },
          "country": {
            "description": "Nombre del país. Obligatorio al crear un foreign_customer y al cambiar arca_destination_country; las actualizaciones sin cambio de destino conservan el nombre omitido.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ]
          },
          "province": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 70
              },
              {
                "type": "null"
              }
            ]
          },
          "apartment": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10
              },
              {
                "type": "null"
              }
            ]
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 8
              },
              {
                "type": "null"
              }
            ]
          },
          "delivery_carrier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "delivery_address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "assigned_salesperson_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_price_list_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_term_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumd34af90520"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "ApiCustomerUpdateRequest": {
        "type": "object",
        "properties": {
          "default_account_id": {
            "description": "Setting or clearing this field also requires treasury:write. Omit it to preserve the default.",
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "code": {
            "description": "Código visible del contacto; se genera si se omite",
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 70
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "format": "email"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 30
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_id": {
            "description": "Documento sin guiones, o \"0\" cuando tax_id_type es \"Otro\"",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_id_type": {
            "description": "\"Otro\" requiere tax_id=\"0\" y categoría efectiva Consumidor Final",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumcb6fc950ce"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_category": {
            "description": "foreign_customer requiere country, arca_destination_country y foreign_tax_id o arca_country_tax_id. Su identidad reemplaza tax_id, tax_id_type y province; en actualizaciones se conservan los campos omitidos, pero cambiar arca_destination_country requiere enviar también el nuevo country.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumafe76ccc88"
              },
              {
                "type": "null"
              }
            ]
          },
          "arca_destination_country": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 999
              },
              {
                "type": "null"
              }
            ]
          },
          "foreign_tax_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ]
          },
          "arca_country_tax_id": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{11}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "metafields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject23505030dc"
            }
          },
          "country": {
            "description": "Nombre del país. Obligatorio al crear un foreign_customer y al cambiar arca_destination_country; las actualizaciones sin cambio de destino conservan el nombre omitido.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ]
          },
          "province": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 70
              },
              {
                "type": "null"
              }
            ]
          },
          "apartment": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10
              },
              {
                "type": "null"
              }
            ]
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 8
              },
              {
                "type": "null"
              }
            ]
          },
          "delivery_carrier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "delivery_address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "assigned_salesperson_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_price_list_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_term_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumd34af90520"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ApiCustomerListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "customer"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "code": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "company_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "email": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "phone": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "apartment": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "city": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "delivery_carrier": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "delivery_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tax_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tax_id_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tax_category": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "contact_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "default_price_list_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "payment_term_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "payment_term_days": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 365,
                      "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "province_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "is_active": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
                  }
                }
              },
              "required": [
                "object",
                "id",
                "code",
                "name",
                "company_name",
                "description",
                "email",
                "phone",
                "address",
                "apartment",
                "city",
                "delivery_carrier",
                "delivery_address",
                "tax_id",
                "tax_id_type",
                "tax_category",
                "contact_type",
                "default_price_list_id",
                "payment_term_id",
                "payment_term_days",
                "province_id",
                "is_active",
                "created_at",
                "updated_at",
                "tags"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiCustomerDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObjectd4462f23a0"
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiCustomerCreateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "customer": {
                "$ref": "#/components/schemas/ApiSharedObjectd4462f23a0"
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "customer",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiCustomerUpdateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "customer": {
                "$ref": "#/components/schemas/ApiSharedObjectd4462f23a0"
              }
            },
            "required": [
              "customer"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiTag": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "tag"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "scope": {
            "$ref": "#/components/schemas/ApiSharedEnum09f8155a9a"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "color": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum599647cb76"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "archived_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "scope",
          "name",
          "slug",
          "color",
          "description",
          "archived_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiTagCreateRequest": {
        "type": "object",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/ApiSharedEnum09f8155a9a"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 70
          },
          "color": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum599647cb76"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "scope",
          "name"
        ],
        "additionalProperties": false
      },
      "ApiTagUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 70
          },
          "color": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum599647cb76"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "archived": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ApiApplyTagsRequest": {
        "type": "object",
        "properties": {
          "entity_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "add_tag_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "remove_tag_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "entity_ids",
          "add_tag_ids",
          "remove_tag_ids"
        ],
        "additionalProperties": false
      },
      "ApiTagsListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiTagCreateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "tag": {
                "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "tag",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiTagUpdateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "tag": {
                "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
              }
            },
            "required": [
              "tag"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiApplyTagsResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "entity_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "added": {
                "type": "integer",
                "minimum": 0
              },
              "removed": {
                "type": "integer",
                "minimum": 0
              },
              "total": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "entity_ids",
              "added",
              "removed",
              "total"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiStockMovementRequest": {
        "type": "object",
        "properties": {
          "warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "mode": {
            "type": "string",
            "enum": [
              "delta",
              "replace"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "inbound",
              "outbound"
            ]
          },
          "operation_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "string",
                "format": "date-time"
              }
            ],
            "description": "Fecha ISO (YYYY-MM-DD) u hora ISO 8601 completa."
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "notes": {
            "type": "string",
            "maxLength": 2000
          },
          "items": {
            "minItems": 1,
            "maxItems": 2500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "product_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "quantity": {
                  "type": "number",
                  "description": "Debe ser mayor a cero para movimientos delta. Las correcciones por reemplazo aceptan cualquier cantidad final finita, incluidos valores negativos."
                },
                "expected_quantity": {
                  "description": "Solo para mode replace: stock disponible que observaste para este producto o combo en la ubicación. Si cambió, el movimiento completo devuelve STATE_CONFLICT (409). No se acepta en mode delta.",
                  "type": "number"
                }
              },
              "required": [
                "product_id",
                "quantity"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "warehouse_id",
          "mode",
          "operation_date",
          "reason",
          "items"
        ],
        "additionalProperties": false
      },
      "ApiStockMovementResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "stock_movement_id": {
                "type": "string",
                "format": "uuid"
              },
              "transaction_group_id": {
                "type": "string",
                "format": "uuid"
              },
              "affected_product_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "stock_movement_id",
              "transaction_group_id",
              "affected_product_ids",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiPaymentMethod": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "payment_method"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "icon": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "$ref": "#/components/schemas/ApiSharedEnum377ec234cb"
          },
          "bank_account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "fee_percentage": {
            "type": [
              "string",
              "null"
            ]
          },
          "fee_fixed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "requires_reference": {
            "type": "boolean"
          },
          "visibility": {
            "$ref": "#/components/schemas/ApiSharedEnum73bb779813"
          },
          "is_active": {
            "type": "boolean"
          },
          "is_default": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "installment_plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectfd1bf60b79"
            }
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "icon",
          "type",
          "bank_account_id",
          "fee_percentage",
          "fee_fixed",
          "requires_reference",
          "visibility",
          "is_active",
          "is_default",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiPaymentMethodMutationRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "type": {
            "$ref": "#/components/schemas/ApiSharedEnum377ec234cb"
          },
          "bank_account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "linked_account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "fee_percentage": {
            "type": [
              "string",
              "null"
            ]
          },
          "fee_fixed": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "requires_reference": {
            "type": "boolean"
          },
          "visibility": {
            "$ref": "#/components/schemas/ApiSharedEnum73bb779813"
          },
          "installment_plans": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "required": [
                "code",
                "label"
              ],
              "additionalProperties": false
            }
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "ApiPaymentMethodCreateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "payment_method": {
                "$ref": "#/components/schemas/ApiSharedObject73a9297be0"
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "payment_method",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiPaymentMethodUpdateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "payment_method": {
                "$ref": "#/components/schemas/ApiSharedObject73a9297be0"
              }
            },
            "required": [
              "payment_method"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiCustomerPaymentListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "payment_date": {
            "type": "string"
          },
          "amount": {
            "type": "integer"
          },
          "balance": {
            "type": "integer"
          },
          "formatted_payment_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "payment_method": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectaf3c3f0696"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_method_count": {
            "type": "integer"
          },
          "related_entity": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjecteb6efa80ed"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject7e70bcc878"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at_cursor": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "payment_date",
          "amount",
          "balance",
          "formatted_payment_number",
          "currency",
          "payment_method",
          "payment_method_count",
          "related_entity",
          "created_by",
          "created_at",
          "created_at_cursor",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiCustomerPayment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "const": "customer"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum65e97ceeee"
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "contact_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "formatted_payment_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_date": {
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "settlement_currency": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
              },
              {
                "type": "null"
              }
            ]
          },
          "settlement_total_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "exchange_rate": {
            "type": [
              "string",
              "number",
              "null"
            ]
          },
          "total_amount": {
            "type": "integer"
          },
          "balance": {
            "type": "integer"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "splits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject0c2dce233d"
            }
          },
          "applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "credit_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "journal_line_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "advance_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "other_credit_applications": {
            "description": "Créditos manuales y otros créditos contables que aplicó la cobranza, sin notas de crédito ni anticipos.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "withholdings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject31607d73d9"
            }
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "contact_id",
          "contact_name",
          "payment_number",
          "formatted_payment_number",
          "payment_date",
          "currency",
          "total_amount",
          "balance",
          "created_at",
          "created_by_name"
        ],
        "additionalProperties": false
      },
      "ApiCustomerPaymentCreateRequest": {
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "point_of_sale_id": {
            "type": "string",
            "format": "uuid"
          },
          "payment_date": {
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "exchange_rate": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "total_amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "settlement_currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "settlement_total_amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "session_id": {
            "type": "string",
            "format": "uuid"
          },
          "notes": {
            "type": "string",
            "maxLength": 1000
          },
          "splits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectd498e17ec0"
            }
          },
          "applications": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sale_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "applied_amount": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                }
              },
              "required": [
                "sale_id",
                "applied_amount"
              ],
              "additionalProperties": false
            }
          },
          "journal_line_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectdaa374f786"
            }
          },
          "credit_journal_line_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectdaa374f786"
            }
          },
          "credit_note_applications": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "credit_sale_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "applied_amount": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                }
              },
              "required": [
                "credit_sale_id",
                "applied_amount"
              ],
              "additionalProperties": false
            }
          },
          "advance_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject6447103182"
            }
          },
          "withholdings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject31607d73d9"
            }
          }
        },
        "required": [
          "customer_id",
          "point_of_sale_id",
          "payment_date",
          "currency",
          "total_amount",
          "splits"
        ],
        "additionalProperties": false
      },
      "ApiCustomerPaymentCreateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "customer_payment": {
                "$ref": "#/components/schemas/ApiSharedObject04f7a42bab"
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "customer_payment",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiCustomerPaymentListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "payment_date": {
                  "type": "string"
                },
                "amount": {
                  "type": "integer"
                },
                "balance": {
                  "type": "integer"
                },
                "formatted_payment_number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "currency": {
                  "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
                },
                "payment_method": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObjectaf3c3f0696"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "payment_method_count": {
                  "type": "integer"
                },
                "related_entity": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObjecteb6efa80ed"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_by": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject7e70bcc878"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "created_at_cursor": {
                  "type": "string"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "payment_date",
                "amount",
                "balance",
                "formatted_payment_number",
                "currency",
                "payment_method",
                "payment_method_count",
                "related_entity",
                "created_by",
                "created_at",
                "created_at_cursor",
                "updated_at"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiCustomerPaymentDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "customer_payment": {
                "$ref": "#/components/schemas/ApiSharedObject04f7a42bab"
              }
            },
            "required": [
              "customer_payment"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiCustomerPaymentVoidResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "customer_payment": {
                "$ref": "#/components/schemas/ApiSharedObjectee9c57275f"
              }
            },
            "required": [
              "customer_payment"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiSupplierPaymentListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "payment_date": {
            "type": "string"
          },
          "amount": {
            "type": "integer"
          },
          "balance": {
            "type": "integer"
          },
          "formatted_payment_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "payment_method": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectaf3c3f0696"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_method_count": {
            "type": "integer"
          },
          "related_entity": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject59213d7914"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject7e70bcc878"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at_cursor": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "purchase_count": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "payment_date",
          "amount",
          "balance",
          "formatted_payment_number",
          "currency",
          "payment_method",
          "payment_method_count",
          "related_entity",
          "created_by",
          "created_at",
          "created_at_cursor",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiSupplierPayment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "const": "supplier"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum65e97ceeee"
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "contact_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "formatted_payment_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_date": {
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "settlement_currency": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
              },
              {
                "type": "null"
              }
            ]
          },
          "settlement_total_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "exchange_rate": {
            "type": [
              "string",
              "number",
              "null"
            ]
          },
          "total_amount": {
            "type": "integer"
          },
          "balance": {
            "type": "integer"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "splits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject0c2dce233d"
            }
          },
          "applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "credit_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "journal_line_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "advance_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "other_credit_applications": {
            "description": "Créditos manuales y otros créditos contables que aplicó la cobranza, sin notas de crédito ni anticipos.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "withholdings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject31607d73d9"
            }
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "contact_id",
          "contact_name",
          "payment_number",
          "formatted_payment_number",
          "payment_date",
          "currency",
          "total_amount",
          "balance",
          "created_at",
          "created_by_name"
        ],
        "additionalProperties": false
      },
      "ApiSupplierPaymentCreateRequest": {
        "type": "object",
        "properties": {
          "supplier_id": {
            "type": "string",
            "format": "uuid"
          },
          "point_of_sale_id": {
            "type": "string",
            "format": "uuid"
          },
          "payment_date": {
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "exchange_rate": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "total_amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "settlement_currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "settlement_total_amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "notes": {
            "type": "string",
            "maxLength": 1000
          },
          "splits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectd498e17ec0"
            }
          },
          "applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf91176efb5"
            }
          },
          "journal_line_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectdaa374f786"
            }
          },
          "credit_journal_line_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectdaa374f786"
            }
          },
          "credit_target_applications": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ApiSharedObjectf91176efb5"
                },
                {
                  "$ref": "#/components/schemas/ApiSharedObjectdaa374f786"
                }
              ]
            }
          },
          "credit_note_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectc2ed2476df"
            }
          },
          "advance_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject6447103182"
            }
          },
          "withholdings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject31607d73d9"
            }
          }
        },
        "required": [
          "supplier_id",
          "point_of_sale_id",
          "payment_date",
          "currency",
          "total_amount",
          "splits"
        ],
        "additionalProperties": false
      },
      "ApiSupplierPaymentUpdateRequest": {
        "type": "object",
        "properties": {
          "supplier_id": {
            "type": "string",
            "format": "uuid"
          },
          "point_of_sale_id": {
            "type": "string",
            "format": "uuid"
          },
          "payment_date": {
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "exchange_rate": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "total_amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "settlement_currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "settlement_total_amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "notes": {
            "type": "string",
            "maxLength": 1000
          },
          "splits": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "payment_method_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "amount": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "reference": {
                  "type": "string",
                  "maxLength": 255
                },
                "card_brand": {
                  "type": "string",
                  "maxLength": 100
                },
                "card_batch_number": {
                  "type": "string",
                  "maxLength": 100
                },
                "card_coupon_number": {
                  "type": "string",
                  "maxLength": 100
                },
                "card_installment_plan_code": {
                  "type": "string",
                  "maxLength": 100
                },
                "notes": {
                  "type": "string",
                  "maxLength": 500
                },
                "fee_amount": {
                  "type": "integer",
                  "minimum": 0
                },
                "fee_percentage_applied": {
                  "type": "string"
                },
                "fee_fixed_applied": {
                  "type": "integer",
                  "minimum": 0
                },
                "net_amount": {
                  "type": "integer",
                  "minimum": 0
                },
                "register_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "safe_id": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "payment_method_id",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf91176efb5"
            }
          },
          "journal_line_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectdaa374f786"
            }
          },
          "credit_journal_line_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectdaa374f786"
            }
          },
          "credit_target_applications": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ApiSharedObjectf91176efb5"
                },
                {
                  "$ref": "#/components/schemas/ApiSharedObjectdaa374f786"
                }
              ]
            }
          },
          "credit_note_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectc2ed2476df"
            }
          },
          "advance_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject6447103182"
            }
          },
          "withholdings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject31607d73d9"
            }
          }
        },
        "required": [
          "supplier_id",
          "point_of_sale_id",
          "payment_date",
          "currency",
          "total_amount",
          "splits"
        ],
        "additionalProperties": false
      },
      "ApiSupplierPaymentCreateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "supplier_payment": {
                "$ref": "#/components/schemas/ApiSharedObject0f748b4000"
              },
              "idempotent_replay": {
                "type": "boolean"
              }
            },
            "required": [
              "supplier_payment",
              "idempotent_replay"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiSupplierPaymentUpdateResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObjectc0cace1787"
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "request_id",
          "data",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiSupplierPaymentListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "payment_date": {
                  "type": "string"
                },
                "amount": {
                  "type": "integer"
                },
                "balance": {
                  "type": "integer"
                },
                "formatted_payment_number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "currency": {
                  "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
                },
                "payment_method": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObjectaf3c3f0696"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "payment_method_count": {
                  "type": "integer"
                },
                "related_entity": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject59213d7914"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_by": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject7e70bcc878"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "created_at_cursor": {
                  "type": "string"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "purchase_count": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "payment_date",
                "amount",
                "balance",
                "formatted_payment_number",
                "currency",
                "payment_method",
                "payment_method_count",
                "related_entity",
                "created_by",
                "created_at",
                "created_at_cursor",
                "updated_at"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiSupplierPaymentDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObjectc0cace1787"
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiSupplierPaymentVoidResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "supplier_payment": {
                "$ref": "#/components/schemas/ApiSharedObjectee9c57275f"
              }
            },
            "required": [
              "supplier_payment"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiPaymentMethodListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject73a9297be0"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiPaymentMethodDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObject73a9297be0"
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiBankAccount": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "bank_account"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "$ref": "#/components/schemas/ApiSharedEnum83b768347f"
          },
          "bank_name": {
            "type": "string"
          },
          "account_name": {
            "type": "string"
          },
          "cbu": {
            "type": [
              "string",
              "null"
            ]
          },
          "alias": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "opening_balance": {
            "type": "integer"
          },
          "opening_balance_date": {
            "type": "string",
            "format": "date"
          },
          "uses_checkbook": {
            "type": "boolean"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnumd952d5ce8e"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "kind",
          "bank_name",
          "account_name",
          "cbu",
          "alias",
          "currency",
          "opening_balance",
          "opening_balance_date",
          "uses_checkbook",
          "status",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiBankAccountListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectd862a95f13"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiBankAccountDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObjectd862a95f13"
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiTreasuryBalance": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "treasury_balance"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "balance_type": {
            "$ref": "#/components/schemas/ApiSharedEnum53162db3eb"
          },
          "bank_account_kind": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum83b768347f"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "native_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "native_amount_quality": {
            "$ref": "#/components/schemas/ApiSharedEnum714ff181d6"
          },
          "functional_amount": {
            "type": "integer"
          },
          "functional_currency": {
            "type": "string",
            "const": "ARS"
          },
          "anomaly_count": {
            "type": "integer",
            "minimum": 0
          },
          "as_of": {
            "type": "string",
            "format": "date"
          },
          "calculated_at": {
            "type": "string",
            "format": "date-time"
          },
          "visibility_scope": {
            "$ref": "#/components/schemas/ApiSharedEnumd440d6785b"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnumd952d5ce8e"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "balance_type",
          "bank_account_kind",
          "name",
          "description",
          "currency",
          "native_amount",
          "native_amount_quality",
          "functional_amount",
          "functional_currency",
          "anomaly_count",
          "as_of",
          "calculated_at",
          "visibility_scope",
          "status",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiTreasuryBalanceListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "treasury_balance"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "balance_type": {
                  "$ref": "#/components/schemas/ApiSharedEnum53162db3eb"
                },
                "bank_account_kind": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedEnum83b768347f"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "currency": {
                  "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
                },
                "native_amount": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "native_amount_quality": {
                  "$ref": "#/components/schemas/ApiSharedEnum714ff181d6"
                },
                "functional_amount": {
                  "type": "integer"
                },
                "functional_currency": {
                  "type": "string",
                  "const": "ARS"
                },
                "anomaly_count": {
                  "type": "integer",
                  "minimum": 0
                },
                "as_of": {
                  "type": "string",
                  "format": "date"
                },
                "calculated_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "visibility_scope": {
                  "$ref": "#/components/schemas/ApiSharedEnumd440d6785b"
                },
                "status": {
                  "$ref": "#/components/schemas/ApiSharedEnumd952d5ce8e"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "object",
                "id",
                "balance_type",
                "bank_account_kind",
                "name",
                "description",
                "currency",
                "native_amount",
                "native_amount_quality",
                "functional_amount",
                "functional_currency",
                "anomaly_count",
                "as_of",
                "calculated_at",
                "visibility_scope",
                "status",
                "created_at",
                "updated_at"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiTreasuryMovement": {
        "type": "object",
        "properties": {
          "treasury_movement_id": {
            "default": null,
            "description": "Editable treasury_adjustments.id for manual movements; id is the unified row ID",
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "contact_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "contact_name": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "account_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "account_name": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "type": "string",
            "const": "treasury_movement"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "balance_id": {
            "type": "string",
            "format": "uuid"
          },
          "balance_type": {
            "$ref": "#/components/schemas/ApiSharedEnum53162db3eb"
          },
          "balance_name": {
            "type": "string"
          },
          "occurred_on": {
            "type": "string",
            "format": "date"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "native_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "native_amount_quality": {
            "$ref": "#/components/schemas/ApiSharedEnum714ff181d6"
          },
          "functional_amount": {
            "type": "integer"
          },
          "functional_currency": {
            "type": "string",
            "const": "ARS"
          },
          "functional_amount_origin": {
            "$ref": "#/components/schemas/ApiSharedEnumf03e06f92c"
          },
          "rate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject45b71eae86"
              },
              {
                "type": "null"
              }
            ]
          },
          "movement_type": {
            "$ref": "#/components/schemas/ApiSharedEnumc1c44f3acf"
          },
          "source_type": {
            "type": "string"
          },
          "source_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "visibility_scope": {
            "$ref": "#/components/schemas/ApiSharedEnumd440d6785b"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "balance_id",
          "balance_type",
          "balance_name",
          "occurred_on",
          "currency",
          "native_amount",
          "native_amount_quality",
          "functional_amount",
          "functional_currency",
          "functional_amount_origin",
          "rate",
          "movement_type",
          "source_type",
          "source_id",
          "reference",
          "description",
          "visibility_scope",
          "created_at"
        ],
        "additionalProperties": false
      },
      "ApiTreasuryMovementListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "treasury_movement_id": {
                  "default": null,
                  "description": "Editable treasury_adjustments.id for manual movements; id is the unified row ID",
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "contact_id": {
                  "default": null,
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "contact_name": {
                  "default": null,
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "account_id": {
                  "default": null,
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "account_name": {
                  "default": null,
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "object": {
                  "type": "string",
                  "const": "treasury_movement"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "balance_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "balance_type": {
                  "$ref": "#/components/schemas/ApiSharedEnum53162db3eb"
                },
                "balance_name": {
                  "type": "string"
                },
                "occurred_on": {
                  "type": "string",
                  "format": "date"
                },
                "currency": {
                  "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
                },
                "native_amount": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "native_amount_quality": {
                  "$ref": "#/components/schemas/ApiSharedEnum714ff181d6"
                },
                "functional_amount": {
                  "type": "integer"
                },
                "functional_currency": {
                  "type": "string",
                  "const": "ARS"
                },
                "functional_amount_origin": {
                  "$ref": "#/components/schemas/ApiSharedEnumf03e06f92c"
                },
                "rate": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedObject45b71eae86"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "movement_type": {
                  "$ref": "#/components/schemas/ApiSharedEnumc1c44f3acf"
                },
                "source_type": {
                  "type": "string"
                },
                "source_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "reference": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "visibility_scope": {
                  "$ref": "#/components/schemas/ApiSharedEnumd440d6785b"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "object",
                "id",
                "balance_id",
                "balance_type",
                "balance_name",
                "occurred_on",
                "currency",
                "native_amount",
                "native_amount_quality",
                "functional_amount",
                "functional_currency",
                "functional_amount_origin",
                "rate",
                "movement_type",
                "source_type",
                "source_id",
                "reference",
                "description",
                "visibility_scope",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiManualTreasuryMovementRequest": {
        "type": "object",
        "properties": {
          "balance": {
            "$ref": "#/components/schemas/ApiSharedObject1bdf8f7029"
          },
          "direction": {
            "$ref": "#/components/schemas/ApiSharedEnumba3dc7ee2b"
          },
          "amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "occurred_on": {
            "type": "string",
            "format": "date"
          },
          "account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "lines": {
            "minItems": 1,
            "maxItems": 32,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject39414c953b"
            }
          },
          "exchange_rate": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0,
                "maximum": 1000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "statement_line": {
            "$ref": "#/components/schemas/ApiSharedObjectfd7f591c89"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center1_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center2_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center3_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "distributions": {
            "minItems": 2,
            "maxItems": 32,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject95caea9bee"
            }
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "balance",
          "direction",
          "amount",
          "occurred_on"
        ],
        "additionalProperties": false
      },
      "ApiUpdateTreasuryMovementRequest": {
        "type": "object",
        "properties": {
          "balance": {
            "$ref": "#/components/schemas/ApiSharedObject1bdf8f7029"
          },
          "direction": {
            "$ref": "#/components/schemas/ApiSharedEnumba3dc7ee2b"
          },
          "amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "occurred_on": {
            "type": "string",
            "format": "date"
          },
          "account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "lines": {
            "minItems": 1,
            "maxItems": 32,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject39414c953b"
            }
          },
          "exchange_rate": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0,
                "maximum": 1000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "statement_line": {
            "$ref": "#/components/schemas/ApiSharedObjectfd7f591c89"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center1_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center2_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center3_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "distributions": {
            "minItems": 2,
            "maxItems": 32,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject95caea9bee"
            }
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "balance",
          "direction",
          "amount",
          "occurred_on",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiDeleteTreasuryMovementRequest": {
        "type": "object",
        "properties": {
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiManualTreasuryMovementResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "treasury_movement"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "balance": {
                "$ref": "#/components/schemas/ApiSharedObject16a22cc706"
              },
              "direction": {
                "$ref": "#/components/schemas/ApiSharedEnumba3dc7ee2b"
              },
              "currency": {
                "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
              },
              "native_amount": {
                "type": "integer"
              },
              "functional_amount": {
                "type": "integer"
              },
              "functional_currency": {
                "type": "string",
                "const": "ARS"
              },
              "exchange_rate": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "exchange_rate_source": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedEnum3e321043c1"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "exchange_rate_date": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "exchange_difference_amount": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurred_on": {
                "type": "string",
                "format": "date"
              },
              "source_type": {
                "type": "string"
              },
              "account_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "contact_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "reference": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "cost_center1_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "cost_center2_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "cost_center3_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "distributions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "cost_center1_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "amount_cents": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cost_center1_id",
                    "amount_cents"
                  ],
                  "additionalProperties": false
                }
              },
              "statement_line": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "source": {
                        "type": "string"
                      },
                      "key": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "source",
                      "key"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "lines": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "account_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "amount": {
                      "type": "integer"
                    },
                    "cost_center1_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "cost_center2_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "cost_center3_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "account_id",
                    "amount",
                    "cost_center1_id",
                    "cost_center2_id",
                    "cost_center3_id",
                    "description"
                  ],
                  "additionalProperties": false
                }
              },
              "rate": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObject45b71eae86"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "object",
              "id",
              "balance",
              "direction",
              "currency",
              "native_amount",
              "functional_amount",
              "functional_currency",
              "exchange_rate",
              "exchange_rate_source",
              "exchange_rate_date",
              "exchange_difference_amount",
              "occurred_on",
              "source_type",
              "account_id",
              "contact_id",
              "description",
              "reference",
              "note",
              "cost_center1_id",
              "cost_center2_id",
              "cost_center3_id",
              "distributions",
              "statement_line",
              "lines",
              "rate",
              "created_at",
              "updated_at"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiDeletedTreasuryMovementResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "treasury_movement"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "deleted": {
                "type": "boolean",
                "const": true
              }
            },
            "required": [
              "object",
              "id",
              "deleted"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiFundsTransfer": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "funds_transfer"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "source": {
            "$ref": "#/components/schemas/ApiSharedObject16a22cc706"
          },
          "destination": {
            "$ref": "#/components/schemas/ApiSharedObject16a22cc706"
          },
          "amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "currency": {
            "type": "string",
            "const": "ARS"
          },
          "occurred_on": {
            "type": "string",
            "format": "date"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "source",
          "destination",
          "amount",
          "currency",
          "occurred_on",
          "reference",
          "description",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiFundsTransferDetail": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "funds_transfer"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "source": {
            "$ref": "#/components/schemas/ApiSharedObject16a22cc706"
          },
          "destination": {
            "$ref": "#/components/schemas/ApiSharedObject16a22cc706"
          },
          "amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "currency": {
            "type": "string",
            "const": "ARS"
          },
          "occurred_on": {
            "type": "string",
            "format": "date"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "accounting_effects": {
            "type": "array",
            "prefixItems": [
              {
                "$ref": "#/components/schemas/ApiSharedObject828d107a8b"
              },
              {
                "$ref": "#/components/schemas/ApiSharedObject828d107a8b"
              }
            ],
            "items": false,
            "minItems": 2,
            "maxItems": 2
          }
        },
        "required": [
          "object",
          "id",
          "source",
          "destination",
          "amount",
          "currency",
          "occurred_on",
          "reference",
          "description",
          "created_at",
          "updated_at",
          "accounting_effects"
        ],
        "additionalProperties": false
      },
      "ApiFundsTransferCreateRequest": {
        "type": "object",
        "properties": {
          "source": {
            "$ref": "#/components/schemas/ApiSharedObject16a22cc706"
          },
          "destination": {
            "$ref": "#/components/schemas/ApiSharedObject16a22cc706"
          },
          "amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "occurred_on": {
            "type": "string",
            "format": "date"
          },
          "reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "source",
          "destination",
          "amount",
          "occurred_on"
        ],
        "additionalProperties": false
      },
      "ApiFundsTransferListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "funds_transfer"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "source": {
                  "$ref": "#/components/schemas/ApiSharedObject16a22cc706"
                },
                "destination": {
                  "$ref": "#/components/schemas/ApiSharedObject16a22cc706"
                },
                "amount": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "currency": {
                  "type": "string",
                  "const": "ARS"
                },
                "occurred_on": {
                  "type": "string",
                  "format": "date"
                },
                "reference": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "object",
                "id",
                "source",
                "destination",
                "amount",
                "currency",
                "occurred_on",
                "reference",
                "description",
                "created_at",
                "updated_at"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiFundsTransferDetailResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "funds_transfer"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "source": {
                "$ref": "#/components/schemas/ApiSharedObject16a22cc706"
              },
              "destination": {
                "$ref": "#/components/schemas/ApiSharedObject16a22cc706"
              },
              "amount": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "currency": {
                "type": "string",
                "const": "ARS"
              },
              "occurred_on": {
                "type": "string",
                "format": "date"
              },
              "reference": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              },
              "accounting_effects": {
                "type": "array",
                "prefixItems": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObject828d107a8b"
                  },
                  {
                    "$ref": "#/components/schemas/ApiSharedObject828d107a8b"
                  }
                ],
                "items": false,
                "minItems": 2,
                "maxItems": 2
              }
            },
            "required": [
              "object",
              "id",
              "source",
              "destination",
              "amount",
              "currency",
              "occurred_on",
              "reference",
              "description",
              "created_at",
              "updated_at",
              "accounting_effects"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiCashSource": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "cash_source"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "$ref": "#/components/schemas/ApiSharedEnum1579b1abf3"
          },
          "name": {
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "warehouse_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "default_point_of_sale_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_point_of_sale_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_active": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "type",
          "name",
          "currency",
          "warehouse_id",
          "warehouse_name",
          "default_point_of_sale_id",
          "default_point_of_sale_name",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiCashSourceListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "cash_source"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": {
                  "$ref": "#/components/schemas/ApiSharedEnum1579b1abf3"
                },
                "name": {
                  "type": "string"
                },
                "currency": {
                  "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
                },
                "warehouse_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "warehouse_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "default_point_of_sale_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "default_point_of_sale_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "is_active": {
                  "type": "boolean"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "object",
                "id",
                "type",
                "name",
                "currency",
                "warehouse_id",
                "warehouse_name",
                "default_point_of_sale_id",
                "default_point_of_sale_name",
                "is_active",
                "created_at",
                "updated_at"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiPointOfSale": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "point_of_sale"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": "string"
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "warehouse_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_afip_enabled": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "id",
          "number",
          "name",
          "country",
          "address",
          "warehouse_id",
          "warehouse_name",
          "is_afip_enabled",
          "is_active"
        ],
        "additionalProperties": false
      },
      "ApiPointOfSaleListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "point_of_sale"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "country": {
                  "type": "string"
                },
                "address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "warehouse_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "warehouse_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "is_afip_enabled": {
                  "type": "boolean"
                },
                "is_active": {
                  "type": "boolean"
                }
              },
              "required": [
                "object",
                "id",
                "number",
                "name",
                "country",
                "address",
                "warehouse_id",
                "warehouse_name",
                "is_afip_enabled",
                "is_active"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiInventoryWarehouse": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "warehouse"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_default": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "address",
          "is_default",
          "is_active"
        ],
        "additionalProperties": false
      },
      "ApiInventoryItem": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "inventory_item"
          },
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "product_name": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "variant_options": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "option_names": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "product_type": {
            "$ref": "#/components/schemas/ApiSharedEnumff49232140"
          },
          "stock": {
            "$ref": "#/components/schemas/ApiSharedObject5884d24e45"
          }
        },
        "required": [
          "object",
          "product_id",
          "product_name",
          "sku",
          "variant_options",
          "option_names",
          "category",
          "product_type",
          "stock"
        ],
        "additionalProperties": false
      },
      "ApiInventoryListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "warehouse": {
                "$ref": "#/components/schemas/ApiSharedObject743a1706af"
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "inventory_item"
                    },
                    "product_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "product_name": {
                      "type": "string"
                    },
                    "sku": {
                      "type": "string"
                    },
                    "variant_options": {
                      "anyOf": [
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "option_names": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "category": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "product_type": {
                      "$ref": "#/components/schemas/ApiSharedEnumff49232140"
                    },
                    "stock": {
                      "$ref": "#/components/schemas/ApiSharedObject5884d24e45"
                    }
                  },
                  "required": [
                    "object",
                    "product_id",
                    "product_name",
                    "sku",
                    "variant_options",
                    "option_names",
                    "category",
                    "product_type",
                    "stock"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "warehouse",
              "items"
            ],
            "additionalProperties": false
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ApiInventoryMovement": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "inventory_movement"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "movement_type": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "balance": {
            "type": "number"
          },
          "reserved_balance": {
            "type": "number"
          },
          "incoming_balance": {
            "type": "number"
          },
          "quantity_change": {
            "type": "number"
          },
          "reserved_quantity_change": {
            "type": "number"
          },
          "incoming_quantity_change": {
            "type": "number"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string",
            "format": "uuid"
          },
          "created_by_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "warehouse_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "target_warehouse_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "other_warehouse_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumed1129741e"
              },
              {
                "type": "null"
              }
            ]
          },
          "reference_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference_label": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "movement_type",
          "quantity",
          "balance",
          "reserved_balance",
          "incoming_balance",
          "quantity_change",
          "reserved_quantity_change",
          "incoming_quantity_change",
          "reason",
          "notes",
          "created_at",
          "created_by",
          "created_by_name",
          "warehouse_name",
          "target_warehouse_name",
          "other_warehouse_name",
          "reference_type",
          "reference_id",
          "reference_label"
        ],
        "additionalProperties": false
      },
      "ApiInventoryMovementListResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "inventory_movement"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "movement_type": {
                  "type": "string"
                },
                "quantity": {
                  "type": "number"
                },
                "balance": {
                  "type": "number"
                },
                "reserved_balance": {
                  "type": "number"
                },
                "incoming_balance": {
                  "type": "number"
                },
                "quantity_change": {
                  "type": "number"
                },
                "reserved_quantity_change": {
                  "type": "number"
                },
                "incoming_quantity_change": {
                  "type": "number"
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "notes": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "created_by": {
                  "type": "string",
                  "format": "uuid"
                },
                "created_by_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "warehouse_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "target_warehouse_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "other_warehouse_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "reference_type": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiSharedEnumed1129741e"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "reference_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "reference_label": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "object",
                "id",
                "movement_type",
                "quantity",
                "balance",
                "reserved_balance",
                "incoming_balance",
                "quantity_change",
                "reserved_quantity_change",
                "incoming_quantity_change",
                "reason",
                "notes",
                "created_at",
                "created_by",
                "created_by_name",
                "warehouse_name",
                "target_warehouse_name",
                "other_warehouse_name",
                "reference_type",
                "reference_id",
                "reference_label"
              ],
              "additionalProperties": false
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum8d46e1ec20"
          },
          "url": {
            "type": "string",
            "description": "Requested list path."
          }
        },
        "required": [
          "request_id",
          "data",
          "has_more",
          "next_cursor",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ReportPeriod": {
        "type": "object",
        "required": [
          "start_date",
          "end_date"
        ],
        "properties": {
          "start_date": {
            "type": "string",
            "format": "date",
            "description": "Period start date (YYYY-MM-DD)",
            "example": "2026-01-01"
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "description": "Period end date (YYYY-MM-DD, inclusive)",
            "example": "2026-03-31"
          }
        }
      },
      "SalesReportRequest": {
        "type": "object",
        "required": [
          "source",
          "period",
          "measures"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "sales"
            ]
          },
          "period": {
            "$ref": "#/components/schemas/ReportPeriod"
          },
          "dimensions": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "date",
                    "week",
                    "week_of_year",
                    "month",
                    "month_of_year",
                    "day_of_week",
                    "year",
                    "quarter",
                    "hour_of_day",
                    "customer",
                    "customer_name",
                    "customer_email",
                    "customer_tax_category",
                    "customer_type",
                    "customer_recency",
                    "province",
                    "city",
                    "product",
                    "product_name",
                    "variant",
                    "variant_sku",
                    "category",
                    "subcategory",
                    "default_supplier_name",
                    "product_type",
                    "salesperson",
                    "cashier",
                    "point_of_sale",
                    "warehouse",
                    "register",
                    "integration_source",
                    "channel_listing",
                    "channel_listing_type",
                    "channel_logistics",
                    "voucher_type",
                    "currency",
                    "payment_status",
                    "cae_status",
                    "invoice_status",
                    "formatted_invoice_number",
                    "tax_rate",
                    "sale_line_type"
                  ]
                },
                {
                  "type": "string",
                  "pattern": "^product_metafield:[a-z][a-z0-9_]*$",
                  "description": "Product select custom field dimension. Use product_metafield:<key>, for example product_metafield:season.",
                  "examples": [
                    "product_metafield:season"
                  ]
                },
                {
                  "type": "string",
                  "pattern": "^contact_metafield:[a-z][a-z0-9_]*$",
                  "description": "Contact select custom field dimension. Use contact_metafield:<key>, for example contact_metafield:customer_segment.",
                  "examples": [
                    "contact_metafield:customer_segment"
                  ]
                }
              ]
            },
            "maxItems": 12,
            "uniqueItems": true,
            "description": "Dimensiones de agrupación. Máximo 12. Acepta product_metafield:<key> para campos personalizados select de producto y contact_metafield:<key> para campos personalizados select de contacto."
          },
          "measures": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "total",
                "subtotal",
                "tax_amount",
                "count",
                "sale_count",
                "credit_note_count",
                "units",
                "units_per_sale",
                "cost",
                "margin",
                "avg_ticket",
                "margin_percent",
                "channel_fee",
                "seller_shipping",
                "additional_costs",
                "contribution_margin",
                "contribution_margin_percent",
                "discount_amount",
                "line_discount_amount",
                "line_discount_rate",
                "global_discount_amount",
                "global_discount_rate",
                "discounted_sales_count",
                "balance",
                "unique_customers",
                "unique_products"
              ]
            },
            "minItems": 1,
            "uniqueItems": true,
            "description": "Medidas a calcular. Al menos una."
          },
          "dimension_filters": {
            "type": "object",
            "description": "Filtros por dimensión. Cada clave debe ser una dimensión filtrable para la fuente. También acepta product_metafield:<key> para campos personalizados select de producto y contact_metafield:<key> para campos personalizados select de contacto cuando la fuente lo soporta. El valor es un array de IDs o valores a incluir.",
            "additionalProperties": false,
            "patternProperties": {
              "^product_metafield:[a-z][a-z0-9_]*$": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "description": "Values to include for a product select custom field dimension."
              },
              "^contact_metafield:[a-z][a-z0-9_]*$": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "description": "Values to include for a contact select custom field dimension."
              }
            },
            "properties": {
              "customer": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "customer_name": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "customer_email": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "customer_tax_category": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "customer_type": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "customer_recency": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "province": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "city": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "product": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "product_name": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "variant_sku": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "category": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "subcategory": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "default_supplier_name": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "product_type": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "salesperson": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "cashier": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "point_of_sale": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "warehouse": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "register": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "integration_source": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "channel_listing": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "channel_listing_type": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "channel_logistics": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "voucher_type": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "currency": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "payment_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "cae_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "invoice_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "formatted_invoice_number": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "tax_rate": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "sale_line_type": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "customer_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "product_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "warehouse_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "point_of_sale_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "register_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              }
            }
          },
          "include_totals": {
            "type": "boolean",
            "description": "Si es true, la respuesta incluye totales agregados en el campo `totals`."
          },
          "reporting_currency": {
            "$ref": "#/components/schemas/ApiSharedEnum6440f2bcc2"
          },
          "date_basis": {
            "type": "string",
            "enum": [
              "commercial",
              "fiscal"
            ],
            "default": "commercial",
            "description": "`commercial` usa la fecha de venta. `fiscal` usa la fecha contable del comprobante."
          }
        }
      },
      "PurchasesReportRequest": {
        "type": "object",
        "required": [
          "source",
          "period",
          "measures"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "purchases"
            ]
          },
          "period": {
            "$ref": "#/components/schemas/ReportPeriod"
          },
          "dimensions": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "date",
                    "week",
                    "month",
                    "quarter",
                    "year",
                    "supplier",
                    "supplier_name",
                    "supplier_tax_category",
                    "supplier_province",
                    "supplier_city",
                    "product",
                    "variant",
                    "category",
                    "subcategory",
                    "product_type",
                    "warehouse",
                    "voucher_type",
                    "currency",
                    "tax_rate"
                  ]
                },
                {
                  "type": "string",
                  "pattern": "^product_metafield:[a-z][a-z0-9_]*$",
                  "description": "Product select custom field dimension. Use product_metafield:<key>, for example product_metafield:season.",
                  "examples": [
                    "product_metafield:season"
                  ]
                },
                {
                  "type": "string",
                  "pattern": "^contact_metafield:[a-z][a-z0-9_]*$",
                  "description": "Contact select custom field dimension. Use contact_metafield:<key>, for example contact_metafield:customer_segment.",
                  "examples": [
                    "contact_metafield:customer_segment"
                  ]
                }
              ]
            },
            "maxItems": 12,
            "uniqueItems": true,
            "description": "Dimensiones de agrupación. Máximo 12. Acepta product_metafield:<key> para campos personalizados select de producto y contact_metafield:<key> para campos personalizados select de contacto."
          },
          "measures": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "purchase_total",
                "purchase_subtotal",
                "purchase_tax_amount",
                "purchase_count",
                "purchase_units",
                "purchase_cost",
                "unique_suppliers",
                "avg_purchase_ticket",
                "avg_purchase_unit_cost"
              ]
            },
            "minItems": 1,
            "uniqueItems": true,
            "description": "Medidas a calcular. Al menos una."
          },
          "dimension_filters": {
            "type": "object",
            "description": "Filtros por dimensión. Cada clave debe ser una dimensión filtrable para la fuente. También acepta product_metafield:<key> para campos personalizados select de producto y contact_metafield:<key> para campos personalizados select de contacto cuando la fuente lo soporta. El valor es un array de IDs o valores a incluir.",
            "additionalProperties": false,
            "patternProperties": {
              "^product_metafield:[a-z][a-z0-9_]*$": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "description": "Values to include for a product select custom field dimension."
              },
              "^contact_metafield:[a-z][a-z0-9_]*$": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "description": "Values to include for a contact select custom field dimension."
              }
            },
            "properties": {
              "supplier": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "supplier_name": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "supplier_tax_category": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "supplier_province": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "supplier_city": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "product": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "category": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "subcategory": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "product_type": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "warehouse": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "voucher_type": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "currency": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "tax_rate": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "supplier_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "product_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "warehouse_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              }
            }
          },
          "include_totals": {
            "type": "boolean",
            "description": "Si es true, la respuesta incluye totales agregados en el campo `totals`."
          },
          "reporting_currency": {
            "$ref": "#/components/schemas/ApiSharedEnum6440f2bcc2"
          }
        }
      },
      "PaymentsReportRequest": {
        "type": "object",
        "required": [
          "source",
          "period",
          "measures"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "payments"
            ]
          },
          "period": {
            "$ref": "#/components/schemas/ReportPeriod"
          },
          "dimensions": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "date",
                    "week",
                    "week_of_year",
                    "month",
                    "month_of_year",
                    "day_of_week",
                    "year",
                    "quarter",
                    "hour_of_day",
                    "payment_contact",
                    "payment_contact_name",
                    "assigned_salesperson",
                    "payment_contact_tax_category",
                    "payment_contact_province",
                    "payment_contact_city",
                    "created_by",
                    "point_of_sale",
                    "register",
                    "pos_session",
                    "safe",
                    "payment_type",
                    "payment_record_status",
                    "currency",
                    "settlement_currency",
                    "formatted_payment_number",
                    "payment_method",
                    "payment_method_type",
                    "payment_installments"
                  ]
                },
                {
                  "type": "string",
                  "pattern": "^contact_metafield:[a-z][a-z0-9_]*$",
                  "description": "Contact select custom field dimension. Use contact_metafield:<key>, for example contact_metafield:customer_segment.",
                  "examples": [
                    "contact_metafield:customer_segment"
                  ]
                }
              ]
            },
            "maxItems": 12,
            "uniqueItems": true,
            "description": "Dimensiones de agrupación. Máximo 12. Acepta contact_metafield:<key> para campos personalizados select de contacto."
          },
          "measures": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "payment_collected_total",
                "payment_paid_total",
                "payment_net_cashflow",
                "payment_gross_movement",
                "payment_net_amount",
                "payment_fee_amount",
                "payment_balance",
                "payment_count",
                "payment_split_count",
                "unique_payment_contacts",
                "avg_payment_amount"
              ]
            },
            "minItems": 1,
            "uniqueItems": true,
            "description": "Medidas a calcular. Al menos una."
          },
          "dimension_filters": {
            "type": "object",
            "description": "Filtros por dimensión. Cada clave debe ser una dimensión filtrable para la fuente. También acepta product_metafield:<key> para campos personalizados select de producto y contact_metafield:<key> para campos personalizados select de contacto cuando la fuente lo soporta. El valor es un array de IDs o valores a incluir.",
            "additionalProperties": false,
            "patternProperties": {
              "^contact_metafield:[a-z][a-z0-9_]*$": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "description": "Values to include for a contact select custom field dimension."
              }
            },
            "properties": {
              "payment_contact": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "payment_contact_name": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "assigned_salesperson": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "payment_contact_tax_category": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "payment_contact_province": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "payment_contact_city": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "created_by": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "point_of_sale": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "register": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "pos_session": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "safe": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "payment_type": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "payment_record_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "currency": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "settlement_currency": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "formatted_payment_number": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "payment_method": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "payment_method_type": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "payment_installments": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "payment_contact_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "point_of_sale_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "register_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "safe_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "payment_method_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              }
            }
          },
          "include_totals": {
            "type": "boolean",
            "description": "Si es true, la respuesta incluye totales agregados en el campo `totals`."
          },
          "reporting_currency": {
            "$ref": "#/components/schemas/ApiSharedEnum6440f2bcc2"
          }
        }
      },
      "AppliedCollectionsReportRequest": {
        "type": "object",
        "required": [
          "source",
          "period",
          "measures"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "applied_collections"
            ]
          },
          "period": {
            "$ref": "#/components/schemas/ReportPeriod"
          },
          "dimensions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "date",
                "week",
                "week_of_year",
                "month",
                "month_of_year",
                "day_of_week",
                "year",
                "quarter",
                "hour_of_day",
                "customer",
                "assigned_salesperson",
                "formatted_payment_number",
                "formatted_invoice_number",
                "voucher_type"
              ]
            },
            "maxItems": 12,
            "uniqueItems": true,
            "description": "Dimensiones de agrupación. Máximo 12."
          },
          "measures": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "applied_collection_amount",
                "applied_collection_net_amount",
                "applied_collection_count"
              ]
            },
            "minItems": 1,
            "uniqueItems": true,
            "description": "Medidas a calcular. Al menos una."
          },
          "dimension_filters": {
            "type": "object",
            "description": "Filtros por dimensión. Cada clave debe ser una dimensión filtrable para la fuente. El valor es un array de IDs o valores a incluir.",
            "additionalProperties": false,
            "properties": {
              "customer": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "assigned_salesperson": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "formatted_payment_number": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "formatted_invoice_number": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "voucher_type": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "customer_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              }
            }
          },
          "include_totals": {
            "type": "boolean",
            "description": "Si es true, la respuesta incluye totales agregados en el campo `totals`."
          },
          "reporting_currency": {
            "$ref": "#/components/schemas/ApiSharedEnum6440f2bcc2"
          }
        }
      },
      "InventoryReportRequest": {
        "type": "object",
        "required": [
          "source",
          "measures"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "inventory"
            ]
          },
          "period": {
            "type": "object",
            "required": [
              "start_date",
              "end_date"
            ],
            "properties": {
              "start_date": {
                "type": "string",
                "format": "date",
                "description": "Period start date (YYYY-MM-DD)",
                "example": "2026-01-01"
              },
              "end_date": {
                "type": "string",
                "format": "date",
                "description": "Period end date (YYYY-MM-DD, inclusive)",
                "example": "2026-03-31"
              }
            },
            "description": "Obligatorio cuando se piden métricas históricas de inventario, métricas derivadas de ventas, métricas de movimientos o la dimensión abc_grade (clasificación ABC por ventas netas del período)."
          },
          "dimensions": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "date",
                    "week",
                    "week_of_year",
                    "month",
                    "month_of_year",
                    "day_of_week",
                    "year",
                    "quarter",
                    "product",
                    "product_name",
                    "variant",
                    "variant_sku",
                    "category",
                    "subcategory",
                    "default_supplier_name",
                    "product_type",
                    "currency",
                    "inventory_item_cost",
                    "abc_grade",
                    "warehouse"
                  ]
                },
                {
                  "type": "string",
                  "pattern": "^product_metafield:[a-z][a-z0-9_]*$",
                  "description": "Product select custom field dimension. Use product_metafield:<key>, for example product_metafield:season.",
                  "examples": [
                    "product_metafield:season"
                  ]
                }
              ]
            },
            "maxItems": 12,
            "uniqueItems": true,
            "description": "Dimensiones de agrupación. Máximo 12. Acepta product_metafield:<key> para campos personalizados select de producto."
          },
          "measures": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "stock_on_hand",
                "stock_available",
                "stock_reserved",
                "stock_incoming",
                "stock_value_cost",
                "stock_value_retail",
                "starting_inventory_units",
                "ending_inventory_units",
                "ending_inventory_value",
                "ending_inventory_retail_value",
                "days_in_stock",
                "days_out_of_stock",
                "inventory_units_sold",
                "inventory_units_sold_per_day",
                "days_of_inventory_remaining",
                "sell_through_rate",
                "inventory_units_net_change",
                "inventory_adjustment_change",
                "inventory_adjustment_count",
                "received_quantity",
                "transfer_count",
                "transfer_line_item_count",
                "unique_items_transferred"
              ]
            },
            "minItems": 1,
            "uniqueItems": true,
            "description": "Measures to calculate. Inventory analytics measures are period-based; use ending_inventory_units for the inventory balance at the end of the requested period."
          },
          "dimension_filters": {
            "type": "object",
            "description": "Filtros por dimensión. Cada clave debe ser una dimensión filtrable para la fuente. También acepta product_metafield:<key> para campos personalizados select de producto y contact_metafield:<key> para campos personalizados select de contacto cuando la fuente lo soporta. El valor es un array de IDs o valores a incluir.",
            "additionalProperties": false,
            "patternProperties": {
              "^product_metafield:[a-z][a-z0-9_]*$": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "description": "Values to include for a product select custom field dimension."
              }
            },
            "properties": {
              "product": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "product_name": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "variant_sku": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "category": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "subcategory": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "default_supplier_name": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "product_type": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "currency": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "abc_grade": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "warehouse": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "product_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "warehouse_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "sale_line_type": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              }
            }
          },
          "include_totals": {
            "type": "boolean",
            "description": "Si es true, la respuesta incluye totales agregados en el campo `totals`."
          },
          "reporting_currency": {
            "$ref": "#/components/schemas/ApiSharedEnum6440f2bcc2"
          },
          "date_basis": {
            "type": "string",
            "enum": [
              "commercial",
              "fiscal"
            ],
            "default": "commercial",
            "description": "Aplica solo cuando se usan métricas derivadas de ventas o la dimensión abc_grade. `commercial` usa la fecha de venta; `fiscal` usa la fecha contable."
          }
        }
      },
      "TreasuryReportRequest": {
        "type": "object",
        "required": [
          "source",
          "period",
          "measures",
          "treasury_currency_basis"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "treasury"
            ]
          },
          "period": {
            "$ref": "#/components/schemas/ReportPeriod"
          },
          "dimensions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "date",
                "week",
                "month",
                "quarter",
                "year",
                "treasury_account",
                "treasury_account_type",
                "treasury_account_currency",
                "treasury_location",
                "treasury_movement_type",
                "treasury_adjustment_source",
                "treasury_account_status"
              ]
            },
            "maxItems": 12,
            "uniqueItems": true,
            "description": "Dimensiones de agrupación. Máximo 12."
          },
          "measures": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "treasury_starting_balance",
                "treasury_ending_balance",
                "treasury_balance_change",
                "treasury_inflows",
                "treasury_outflows",
                "treasury_net_flow",
                "treasury_gross_movement",
                "treasury_movement_count",
                "treasury_transfer_in",
                "treasury_transfer_out",
                "treasury_adjustment_net"
              ]
            },
            "minItems": 1,
            "uniqueItems": true,
            "description": "Medidas de tesorería a calcular. Al menos una."
          },
          "dimension_filters": {
            "type": "object",
            "description": "Filtros por dimensión. Cada clave debe ser una dimensión filtrable para la fuente. El valor es un array de IDs o valores a incluir.",
            "additionalProperties": false,
            "properties": {
              "date": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "week": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "month": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "quarter": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "year": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "treasury_account": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "treasury_account_type": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "treasury_account_currency": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "treasury_location": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "treasury_movement_type": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "treasury_adjustment_source": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "treasury_account_status": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              }
            }
          },
          "include_totals": {
            "type": "boolean",
            "description": "Si es true, la respuesta incluye totales agregados en el campo `totals`."
          },
          "reporting_currency": {
            "$ref": "#/components/schemas/ApiSharedEnum6440f2bcc2"
          },
          "treasury_currency_basis": {
            "type": "string",
            "enum": [
              "original",
              "functional_ars"
            ],
            "description": "`original` informa la moneda nativa de cada cuenta. `functional_ars` informa el valor contable funcional en ARS."
          }
        }
      },
      "MarketplaceListingsReportRequest": {
        "type": "object",
        "description": "Instantánea de publicaciones activas en ARS, una fila por publicación. Estima la contribución de una unidad, sin período ni comparación. Requiere `marketplace_item_id` o `marketplace_listing`. Devuelve todas las publicaciones; para ordenar y paginar usá `response_mode=assistant`. Los campos financieros requieren permiso vigente para ver costos.",
        "required": [
          "source",
          "dimensions",
          "measures"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "marketplace_listings"
          },
          "dimensions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "marketplace_item_id",
                "marketplace_listing",
                "marketplace_account",
                "marketplace_sku",
                "marketplace_listing_type",
                "marketplace_logistic_type"
              ]
            },
            "maxItems": 12
          },
          "measures": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "listing_price",
                "reference_cost",
                "listing_fee",
                "listing_commission",
                "listing_fixed_fee",
                "listing_financing",
                "listing_shipping",
                "listing_channel_share_percent",
                "listing_additional_costs",
                "estimated_contribution",
                "estimated_contribution_percent",
                "recent_units"
              ]
            },
            "minItems": 1
          },
          "reporting_currency": {
            "type": "string",
            "const": "ARS"
          },
          "filters": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "result_filters": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "dimension_filters": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "additionalProperties": false
      },
      "ReportRequest": {
        "oneOf": [
          {
            "title": "Ventas",
            "$ref": "#/components/schemas/SalesReportRequest"
          },
          {
            "title": "Compras",
            "$ref": "#/components/schemas/PurchasesReportRequest"
          },
          {
            "title": "Pagos",
            "$ref": "#/components/schemas/PaymentsReportRequest"
          },
          {
            "title": "Cobranzas aplicadas",
            "$ref": "#/components/schemas/AppliedCollectionsReportRequest"
          },
          {
            "title": "Inventario",
            "$ref": "#/components/schemas/InventoryReportRequest"
          },
          {
            "title": "Publicaciones de Mercado Libre",
            "$ref": "#/components/schemas/MarketplaceListingsReportRequest"
          },
          {
            "title": "Tesorería",
            "$ref": "#/components/schemas/TreasuryReportRequest"
          }
        ]
      },
      "AssistantReportRequest": {
        "type": "object",
        "description": "Use response_mode=assistant for run_report-compatible name resolution, presets, comparisons, and cursor paging. All fields use snake_case.",
        "required": [
          "response_mode",
          "source",
          "measures"
        ],
        "properties": {
          "response_mode": {
            "type": "string",
            "const": "assistant"
          },
          "source": {
            "type": "string",
            "enum": [
              "sales",
              "purchases",
              "payments",
              "applied_collections",
              "commissions",
              "inventory",
              "treasury",
              "marketplace_listings"
            ]
          },
          "dimensions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 12
          },
          "measures": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1
          },
          "reporting_currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "treasury_currency_basis": {
            "$ref": "#/components/schemas/ApiSharedEnum59bd24ac3d"
          },
          "filters": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "result_filters": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "measure_filters": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "deprecated": true
          },
          "dimension_filters": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "period": {
            "$ref": "#/components/schemas/ReportPeriod"
          },
          "period_preset": {
            "$ref": "#/components/schemas/ApiSharedEnumab9ba78640"
          },
          "comparison_mode": {
            "type": "string",
            "enum": [
              "previous_period",
              "previous_week",
              "previous_month",
              "previous_quarter",
              "previous_year",
              "previous_year_same_day_of_week"
            ]
          },
          "comparison_period": {
            "type": "object",
            "required": [
              "start_date",
              "end_date"
            ],
            "properties": {
              "start_date": {
                "type": "string",
                "format": "date"
              },
              "end_date": {
                "type": "string",
                "format": "date"
              },
              "label": {
                "type": "string"
              }
            }
          },
          "include_percent_change": {
            "type": "boolean"
          },
          "date_basis": {
            "$ref": "#/components/schemas/ApiSharedEnume8f16939df"
          },
          "limit": {
            "type": "integer",
            "minimum": 1
          },
          "cursor": {
            "type": "string"
          },
          "sort_by": {
            "type": "string",
            "description": "Dimensión o métrica seleccionada. Las dimensiones ordinales usan su valor original; las demás, su nombre visible. Se aplica antes del límite y la paginación en todas las fuentes. Los valores vacíos van al final. Con sort_by, el sentido predeterminado es desc; para marketplace_listings es asc. Omití ambos campos para conservar el orden predeterminado."
          },
          "sort_direction": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          }
        },
        "additionalProperties": false
      },
      "AssistantReportResponse": {
        "type": "object",
        "required": [
          "request_id",
          "data"
        ],
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "required": [
              "summary",
              "report",
              "chart",
              "reporting"
            ],
            "properties": {
              "summary": {
                "type": "string"
              },
              "report": {
                "type": "object",
                "additionalProperties": true
              },
              "chart": {
                "type": "object",
                "additionalProperties": true
              },
              "reporting": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "additionalProperties": true
          }
        }
      },
      "ApiReportCatalogResponse": {
        "type": "object",
        "required": [
          "request_id",
          "data"
        ],
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "required": [
              "sources",
              "catalog",
              "source_metadata_by_source"
            ],
            "additionalProperties": true
          }
        }
      },
      "ApiReferenceCandidateListResponse": {
        "type": "object",
        "required": [
          "request_id",
          "object",
          "url",
          "data",
          "has_more"
        ],
        "properties": {
          "request_id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "list"
          },
          "url": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "maxItems": 6,
            "items": {
              "type": "object",
              "required": [
                "object",
                "id",
                "label",
                "detail",
                "exact_match"
              ],
              "properties": {
                "object": {
                  "type": "string",
                  "const": "reference_candidate"
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "label": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "detail": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "exact_match": {
                  "type": "boolean"
                },
                "is_default": {
                  "type": "boolean"
                }
              }
            }
          },
          "has_more": {
            "type": "boolean",
            "const": false
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ReportFlatRow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Composite key from the dimension values, usable as a stable row identifier."
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Raw IDs for each dimension, in the same order as `labels`."
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Human-readable labels for each grouped dimension."
          },
          "measures": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": [
                "number",
                "null"
              ]
            },
            "description": "Values for the requested measures. `currency` measures are in cents."
          },
          "measure_qualities": {
            "description": "Quality of each monetary measure. Omitted when the source has no amount-quality distinction.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/ApiSharedEnum714ff181d6"
            }
          }
        },
        "required": [
          "id",
          "ids",
          "labels",
          "measures"
        ],
        "additionalProperties": false
      },
      "ReportMetadata": {
        "type": "object",
        "properties": {
          "source": {
            "$ref": "#/components/schemas/ApiSharedEnumef5c34521c"
          },
          "dimensions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "measures": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "period": {
            "description": "Present only when the report uses period.",
            "type": "object",
            "properties": {
              "start_date": {
                "type": "string"
              },
              "end_date": {
                "type": "string"
              }
            },
            "required": [
              "start_date",
              "end_date"
            ],
            "additionalProperties": false
          },
          "date_basis": {
            "description": "Presente solo para sources que soportan dateBasis (sales, inventory con medidas derivadas).",
            "type": "string",
            "enum": [
              "commercial",
              "fiscal"
            ]
          },
          "resolved_filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject5524465fb0"
            }
          },
          "reporting_currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "rate_basis": {
            "$ref": "#/components/schemas/ApiSharedEnumb5a8e60557"
          },
          "treasury_currency_basis": {
            "$ref": "#/components/schemas/ApiSharedEnum59bd24ac3d"
          },
          "treasury_visibility_scope": {
            "$ref": "#/components/schemas/ApiSharedEnumd440d6785b"
          },
          "amount_quality_by_measure": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/ApiSharedEnum714ff181d6"
            }
          }
        },
        "required": [
          "source",
          "dimensions",
          "measures",
          "reporting_currency",
          "rate_basis"
        ],
        "additionalProperties": false
      },
      "ReportQueryResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "rows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "measures": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    },
                    "measure_qualities": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "$ref": "#/components/schemas/ApiSharedEnum714ff181d6"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "ids",
                    "labels",
                    "measures"
                  ],
                  "additionalProperties": false
                }
              },
              "totals": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Aggregated totals for all rows. Present only when `includeTotals: true` is sent."
              },
              "total_amount_quality": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/ApiSharedEnum714ff181d6"
                }
              },
              "metadata": {
                "type": "object",
                "properties": {
                  "source": {
                    "$ref": "#/components/schemas/ApiSharedEnumef5c34521c"
                  },
                  "dimensions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "measures": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "period": {
                    "type": "object",
                    "properties": {
                      "start_date": {
                        "type": "string"
                      },
                      "end_date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "start_date",
                      "end_date"
                    ],
                    "additionalProperties": false
                  },
                  "date_basis": {
                    "$ref": "#/components/schemas/ApiSharedEnume8f16939df"
                  },
                  "resolved_filters": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ApiSharedObject5524465fb0"
                    }
                  },
                  "reporting_currency": {
                    "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
                  },
                  "rate_basis": {
                    "$ref": "#/components/schemas/ApiSharedEnumb5a8e60557"
                  },
                  "treasury_currency_basis": {
                    "$ref": "#/components/schemas/ApiSharedEnum59bd24ac3d"
                  },
                  "treasury_visibility_scope": {
                    "$ref": "#/components/schemas/ApiSharedEnumd440d6785b"
                  },
                  "amount_quality_by_measure": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "$ref": "#/components/schemas/ApiSharedEnum714ff181d6"
                    }
                  }
                },
                "required": [
                  "source",
                  "dimensions",
                  "measures",
                  "reporting_currency",
                  "rate_basis"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "rows",
              "totals",
              "metadata"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "data"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectc549c5f436": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "accounting_circuit"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "voucher_letters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedEnum7ac37f3087"
            },
            "description": "Letras de comprobante cuyos comprobantes nuevos se registran en este circuito. `X` es solo el comprobante X; `other` agrupa despachos de importación, comprobantes del exterior y compras de bienes usados. Las letras que ningún circuito recibe van a General."
          },
          "point_of_sale_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Puntos de venta cuyas cobranzas y pagos nuevos sin comprobantes (anticipos) se registran en este circuito, salvo que el alta indique `circuit_id`. Los comprobantes siguen la letra y las cobranzas o pagos que cancelan comprobantes siguen el circuito de esos comprobantes. Los puntos de venta que ningún circuito recibe mandan sus anticipos a General."
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "voucher_letters",
          "point_of_sale_ids"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum7ac37f3087": {
        "type": "string",
        "enum": [
          "A",
          "B",
          "C",
          "X",
          "other"
        ]
      },
      "ApiSharedEnum8d46e1ec20": {
        "type": "string",
        "enum": [
          "list"
        ],
        "description": "List-envelope discriminator."
      },
      "ApiSharedEnumd52c0ebb9c": {
        "type": "string",
        "enum": [
          "invoice",
          "debit_note",
          "credit_note",
          "receipt",
          "non_fiscal",
          "other"
        ]
      },
      "ApiSharedEnum10987946fd": {
        "type": "string",
        "enum": [
          "A",
          "B",
          "C"
        ]
      },
      "ApiSharedObjected3905a55b": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "tag"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "scope": {
            "$ref": "#/components/schemas/ApiSharedEnum09f8155a9a"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "color": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum599647cb76"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "archived_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "scope",
          "name",
          "slug",
          "color",
          "description",
          "archived_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum09f8155a9a": {
        "type": "string",
        "enum": [
          "customer",
          "supplier",
          "product",
          "sale",
          "purchase",
          "purchase_order",
          "transfer"
        ]
      },
      "ApiSharedEnum599647cb76": {
        "type": "string",
        "enum": [
          "slate",
          "red",
          "orange",
          "amber",
          "yellow",
          "lime",
          "green",
          "teal",
          "cyan",
          "blue",
          "indigo",
          "violet",
          "pink"
        ]
      },
      "ApiSharedEnum250b15b651": {
        "type": "string",
        "enum": [
          "CUIL/CUIT",
          "DNI"
        ]
      },
      "ApiSharedEnumbb2864ecea": {
        "type": "string",
        "enum": [
          "registered_vat_taxpayer",
          "final_consumer",
          "monotributo_taxpayer",
          "vat_exempt",
          "vat_not_applicable"
        ]
      },
      "ApiSharedObjecte014df5c78": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "supplier"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_category": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "is_active": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          },
          "default_account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "province_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "apartment": {
            "type": [
              "string",
              "null"
            ]
          },
          "postal_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "company_name",
          "description",
          "email",
          "phone",
          "tax_id",
          "tax_id_type",
          "tax_category",
          "payment_term_id",
          "payment_term_days",
          "is_active",
          "tags",
          "default_account_id",
          "country",
          "province_id",
          "city",
          "address",
          "apartment",
          "postal_code",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectf86e1828bb": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "category"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_economic_activity": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "parent_id",
          "default_economic_activity",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject743a1706af": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "warehouse"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_default": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "address",
          "is_default",
          "is_active"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum822a963f55": {
        "type": "string",
        "enum": [
          "goods",
          "fixed_assets",
          "leases",
          "services"
        ]
      },
      "ApiSharedEnumd34af90520": {
        "type": "string",
        "enum": [
          "days_7",
          "days_15",
          "days_30",
          "days_45",
          "days_60",
          "days_90",
          "days_30_60",
          "days_30_60_90"
        ]
      },
      "ApiSharedEnum9e7af09974": {
        "type": "string",
        "enum": [
          "commercial_invoice",
          "customs_dispatch",
          "customs_dispatch_reversal"
        ]
      },
      "ApiSharedEnumf0d69c3d87": {
        "type": "string",
        "enum": [
          "pending_nationalization",
          "partially_nationalized",
          "fully_nationalized"
        ]
      },
      "ApiSharedEnumde48b709b2": {
        "type": "string",
        "enum": [
          "none",
          "receive",
          "return_to_supplier"
        ]
      },
      "ApiSharedEnumffb4886f2b": {
        "type": "string",
        "enum": [
          "ARS",
          "USD"
        ]
      },
      "ApiSharedObject1fb80ddff0": {
        "type": "object",
        "properties": {
          "product_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "unit_cost": {
            "type": "integer",
            "minimum": 0
          },
          "subtotal": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_rate_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "is_exempt": {
            "type": "boolean"
          },
          "discount_percentage": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "purchase_order_item_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum822a963f55"
              },
              {
                "type": "null"
              }
            ]
          },
          "account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "account_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "cost_center1_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center1_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "cost_center2_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center2_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "cost_center3_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center3_name": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "product_id",
          "product_name",
          "sku",
          "name",
          "quantity",
          "unit_cost",
          "subtotal",
          "total",
          "tax_rate_id",
          "is_exempt",
          "discount_percentage",
          "purchase_order_item_id",
          "vat_category",
          "account_id",
          "account_name",
          "cost_center1_id",
          "cost_center1_name",
          "cost_center2_id",
          "cost_center2_name",
          "cost_center3_id",
          "cost_center3_name"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectb451a3d8de": {
        "type": "object",
        "properties": {
          "will_receive_products": {
            "type": "boolean"
          },
          "will_create_receipt": {
            "type": "boolean"
          },
          "will_increase_direct_stock": {
            "type": "boolean"
          },
          "will_return_products": {
            "type": "boolean"
          },
          "will_decrease_direct_stock": {
            "type": "boolean"
          },
          "inventory_effect": {
            "$ref": "#/components/schemas/ApiSharedEnumde48b709b2"
          },
          "warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "product_line_count": {
            "type": "integer",
            "minimum": 0
          },
          "total_quantity": {
            "type": "number",
            "minimum": 0
          },
          "purchase_order_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "will_receive_products",
          "will_create_receipt",
          "will_increase_direct_stock",
          "will_return_products",
          "will_decrease_direct_stock",
          "inventory_effect",
          "warehouse_id",
          "product_line_count",
          "total_quantity",
          "purchase_order_ids"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectc482130d79": {
        "type": "object",
        "properties": {
          "will_create_journal_entry": {
            "type": "boolean"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "exchange_rate": {
            "type": "number",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "will_create_journal_entry",
          "currency",
          "exchange_rate"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectc671832641": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "field": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject95929ea589": {
        "type": "object",
        "properties": {
          "province_id": {
            "type": "integer"
          },
          "amount": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "province_id",
          "amount"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectd4b58bde30": {
        "type": "object",
        "properties": {
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "unit_cost": {
            "type": "integer",
            "minimum": 0
          },
          "subtotal": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "tax_rate_id": {
            "type": "integer",
            "minimum": 0
          },
          "is_exempt": {
            "type": "boolean"
          },
          "discount_percentage": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "purchase_order_item_id": {
            "type": "string",
            "format": "uuid"
          },
          "vat_category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum822a963f55"
              },
              {
                "type": "null"
              }
            ]
          },
          "account_id": {
            "description": "ID de cuenta contable imputable de Activo, Gasto o Pasivo para este renglon.",
            "type": "string",
            "format": "uuid"
          },
          "cost_center1_id": {
            "type": "string",
            "format": "uuid"
          },
          "cost_center2_id": {
            "type": "string",
            "format": "uuid"
          },
          "cost_center3_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "quantity",
          "unit_cost"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectfb7405a472": {
        "type": "object",
        "properties": {
          "tax_rate_id": {
            "type": "integer",
            "minimum": 0
          },
          "base_amount": {
            "type": "integer",
            "minimum": 0
          },
          "tax_amount": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "tax_rate_id",
          "base_amount",
          "tax_amount"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectbea003a73d": {
        "type": "object",
        "properties": {
          "gravado21": {
            "type": "string",
            "format": "uuid"
          },
          "gravado27": {
            "type": "string",
            "format": "uuid"
          },
          "gravado105": {
            "type": "string",
            "format": "uuid"
          },
          "gravado25": {
            "type": "string",
            "format": "uuid"
          },
          "gravado5": {
            "type": "string",
            "format": "uuid"
          },
          "non_taxed_amount": {
            "type": "string",
            "format": "uuid"
          },
          "exento": {
            "type": "string",
            "format": "uuid"
          },
          "base_amount": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "ApiSharedObjectf61e74f9c5": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ApiSharedEnum459535dab3"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID de la caja o caja fuerte."
          }
        },
        "required": [
          "type",
          "id"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum459535dab3": {
        "type": "string",
        "enum": [
          "register",
          "safe"
        ],
        "description": "Tipo de origen de efectivo: caja operativa o caja fuerte."
      },
      "ApiSharedEnumff49232140": {
        "type": "string",
        "enum": [
          "product",
          "service",
          "combo",
          "kit"
        ]
      },
      "ApiSharedObject16c3799d74": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ApiSharedEnum539fdceccc"
          },
          "value": {
            "type": "number",
            "minimum": 0
          }
        },
        "required": [
          "type",
          "value"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum539fdceccc": {
        "type": "string",
        "enum": [
          "percentage",
          "amount"
        ]
      },
      "ApiSharedEnum4e55733f20": {
        "type": "string",
        "enum": [
          "product",
          "shipping",
          "custom"
        ]
      },
      "ApiSharedEnum447a859a74": {
        "type": "string",
        "enum": [
          "SCA",
          "ADC"
        ]
      },
      "ApiSharedObjectd835b52c6b": {
        "type": "object",
        "properties": {
          "product_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumff49232140"
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "unit_price": {
            "type": "integer",
            "minimum": 0
          },
          "unit_cost": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_rate_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "is_exempt": {
            "type": "boolean"
          },
          "discount": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject16c3799d74"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "line_type": {
            "$ref": "#/components/schemas/ApiSharedEnum4e55733f20"
          },
          "cost_center1_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center2_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center3_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "product_id",
          "product_name",
          "sku",
          "warehouse_id",
          "name",
          "product_type",
          "quantity",
          "unit_price",
          "unit_cost",
          "tax_rate_id",
          "is_exempt",
          "discount",
          "notes",
          "account_id",
          "line_type",
          "cost_center1_id",
          "cost_center2_id",
          "cost_center3_id"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject3d3dc47592": {
        "type": "object",
        "properties": {
          "method_id": {
            "type": "string",
            "format": "uuid"
          },
          "amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "fee_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "terminal_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "card_batch_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_coupon_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_installment_plan_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_brand": {
            "type": [
              "string",
              "null"
            ]
          },
          "cash_source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectf61e74f9c5"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "method_id",
          "amount",
          "description",
          "reference",
          "fee_amount",
          "terminal_id",
          "card_batch_number",
          "card_coupon_number",
          "card_installment_plan_code",
          "card_brand",
          "cash_source"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject6a71e7888b": {
        "type": "object",
        "properties": {
          "will_affect_stock": {
            "type": "boolean"
          },
          "warehouse_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "product_line_count": {
            "type": "integer",
            "minimum": 0
          },
          "total_quantity": {
            "type": "number",
            "minimum": 0
          }
        },
        "required": [
          "will_affect_stock",
          "warehouse_ids",
          "product_line_count",
          "total_quantity"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject9428e7100c": {
        "type": "object",
        "properties": {
          "will_create_sale_entry": {
            "type": "boolean"
          },
          "will_create_payment_entry": {
            "type": "boolean"
          }
        },
        "required": [
          "will_create_sale_entry",
          "will_create_payment_entry"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject3563932f8e": {
        "type": "object",
        "properties": {
          "invoice_status": {
            "$ref": "#/components/schemas/ApiSharedEnumd8087f784e"
          }
        },
        "required": [
          "invoice_status"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnumd8087f784e": {
        "type": "string",
        "enum": [
          "not_required",
          "pending"
        ]
      },
      "ApiSharedObject8e516a9b19": {
        "type": "object",
        "properties": {
          "will_create_payments": {
            "type": "boolean"
          },
          "payment_method_count": {
            "type": "integer",
            "minimum": 0
          },
          "total_amount": {
            "type": "number"
          },
          "pending_amount": {
            "type": "number"
          }
        },
        "required": [
          "will_create_payments",
          "payment_method_count",
          "total_amount",
          "pending_amount"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum9ac70a3316": {
        "type": "string",
        "enum": [
          "not_required",
          "pending",
          "issued"
        ]
      },
      "ApiSharedEnum003ee2d7f5": {
        "type": "string",
        "enum": [
          "product",
          "service"
        ]
      },
      "ApiSharedEnum8b51d9e8f5": {
        "type": "string",
        "enum": [
          "not_enabled",
          "not_applicable",
          "pending",
          "posted",
          "failed"
        ]
      },
      "ApiSharedObject76de9df039": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject18d478a65b": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "account"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "id",
          "code",
          "name"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject4529837fc2": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "contact"
          },
          "id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "name"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectbed5d5812a": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "journal_entry_line"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "account": {
            "$ref": "#/components/schemas/ApiSharedObject18d478a65b"
          },
          "debit": {
            "type": "integer"
          },
          "credit": {
            "type": "integer"
          },
          "entered_debit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "entered_credit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string"
          },
          "contact": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject4529837fc2"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_centers": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "account",
          "debit",
          "credit",
          "entered_debit",
          "entered_credit",
          "currency",
          "contact",
          "cost_centers",
          "description"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectbd6833a5e8": {
        "type": "object",
        "properties": {
          "circuit_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "circuit_name": {
            "type": "string"
          }
        },
        "required": [
          "circuit_id",
          "circuit_name"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject308596969e": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "account_ledger_line"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "journal_entry_id": {
            "type": "string",
            "format": "uuid"
          },
          "circuit_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Circuito contable del asiento. null es el circuito General."
          },
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "type": "string"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "counterparty_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center1_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center2_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center3_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "debit": {
            "type": "integer"
          },
          "credit": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "balance": {
            "type": "integer"
          }
        },
        "required": [
          "object",
          "id",
          "date",
          "journal_entry_id",
          "circuit_id",
          "account_id",
          "source_type",
          "source_id",
          "description",
          "reference",
          "counterparty_name",
          "contact_id",
          "cost_center1_id",
          "cost_center2_id",
          "cost_center3_id",
          "debit",
          "credit",
          "currency",
          "balance"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum5433445ffc": {
        "type": "string",
        "enum": [
          "asset",
          "liability",
          "equity",
          "revenue",
          "expense"
        ]
      },
      "ApiSharedEnum1d20f1f7e9": {
        "type": "string",
        "enum": [
          "debit",
          "credit"
        ]
      },
      "ApiSharedEnum87e38e3147": {
        "type": "string",
        "enum": [
          "ar",
          "ap",
          "vat_credit",
          "vat_debit",
          "revenue",
          "cogs",
          "merchandise",
          "values_to_deposit",
          "cash_in_transit",
          "deferred_checks_payable",
          "bounced_checks",
          "check_discount_expense",
          "card_pending",
          "card_commission",
          "cash_differences",
          "customer_advances",
          "supplier_advances",
          "wh_vat_suffered",
          "iibb_credits_suffered",
          "wh_income_tax_suffered",
          "wh_suss_suffered",
          "wh_stamps_suffered",
          "wh_vat_payable",
          "wh_iibb_payable",
          "wh_income_tax_payable",
          "wh_suss_payable",
          "perc_vat_suffered",
          "perc_vat_payable",
          "perc_iibb_payable",
          "purchases_non_taxable",
          "sales_non_taxable",
          "discounts_received",
          "taxes_expense",
          "misc_expense",
          "stock_adjustment_positive",
          "stock_adjustment_negative",
          "exchange_difference",
          "recpam",
          "fiscal_year_result",
          "capital_adjustment"
        ]
      },
      "ApiSharedEnuma6084829bf": {
        "type": "string",
        "enum": [
          "revenue",
          "cogs",
          "operating_expense",
          "depreciation_amortization",
          "other_operating_income",
          "other_operating_expense",
          "financial_income",
          "financial_expense",
          "income_tax"
        ]
      },
      "ApiSharedEnume7d4eca700": {
        "type": "string",
        "enum": [
          "ARS",
          "USD",
          "001",
          "060"
        ]
      },
      "ApiSharedObject0e307df43a": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "monetary_nature": {
            "$ref": "#/components/schemas/ApiSharedEnumc0e6eed891"
          },
          "measurement_basis": {
            "$ref": "#/components/schemas/ApiSharedEnum04f51fcdae"
          },
          "destination": {
            "$ref": "#/components/schemas/ApiSharedEnumf1ccb3eb41"
          }
        },
        "required": [
          "account_id",
          "monetary_nature",
          "measurement_basis",
          "destination"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnumc0e6eed891": {
        "type": "string",
        "enum": [
          "monetary",
          "non_monetary"
        ]
      },
      "ApiSharedEnum04f51fcdae": {
        "type": "string",
        "enum": [
          "historical_cost",
          "current_value",
          "already_reexpressed"
        ]
      },
      "ApiSharedEnumf1ccb3eb41": {
        "type": "string",
        "enum": [
          "source_account",
          "capital_adjustment"
        ]
      },
      "ApiSharedObjectcd635e5b25": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "$ref": "#/components/schemas/ApiSharedEnumff970a29e5"
          },
          "month": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}$"
          }
        },
        "required": [
          "account_id",
          "type",
          "month"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnumff970a29e5": {
        "type": "string",
        "enum": [
          "accepted_prior_close",
          "origin_month"
        ]
      },
      "ApiSharedObjecte224c09452": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}$"
          },
          "value": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "reason": {
            "type": "string",
            "minLength": 10,
            "maxLength": 500
          }
        },
        "required": [
          "month",
          "value",
          "reason"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum736f0d077b": {
        "type": "string",
        "enum": [
          "draft",
          "in_transit",
          "completed",
          "closed_with_difference",
          "cancelled"
        ]
      },
      "ApiSharedObject8aeeceaf0f": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectfc454d8721": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "received_quantity": {
            "type": "number",
            "minimum": 0
          },
          "rejected_quantity": {
            "type": "number",
            "minimum": 0
          },
          "product": {
            "$ref": "#/components/schemas/ApiSharedObject5970f757f8"
          }
        },
        "required": [
          "id",
          "product_id",
          "quantity",
          "received_quantity",
          "rejected_quantity",
          "product"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject5970f757f8": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "variant_options": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "option_names": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "sku",
          "variant_options",
          "option_names"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectee5eae48b0": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "value": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "value"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnuma7f3605118": {
        "type": "string",
        "enum": [
          "both",
          "sales",
          "purchases",
          "system"
        ]
      },
      "ApiSharedObject564df4258f": {
        "type": "object",
        "properties": {
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "product_id",
          "name",
          "sku",
          "quantity"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnumfe93f70a59": {
        "type": "string",
        "enum": [
          "automatic",
          "manual_override",
          "manual_fallback",
          "base"
        ]
      },
      "ApiSharedObject3b83f74923": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "is_automatic": {
            "type": "boolean"
          },
          "automatic_pricing_mode": {
            "$ref": "#/components/schemas/ApiSharedEnum3c5633618c"
          },
          "adjustment_percentage": {
            "type": [
              "number",
              "null"
            ]
          },
          "source_price_list_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_inclusive": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "is_automatic",
          "automatic_pricing_mode",
          "adjustment_percentage",
          "source_price_list_id",
          "tax_inclusive"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum3c5633618c": {
        "type": "string",
        "enum": [
          "base_price_adjustment",
          "cost_markup"
        ]
      },
      "ApiSharedObject50a930638e": {
        "type": "object",
        "properties": {
          "product_type": {
            "type": "string",
            "const": "combo"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "sku": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "barcode": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "image_url": {
            "description": "External product image URL reference. La Pyme displays it best effort and does not copy, ingest, or host the image.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "category_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_active": {
            "default": true,
            "type": "boolean"
          },
          "pricing_mode": {
            "$ref": "#/components/schemas/ApiSharedEnum391cb7d8af"
          },
          "price": {
            "description": "Precio manual en centavos; obligatorio en modo manual.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "price_adjustment_percentage": {
            "anyOf": [
              {
                "type": "number",
                "minimum": -100,
                "maximum": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "components": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject0da0631443"
            }
          }
        },
        "required": [
          "product_type",
          "name",
          "sku",
          "components"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum391cb7d8af": {
        "default": "automatic",
        "type": "string",
        "enum": [
          "automatic",
          "manual"
        ]
      },
      "ApiSharedObject0da0631443": {
        "type": "object",
        "properties": {
          "product_id": {
            "type": "string",
            "format": "uuid",
            "description": "ID de una variante activa de producto simple o kit. No se permiten servicios ni combos. El kit no puede contener combos; solo se permite un nivel de un combo o kit dentro de otro. El combo usa el stock propio del kit, no el de su receta."
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 999999.9999,
            "multipleOf": 0.0001
          }
        },
        "required": [
          "product_id",
          "quantity"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum026059bce8": {
        "default": "both",
        "type": "string",
        "enum": [
          "both",
          "sales",
          "purchases",
          "system"
        ]
      },
      "ApiSharedEnum5f0db377e3": {
        "default": "07",
        "type": "string",
        "enum": [
          "10",
          "11",
          "12",
          "13",
          "14",
          "15",
          "16",
          "17",
          "18",
          "19",
          "20",
          "21",
          "22",
          "23",
          "24",
          "25",
          "26",
          "27",
          "28",
          "29",
          "30",
          "31",
          "32",
          "33",
          "34",
          "35",
          "36",
          "37",
          "41",
          "47",
          "48",
          "49",
          "50",
          "51",
          "52",
          "53",
          "54",
          "55",
          "61",
          "62",
          "63",
          "97",
          "98",
          "99",
          "00",
          "01",
          "02",
          "03",
          "04",
          "05",
          "06",
          "07",
          "08",
          "09"
        ]
      },
      "ApiSharedEnumc519f4ab77": {
        "type": "string",
        "enum": [
          "ARS",
          "USD"
        ],
        "default": "ARS"
      },
      "ApiSharedObject6dbe49c4ef": {
        "type": "object",
        "properties": {
          "warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "number",
            "minimum": 0
          }
        },
        "required": [
          "warehouse_id",
          "quantity"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject881708c96a": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          }
        },
        "required": [
          "key",
          "value"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnumf7fe6bfeb0": {
        "type": "string",
        "enum": [
          "boolean",
          "text",
          "number",
          "date",
          "select"
        ]
      },
      "ApiSharedObject0347948139": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "value"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjecta9f7340006": {
        "type": "object",
        "properties": {
          "total_quantity": {
            "type": "number"
          },
          "warehouse_count": {
            "type": "integer",
            "minimum": 0
          },
          "by_warehouse": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf20bf16616"
            }
          }
        },
        "required": [
          "total_quantity",
          "warehouse_count",
          "by_warehouse"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectf20bf16616": {
        "type": "object",
        "properties": {
          "warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "warehouse_name": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "on_hand": {
            "type": "number"
          },
          "reserved_quantity": {
            "type": "number"
          },
          "incoming_quantity": {
            "type": "number"
          }
        },
        "required": [
          "warehouse_id",
          "warehouse_name",
          "quantity",
          "on_hand",
          "reserved_quantity",
          "incoming_quantity"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject8314097d1f": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "sku": {
            "type": "string"
          },
          "barcode": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "description": "External product image URL reference. La Pyme displays it best effort and does not copy, ingest, or host the image.",
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "cost": {
            "description": "Product cost in cents. Null when the delegated user cannot view product costs.",
            "type": [
              "number",
              "null"
            ]
          },
          "price": {
            "type": "number"
          },
          "tax_rate": {
            "$ref": "#/components/schemas/ApiSharedObjectee5eae48b0"
          },
          "default_supplier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "product_type": {
            "$ref": "#/components/schemas/ApiSharedEnumff49232140"
          },
          "visibility": {
            "$ref": "#/components/schemas/ApiSharedEnuma7f3605118"
          },
          "is_active": {
            "type": "boolean"
          },
          "organization_slug": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject564df4258f"
            }
          },
          "effective_price": {
            "type": "number"
          },
          "price_source": {
            "$ref": "#/components/schemas/ApiSharedEnumfe93f70a59"
          },
          "applied_price_list": {
            "$ref": "#/components/schemas/ApiSharedObject3b83f74923"
          },
          "object": {
            "type": "string",
            "const": "product"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          },
          "variant_group_id": {
            "type": "string",
            "format": "uuid"
          },
          "variant_options": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "is_exempt": {
            "type": "boolean"
          },
          "metafields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject0347948139"
            }
          },
          "stock_summary": {
            "$ref": "#/components/schemas/ApiSharedObjecta9f7340006"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "category",
          "sku",
          "barcode",
          "image_url",
          "currency",
          "cost",
          "price",
          "tax_rate",
          "default_supplier",
          "product_type",
          "visibility",
          "is_active",
          "organization_slug",
          "created_at",
          "updated_at",
          "components",
          "object",
          "tags",
          "variant_group_id",
          "variant_options",
          "is_exempt",
          "metafields",
          "stock_summary"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectaaccd788d6": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "is_automatic": {
            "type": "boolean"
          },
          "automatic_pricing_mode": {
            "$ref": "#/components/schemas/ApiSharedEnum3c5633618c"
          },
          "adjustment_percentage": {
            "type": [
              "number",
              "null"
            ]
          },
          "source_price_list_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_inclusive": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "object": {
            "type": "string",
            "const": "price_list"
          }
        },
        "required": [
          "id",
          "name",
          "is_automatic",
          "automatic_pricing_mode",
          "adjustment_percentage",
          "source_price_list_id",
          "tax_inclusive",
          "created_at",
          "object"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectb990586284": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "price_list_price"
          },
          "price_list_id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "currency": {
            "type": "string",
            "const": "ARS"
          },
          "tax_inclusive": {
            "type": "boolean"
          },
          "tax_rate": {
            "$ref": "#/components/schemas/ApiSharedObjecta3133edce3"
          },
          "is_exempt": {
            "type": "boolean"
          },
          "calculation": {
            "$ref": "#/components/schemas/ApiSharedObjectf2ec33bd59"
          },
          "status": {
            "type": "string",
            "const": "priced"
          },
          "unit_price": {
            "type": "integer"
          }
        },
        "required": [
          "object",
          "price_list_id",
          "product_id",
          "currency",
          "tax_inclusive",
          "tax_rate",
          "is_exempt",
          "calculation",
          "status",
          "unit_price"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjecta3133edce3": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "value": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "value"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectf2ec33bd59": {
        "type": "object",
        "properties": {
          "origin": {
            "$ref": "#/components/schemas/ApiSharedEnumb3cd05d84a"
          },
          "type": {
            "$ref": "#/components/schemas/ApiSharedEnumb8b65e480e"
          },
          "source_price_list_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "origin",
          "type",
          "source_price_list_id"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnumb3cd05d84a": {
        "type": "string",
        "enum": [
          "product_rule",
          "list_policy",
          "base_fallback",
          "composite_fallback"
        ]
      },
      "ApiSharedEnumb8b65e480e": {
        "type": "string",
        "enum": [
          "fixed_price",
          "cost_markup",
          "base_adjustment",
          "base_price",
          "component_sum"
        ]
      },
      "ApiSharedObjectcc3aec15bc": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "price_list_price"
          },
          "price_list_id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "currency": {
            "type": "string",
            "const": "ARS"
          },
          "tax_inclusive": {
            "type": "boolean"
          },
          "tax_rate": {
            "$ref": "#/components/schemas/ApiSharedObjecta3133edce3"
          },
          "is_exempt": {
            "type": "boolean"
          },
          "calculation": {
            "$ref": "#/components/schemas/ApiSharedObjectf2ec33bd59"
          },
          "status": {
            "type": "string",
            "const": "unavailable"
          },
          "unit_price": {
            "type": "null"
          },
          "unavailable_reason": {
            "type": "string",
            "const": "pricing_input_unavailable"
          }
        },
        "required": [
          "object",
          "price_list_id",
          "product_id",
          "currency",
          "tax_inclusive",
          "tax_rate",
          "is_exempt",
          "calculation",
          "status",
          "unit_price",
          "unavailable_reason"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject91cc200368": {
        "type": "object",
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum1ba2b57809": {
        "type": "string",
        "enum": [
          "ready",
          "pending",
          "failed",
          "missing"
        ]
      },
      "ApiSharedObjectb708221d2f": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "accounting_evidence"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum8b51d9e8f5"
          },
          "journal_entry_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "journal_entries_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject76de9df039"
            }
          }
        },
        "required": [
          "object",
          "status",
          "journal_entry_ids",
          "journal_entries_url",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject9c9e4b0e0d": {
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum1ba2b57809"
          },
          "url": {
            "description": "Stable authenticated La Pyme API path. Present only when status is ready; follow redirects when downloading.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "status",
          "url"
        ],
        "additionalProperties": false,
        "description": "Document availability. The URL requires bearer authentication and never contains a storage path or signed query string."
      },
      "ApiSharedEnumf2073aa092": {
        "type": "string",
        "enum": [
          "draft",
          "sent",
          "partially_received",
          "received",
          "closed",
          "cancelled"
        ]
      },
      "ApiSharedObjectfaafd59b8b": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_category": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "apartment": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "province": {
            "type": [
              "string",
              "null"
            ]
          },
          "postal_code": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "email",
          "phone",
          "tax_id_type",
          "tax_id",
          "tax_category",
          "payment_term_id",
          "payment_term_days",
          "address",
          "apartment",
          "city",
          "province",
          "postal_code"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjecta50ed243b8": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "ordered_quantity": {
            "type": [
              "number",
              "null"
            ]
          },
          "received_quantity": {
            "type": "number"
          },
          "expected_unit_cost": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "product": {
            "$ref": "#/components/schemas/ApiSharedObject15e53f9372"
          }
        },
        "required": [
          "id",
          "ordered_quantity",
          "received_quantity",
          "expected_unit_cost",
          "product"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject15e53f9372": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumff49232140"
              },
              {
                "type": "null"
              }
            ]
          },
          "variant_options": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "option_names": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "sku",
          "product_type",
          "variant_options",
          "option_names"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjecteffe384a18": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "purchase_order"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "order_number": {
            "type": "integer"
          },
          "formatted_order_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnumf2073aa092"
          },
          "order_date": {
            "type": "string",
            "format": "date"
          },
          "expected_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string"
          },
          "supplier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObjectfaafd59b8b"
              },
              {
                "type": "null"
              }
            ]
          },
          "warehouse": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          },
          "warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjecta50ed243b8"
            }
          }
        },
        "required": [
          "object",
          "id",
          "order_number",
          "formatted_order_number",
          "status",
          "order_date",
          "expected_date",
          "currency",
          "supplier",
          "warehouse",
          "created_at",
          "tags",
          "warehouse_id",
          "notes",
          "items"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum4ac9200c4a": {
        "type": "string",
        "enum": [
          "open",
          "completed",
          "cancelled"
        ]
      },
      "ApiSharedEnumb49e56b125": {
        "type": "string",
        "enum": [
          "unfulfilled",
          "in_progress",
          "partially_fulfilled",
          "fulfilled",
          "cancelled"
        ]
      },
      "ApiSharedEnum2f67ddf0e8": {
        "type": "string",
        "enum": [
          "pending",
          "partially_invoiced",
          "invoiced"
        ]
      },
      "ApiSharedObjectb74541d41a": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "line_number": {
            "type": "integer"
          },
          "product_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "product_name": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "ordered_quantity": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          },
          "allocated_quantity": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          },
          "fulfilled_quantity": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          },
          "invoiced_quantity": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          },
          "cancelled_quantity": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          },
          "unit_price": {
            "type": "integer",
            "minimum": 0
          },
          "tax_rate_id": {
            "type": "integer"
          },
          "discount_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "discount_percentage": {
            "type": [
              "number",
              "null"
            ]
          },
          "subtotal": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "id",
          "line_number",
          "product_id",
          "product_name",
          "sku",
          "ordered_quantity",
          "allocated_quantity",
          "fulfilled_quantity",
          "invoiced_quantity",
          "cancelled_quantity",
          "unit_price",
          "tax_rate_id",
          "discount_amount",
          "discount_percentage",
          "subtotal"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject6e2450633e": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "is_default": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "is_default"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectc8647a846a": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum19a9b49403"
          },
          "warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "warehouse_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery_method": {
            "$ref": "#/components/schemas/ApiSharedEnumcc76b6d63a"
          },
          "requested_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "closed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "cancelled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject4052bad07b"
            }
          }
        },
        "required": [
          "id",
          "status",
          "warehouse_id",
          "warehouse_name",
          "delivery_method",
          "requested_at",
          "started_at",
          "closed_at",
          "cancelled_at",
          "notes",
          "lines"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum19a9b49403": {
        "type": "string",
        "enum": [
          "open",
          "in_progress",
          "on_hold",
          "closed",
          "cancelled"
        ]
      },
      "ApiSharedEnumcc76b6d63a": {
        "type": "string",
        "enum": [
          "shipping",
          "local_delivery",
          "pickup"
        ]
      },
      "ApiSharedObject4052bad07b": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "order_line_id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "product_name": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "quantity": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          },
          "fulfilled_quantity": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          },
          "cancelled_quantity": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          },
          "pending_quantity": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          }
        },
        "required": [
          "id",
          "order_line_id",
          "product_id",
          "product_name",
          "sku",
          "quantity",
          "fulfilled_quantity",
          "cancelled_quantity",
          "pending_quantity"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject81e5b4b232": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "order_preparation"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "prepared_at": {
            "type": "string",
            "format": "date-time"
          },
          "warehouse_name": {
            "type": "string"
          },
          "delivery_method": {
            "$ref": "#/components/schemas/ApiSharedEnumcc76b6d63a"
          },
          "remito_delivery_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "formatted_remito_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjecta83bae2379"
            }
          }
        },
        "required": [
          "object",
          "id",
          "prepared_at",
          "warehouse_name",
          "delivery_method",
          "remito_delivery_id",
          "formatted_remito_number",
          "lines"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjecta83bae2379": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "order_line_id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "product_name": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "variant_options": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "option_names": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          },
          "ordered_quantity": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          },
          "unit_price": {
            "type": "integer",
            "minimum": 0
          },
          "discount_percentage": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "order_line_id",
          "product_id",
          "product_name",
          "sku",
          "variant_options",
          "option_names",
          "quantity",
          "ordered_quantity",
          "unit_price",
          "discount_percentage"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectd4414f57ad": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "order_invoice"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "formatted_invoice_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoice_date": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "invoice_status": {
            "$ref": "#/components/schemas/ApiSharedEnum9ac70a3316"
          },
          "items_count": {
            "type": "integer"
          },
          "total_units": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "object",
          "id",
          "formatted_invoice_number",
          "invoice_date",
          "created_at",
          "invoice_status",
          "items_count",
          "total_units",
          "total"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject251954f6f7": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "order"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "order_number": {
            "type": "string"
          },
          "raw_order_number": {
            "type": "integer"
          },
          "order_date": {
            "type": "string",
            "format": "date-time"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_name": {
            "type": "string"
          },
          "customer_tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "items_count": {
            "type": "integer"
          },
          "total_units": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.0001
          },
          "discount_amount": {
            "type": "integer",
            "minimum": 0
          },
          "subtotal": {
            "type": "integer",
            "minimum": 0
          },
          "tax_amount": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "order_status": {
            "$ref": "#/components/schemas/ApiSharedEnum4ac9200c4a"
          },
          "preparation_status": {
            "$ref": "#/components/schemas/ApiSharedEnumb49e56b125"
          },
          "invoicing_status": {
            "$ref": "#/components/schemas/ApiSharedEnum2f67ddf0e8"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by_name": {
            "type": "string"
          },
          "created_by": {
            "type": "string",
            "format": "uuid"
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectb74541d41a"
            }
          },
          "active_warehouses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject6e2450633e"
            }
          },
          "pending_preparation_warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "preparation_groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectc8647a846a"
            }
          },
          "preparations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject81e5b4b232"
            }
          },
          "invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectd4414f57ad"
            }
          }
        },
        "required": [
          "object",
          "id",
          "order_number",
          "raw_order_number",
          "order_date",
          "customer_id",
          "customer_name",
          "customer_tax_id",
          "items_count",
          "total_units",
          "discount_amount",
          "subtotal",
          "tax_amount",
          "total",
          "currency",
          "order_status",
          "preparation_status",
          "invoicing_status",
          "notes",
          "created_at",
          "updated_at",
          "created_by_name",
          "created_by",
          "line_items",
          "active_warehouses",
          "pending_preparation_warehouse_id",
          "preparation_groups",
          "preparations",
          "invoices"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectc2dbdba87b": {
        "type": "object",
        "properties": {
          "order_line_id": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0,
            "multipleOf": 0.0001
          }
        },
        "required": [
          "order_line_id",
          "quantity"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject97f4e132e6": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "icon": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "icon"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject7afcf3dcbb": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "code": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "code"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject2d9f8803d7": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sku": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "product_type": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "sku",
          "name",
          "product_type"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject7e70bcc878": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject94c0cab352": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "number",
          "name"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject2bc2c4916e": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "full_name": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "full_name"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject3ef6d7a544": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "payment_id": {
            "type": "string",
            "format": "uuid"
          },
          "formatted_payment_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_date": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "payment_method": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject97f4e132e6"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "terminal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject7afcf3dcbb"
              },
              {
                "type": "null"
              }
            ]
          },
          "card_batch_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_coupon_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_installment_plan_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_brand": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "payment_id",
          "formatted_payment_number",
          "payment_number",
          "payment_date",
          "amount",
          "currency",
          "payment_method",
          "notes",
          "created_at",
          "terminal",
          "card_batch_number",
          "card_coupon_number",
          "card_installment_plan_code",
          "card_brand"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject00e1b911ed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "applied_amount": {
            "type": "integer"
          },
          "sale_id": {
            "type": "string",
            "format": "uuid"
          },
          "sale_formatted_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "sale_voucher_type": {
            "type": "string"
          },
          "sale_total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "id",
          "created_at",
          "applied_amount",
          "sale_id",
          "sale_formatted_number",
          "sale_voucher_type",
          "sale_total"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectdacb842378": {
        "type": "object",
        "properties": {
          "file": {
            "$ref": "#/components/schemas/ApiSharedObject9c9e4b0e0d"
          }
        },
        "required": [
          "file"
        ],
        "additionalProperties": {}
      },
      "ApiSharedObject06b16aade1": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "amount"
          },
          "value": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "type",
          "value"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnumfbc137f7cc": {
        "type": "string",
        "enum": [
          "draft",
          "sent",
          "accepted",
          "rejected",
          "expired",
          "converted"
        ]
      },
      "ApiSharedObjectc82a2ff2d4": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "active"
          },
          "reserved_through_date": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "status",
          "reserved_through_date"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject6e2dab2a90": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "quote_line"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "custom_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "custom_product_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum003ee2d7f5"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_rate_id": {
            "type": "integer"
          },
          "is_exempt": {
            "type": "boolean"
          },
          "warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0,
            "multipleOf": 0.0001
          },
          "unit_price": {
            "type": "integer",
            "minimum": 0
          },
          "discount": {
            "anyOf": [
              {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/ApiSharedObject0141f82a97"
                  },
                  {
                    "$ref": "#/components/schemas/ApiSharedObject06b16aade1"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "object",
          "id",
          "product_id",
          "warehouse_id",
          "quantity",
          "unit_price",
          "discount"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject0141f82a97": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "percentage"
          },
          "value": {
            "type": "number",
            "minimum": 0
          }
        },
        "required": [
          "type",
          "value"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject5e70e1df84": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "customer"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_category": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectc15d6ab2fa": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "sale"
          },
          "sale_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "type",
          "sale_id"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject5a978938b1": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "fulfillment"
          },
          "fulfillment_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "type",
          "fulfillment_id"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject05f64e43bb": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "custom"
          }
        },
        "required": [
          "type"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectd6ec566aaf": {
        "type": "object",
        "properties": {
          "legal_name": {
            "type": "string"
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_category": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "apartment": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "province": {
            "type": [
              "string",
              "null"
            ]
          },
          "postal_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "gross_income_tax_amount": {
            "type": [
              "string",
              "null"
            ]
          },
          "activities_started_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "legal_name",
          "tax_id",
          "tax_id_type",
          "tax_category",
          "address",
          "apartment",
          "city",
          "province",
          "postal_code",
          "phone",
          "gross_income_tax_amount",
          "activities_started_at"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject912052d04a": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sale_item_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "type": "number"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_custom": {
            "type": "boolean"
          },
          "warehouse_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "product": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject0a16670526"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "sale_item_id",
          "quantity",
          "name",
          "is_custom",
          "warehouse_id",
          "product"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject0a16670526": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "product"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "option_names": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "variant_options": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "product_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum5c962a8637"
              },
              {
                "type": "null"
              }
            ]
          },
          "kit_units": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "sku",
          "name",
          "option_names",
          "variant_options",
          "product_type",
          "kit_units"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum5c962a8637": {
        "type": "string",
        "enum": [
          "product",
          "combo",
          "kit",
          "service"
        ]
      },
      "ApiSharedEnum4b1b5db8e0": {
        "type": "string",
        "enum": [
          "legacy",
          "managed"
        ]
      },
      "ApiSharedObject5a67c4e4e1": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "talonario_id": {
            "type": "string",
            "format": "uuid"
          },
          "authorization_id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer"
          },
          "formatted_number": {
            "type": "string"
          },
          "emission_point": {
            "type": "integer"
          },
          "cai": {
            "type": "string",
            "pattern": "^\\d{14}$"
          },
          "expires_on": {
            "type": "string",
            "format": "date"
          },
          "issued_on": {
            "type": "string",
            "format": "date"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string",
            "format": "uuid"
          },
          "delivery_revision": {
            "type": "integer"
          },
          "voided_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "voided_by": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "void_reason": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "talonario_id",
          "authorization_id",
          "number",
          "formatted_number",
          "emission_point",
          "cai",
          "expires_on",
          "issued_on",
          "created_at",
          "created_by",
          "delivery_revision",
          "voided_at",
          "voided_by",
          "void_reason"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectf3b611a53b": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "emission_point": {
            "type": "integer"
          },
          "next_number": {
            "type": "integer"
          },
          "cai": {
            "type": "string",
            "pattern": "^\\d{14}$"
          },
          "expires_on": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "id",
          "name",
          "emission_point",
          "next_number",
          "cai",
          "expires_on"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum09382f5041": {
        "type": "string",
        "enum": [
          "sale.created",
          "sale.updated",
          "order.created",
          "order.updated",
          "order.completed",
          "order.cancelled",
          "order.partially_fulfilled",
          "order.fulfilled",
          "fulfillment.created",
          "product.created",
          "product.updated",
          "webhook_endpoint.disabled"
        ]
      },
      "ApiSharedEnum5f610d8b6a": {
        "type": "string",
        "enum": [
          "2026-06-29"
        ]
      },
      "ApiSharedEnum1c9cda998e": {
        "type": "string",
        "enum": [
          "active",
          "paused",
          "disabled"
        ]
      },
      "ApiSharedEnum4b017f6476": {
        "type": "string",
        "enum": [
          "organization",
          "connected_app"
        ]
      },
      "ApiSharedObject21f30ba9b5": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "webhook_endpoint"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "enabled_events": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedEnum09382f5041"
            }
          },
          "api_version": {
            "$ref": "#/components/schemas/ApiSharedEnum5f610d8b6a"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum1c9cda998e"
          },
          "owner_type": {
            "$ref": "#/components/schemas/ApiSharedEnum4b017f6476"
          },
          "failure_count": {
            "type": "integer",
            "minimum": 0
          },
          "last_success_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_failure_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "disabled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "label",
          "url",
          "enabled_events",
          "api_version",
          "status",
          "owner_type",
          "failure_count",
          "last_success_at",
          "last_failure_at",
          "disabled_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject5924af92df": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "product_type": {
            "$ref": "#/components/schemas/ApiSharedEnumff49232140"
          },
          "variant_options": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "option_names": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "sku",
          "product_type",
          "variant_options",
          "option_names"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject0afbf8c23c": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "number"
          },
          "received_quantity": {
            "type": "number"
          },
          "rejected_quantity": {
            "type": "number"
          },
          "product": {
            "$ref": "#/components/schemas/ApiSharedObject5924af92df"
          }
        },
        "required": [
          "id",
          "product_id",
          "quantity",
          "received_quantity",
          "rejected_quantity",
          "product"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject29aea9dac9": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "stock_transfer"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "organization_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "target_warehouse_id": {
            "type": "string",
            "format": "uuid"
          },
          "transfer_date": {
            "type": "string",
            "format": "date-time"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum736f0d077b"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string",
            "format": "uuid"
          },
          "updated_by": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_warehouse": {
            "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
          },
          "target_warehouse": {
            "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject0afbf8c23c"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          }
        },
        "required": [
          "object",
          "id",
          "organization_id",
          "source_warehouse_id",
          "target_warehouse_id",
          "transfer_date",
          "notes",
          "status",
          "created_at",
          "updated_at",
          "created_by",
          "updated_by",
          "source_warehouse",
          "target_warehouse",
          "items",
          "tags"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectba357c1d29": {
        "type": "object",
        "properties": {
          "required": {
            "type": "boolean"
          },
          "min_length": {
            "type": "number"
          },
          "max_length": {
            "type": "number"
          },
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "required"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject23505030dc": {
        "type": "object",
        "properties": {
          "definition_id": {
            "type": "string",
            "format": "uuid"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "definition_id",
          "value"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject39b700d58a": {
        "type": "object",
        "properties": {
          "pending_balance": {
            "type": "number"
          },
          "sales_count": {
            "type": "integer",
            "minimum": 0
          },
          "total_sales": {
            "type": "number"
          },
          "recent_sales": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject9fc1e204dd"
            }
          }
        },
        "required": [
          "pending_balance",
          "sales_count",
          "total_sales",
          "recent_sales"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject9fc1e204dd": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "voucher_type": {
            "type": "string"
          },
          "invoice_status": {
            "type": "string"
          },
          "invoice_date": {
            "type": "string"
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "number"
          },
          "formatted_invoice_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "original_sale_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "voucher_type",
          "invoice_status",
          "invoice_date",
          "currency",
          "total",
          "formatted_invoice_number",
          "original_sale_id",
          "created_at"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnumcb6fc950ce": {
        "type": "string",
        "enum": [
          "CUIL/CUIT",
          "DNI",
          "Otro"
        ]
      },
      "ApiSharedEnumafe76ccc88": {
        "type": "string",
        "enum": [
          "registered_vat_taxpayer",
          "final_consumer",
          "monotributo_taxpayer",
          "vat_exempt",
          "vat_not_applicable",
          "foreign_customer"
        ]
      },
      "ApiSharedObjectd4462f23a0": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "customer"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "apartment": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery_carrier": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_category": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "default_price_list_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_term_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_term_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 365,
                "description": "Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId."
              },
              {
                "type": "null"
              }
            ]
          },
          "province_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_active": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjected3905a55b"
            }
          },
          "default_account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "metafields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject23505030dc"
            }
          },
          "arca_destination_country": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 999
              },
              {
                "type": "null"
              }
            ]
          },
          "foreign_tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "arca_country_tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "postal_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "assigned_salesperson_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_ganancias_regimen": {
            "type": [
              "string",
              "null"
            ]
          },
          "assigned_salesperson": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject2bc2c4916e"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_price_list": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedObject8aeeceaf0f"
              },
              {
                "type": "null"
              }
            ]
          },
          "sales_overview": {
            "$ref": "#/components/schemas/ApiSharedObject39b700d58a"
          }
        },
        "required": [
          "object",
          "id",
          "code",
          "name",
          "company_name",
          "description",
          "email",
          "phone",
          "address",
          "apartment",
          "city",
          "delivery_carrier",
          "delivery_address",
          "tax_id",
          "tax_id_type",
          "tax_category",
          "contact_type",
          "default_price_list_id",
          "payment_term_id",
          "payment_term_days",
          "province_id",
          "is_active",
          "created_at",
          "updated_at",
          "tags",
          "default_account_id",
          "metafields",
          "arca_destination_country",
          "foreign_tax_id",
          "arca_country_tax_id",
          "country",
          "postal_code",
          "assigned_salesperson_id",
          "default_ganancias_regimen",
          "assigned_salesperson",
          "default_price_list",
          "sales_overview"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum377ec234cb": {
        "type": "string",
        "enum": [
          "cash",
          "check",
          "card",
          "bank_transfer",
          "other"
        ]
      },
      "ApiSharedEnum73bb779813": {
        "type": "string",
        "enum": [
          "sales",
          "purchases",
          "both",
          "system"
        ]
      },
      "ApiSharedObjectfd1bf60b79": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "sort_order": {
            "type": "integer"
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "code",
          "label",
          "sort_order",
          "is_active"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject73a9297be0": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "payment_method"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "icon": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "$ref": "#/components/schemas/ApiSharedEnum377ec234cb"
          },
          "bank_account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "fee_percentage": {
            "type": [
              "string",
              "null"
            ]
          },
          "fee_fixed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "requires_reference": {
            "type": "boolean"
          },
          "visibility": {
            "$ref": "#/components/schemas/ApiSharedEnum73bb779813"
          },
          "is_active": {
            "type": "boolean"
          },
          "is_default": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "installment_plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectfd1bf60b79"
            }
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "icon",
          "type",
          "bank_account_id",
          "fee_percentage",
          "fee_fixed",
          "requires_reference",
          "visibility",
          "is_active",
          "is_default",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectaf3c3f0696": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "icon": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "icon"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjecteb6efa80ed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "sale_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "number",
          "sale_id"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum65e97ceeee": {
        "type": "string",
        "enum": [
          "active",
          "voided"
        ]
      },
      "ApiSharedObject0c2dce233d": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "payment_method_id": {
            "type": "string",
            "format": "uuid"
          },
          "payment_method_name": {
            "type": "string"
          },
          "amount": {
            "type": "integer"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_brand": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_batch_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_coupon_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_installment_plan_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "fee_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "fee_percentage_applied": {
            "type": [
              "string",
              "null"
            ]
          },
          "fee_fixed_applied": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "net_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "check_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "register_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "safe_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "payment_method_id",
          "amount"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectf94fd1d888": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sale_id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_sale_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "credit_sale_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "advance_payment_id": {
            "type": "string",
            "format": "uuid"
          },
          "journal_line_id": {
            "type": "string",
            "format": "uuid"
          },
          "applied_amount": {
            "type": "integer"
          },
          "formatted_invoice_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "credit_formatted_invoice_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "advance_formatted_payment_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoice_formatted_invoice_number": {
            "description": "Número del comprobante de venta que el crédito cancela. Es null cuando el crédito cancela una partida que no es una venta.",
            "type": [
              "string",
              "null"
            ]
          },
          "credit_journal_entry_id": {
            "description": "ID del asiento de un crédito manual u otro crédito contable.",
            "type": "string",
            "format": "uuid"
          },
          "credit_label": {
            "description": "Nombre de un crédito manual u otro crédito contable, como se muestra en los créditos disponibles.",
            "type": "string"
          },
          "credit_date": {
            "description": "Fecha de un crédito manual u otro crédito contable en formato YYYY-MM-DD.",
            "type": "string"
          }
        },
        "required": [
          "applied_amount"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject31607d73d9": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "$ref": "#/components/schemas/ApiSharedEnum111b0d070e"
          },
          "province_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "regimen": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount": {
            "type": "integer"
          },
          "rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "calculation_base": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "certificate_number": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "amount",
          "certificate_number"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum111b0d070e": {
        "type": "string",
        "enum": [
          "ganancias",
          "iibb",
          "iva",
          "suss",
          "seg_hig"
        ]
      },
      "ApiSharedObjectd498e17ec0": {
        "type": "object",
        "properties": {
          "payment_method_id": {
            "type": "string",
            "format": "uuid"
          },
          "amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "reference": {
            "type": "string",
            "maxLength": 255
          },
          "card_brand": {
            "type": "string",
            "maxLength": 100
          },
          "card_batch_number": {
            "type": "string",
            "maxLength": 100
          },
          "card_coupon_number": {
            "type": "string",
            "maxLength": 100
          },
          "card_installment_plan_code": {
            "type": "string",
            "maxLength": 100
          },
          "notes": {
            "type": "string",
            "maxLength": 500
          },
          "fee_amount": {
            "type": "integer",
            "minimum": 0
          },
          "fee_percentage_applied": {
            "type": "string"
          },
          "fee_fixed_applied": {
            "type": "integer",
            "minimum": 0
          },
          "net_amount": {
            "type": "integer",
            "minimum": 0
          },
          "check_id": {
            "type": "string",
            "format": "uuid"
          },
          "check_data": {
            "$ref": "#/components/schemas/ApiSharedObject24cbbd28ea"
          },
          "register_id": {
            "type": "string",
            "format": "uuid"
          },
          "safe_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "payment_method_id",
          "amount"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject24cbbd28ea": {
        "type": "object",
        "properties": {
          "origin": {
            "$ref": "#/components/schemas/ApiSharedEnumbe3790a091"
          },
          "check_format": {
            "$ref": "#/components/schemas/ApiSharedEnumbf6bff0c7b"
          },
          "number": {
            "type": "string",
            "maxLength": 20
          },
          "bank_name": {
            "type": "string"
          },
          "issuing_bank_account_id": {
            "type": "string",
            "format": "uuid"
          },
          "amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "issue_date": {
            "type": "string"
          },
          "due_date": {
            "type": "string"
          },
          "issuer_name": {
            "type": "string",
            "maxLength": 255
          }
        },
        "required": [
          "origin",
          "number",
          "amount",
          "issue_date"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnumbe3790a091": {
        "type": "string",
        "enum": [
          "own",
          "third_party"
        ]
      },
      "ApiSharedEnumbf6bff0c7b": {
        "type": "string",
        "enum": [
          "paper",
          "electronic"
        ]
      },
      "ApiSharedObjectdaa374f786": {
        "type": "object",
        "properties": {
          "journal_line_id": {
            "type": "string",
            "format": "uuid"
          },
          "applied_amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "journal_line_id",
          "applied_amount"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject6447103182": {
        "type": "object",
        "properties": {
          "advance_payment_id": {
            "type": "string",
            "format": "uuid"
          },
          "applied_amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "advance_payment_id",
          "applied_amount"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject04f7a42bab": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "const": "customer"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum65e97ceeee"
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "contact_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "formatted_payment_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_date": {
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "settlement_currency": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
              },
              {
                "type": "null"
              }
            ]
          },
          "settlement_total_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "exchange_rate": {
            "type": [
              "string",
              "number",
              "null"
            ]
          },
          "total_amount": {
            "type": "integer"
          },
          "balance": {
            "type": "integer"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "splits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject0c2dce233d"
            }
          },
          "applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "credit_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "journal_line_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "advance_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "other_credit_applications": {
            "description": "Créditos manuales y otros créditos contables que aplicó la cobranza, sin notas de crédito ni anticipos.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "withholdings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject31607d73d9"
            }
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "contact_id",
          "contact_name",
          "payment_number",
          "formatted_payment_number",
          "payment_date",
          "currency",
          "total_amount",
          "balance",
          "created_at",
          "created_by_name"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectee9c57275f": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "voided": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "voided"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject59213d7914": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "number"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectf91176efb5": {
        "type": "object",
        "properties": {
          "purchase_id": {
            "type": "string",
            "format": "uuid"
          },
          "applied_amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "purchase_id",
          "applied_amount"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectc2ed2476df": {
        "type": "object",
        "properties": {
          "credit_purchase_id": {
            "type": "string",
            "format": "uuid"
          },
          "applied_amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "credit_purchase_id",
          "applied_amount"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject0f748b4000": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "const": "supplier"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnum65e97ceeee"
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "contact_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "formatted_payment_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_date": {
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "settlement_currency": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
              },
              {
                "type": "null"
              }
            ]
          },
          "settlement_total_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "exchange_rate": {
            "type": [
              "string",
              "number",
              "null"
            ]
          },
          "total_amount": {
            "type": "integer"
          },
          "balance": {
            "type": "integer"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "splits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject0c2dce233d"
            }
          },
          "applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "credit_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "journal_line_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "advance_applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "other_credit_applications": {
            "description": "Créditos manuales y otros créditos contables que aplicó la cobranza, sin notas de crédito ni anticipos.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectf94fd1d888"
            }
          },
          "withholdings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject31607d73d9"
            }
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "contact_id",
          "contact_name",
          "payment_number",
          "formatted_payment_number",
          "payment_date",
          "currency",
          "total_amount",
          "balance",
          "created_at",
          "created_by_name"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectc0cace1787": {
        "type": "object",
        "properties": {
          "supplier_payment": {
            "$ref": "#/components/schemas/ApiSharedObject0f748b4000"
          }
        },
        "required": [
          "supplier_payment"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum83b768347f": {
        "type": "string",
        "enum": [
          "bank",
          "credit_card"
        ]
      },
      "ApiSharedEnumd952d5ce8e": {
        "type": "string",
        "enum": [
          "active",
          "inactive"
        ]
      },
      "ApiSharedObjectd862a95f13": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "bank_account"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "$ref": "#/components/schemas/ApiSharedEnum83b768347f"
          },
          "bank_name": {
            "type": "string"
          },
          "account_name": {
            "type": "string"
          },
          "cbu": {
            "type": [
              "string",
              "null"
            ]
          },
          "alias": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
          },
          "opening_balance": {
            "type": "integer"
          },
          "opening_balance_date": {
            "type": "string",
            "format": "date"
          },
          "uses_checkbook": {
            "type": "boolean"
          },
          "status": {
            "$ref": "#/components/schemas/ApiSharedEnumd952d5ce8e"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "kind",
          "bank_name",
          "account_name",
          "cbu",
          "alias",
          "currency",
          "opening_balance",
          "opening_balance_date",
          "uses_checkbook",
          "status",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum53162db3eb": {
        "type": "string",
        "enum": [
          "bank_account",
          "register",
          "safe"
        ]
      },
      "ApiSharedEnum714ff181d6": {
        "type": "string",
        "enum": [
          "exact",
          "derived",
          "unavailable"
        ]
      },
      "ApiSharedEnumd440d6785b": {
        "type": "string",
        "enum": [
          "organization",
          "own"
        ]
      },
      "ApiSharedEnumf03e06f92c": {
        "type": "string",
        "enum": [
          "rate",
          "carrying_value",
          "legacy_unknown"
        ]
      },
      "ApiSharedObject45b71eae86": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "rate_date": {
            "type": "string",
            "format": "date"
          },
          "source": {
            "$ref": "#/components/schemas/ApiSharedEnum3e321043c1"
          }
        },
        "required": [
          "value",
          "rate_date",
          "source"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum3e321043c1": {
        "type": "string",
        "enum": [
          "bcra",
          "actual",
          "manual"
        ]
      },
      "ApiSharedEnumc1c44f3acf": {
        "type": "string",
        "enum": [
          "opening_balance",
          "customer_payment",
          "supplier_payment",
          "check_in",
          "check_out",
          "funds_transfer",
          "treasury_adjustment",
          "journal_entry"
        ]
      },
      "ApiSharedObject1bdf8f7029": {
        "type": "object",
        "properties": {
          "balance_type": {
            "$ref": "#/components/schemas/ApiSharedEnum624a50a35d"
          },
          "balance_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "balance_type",
          "balance_id"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum624a50a35d": {
        "type": "string",
        "enum": [
          "bank_account",
          "safe"
        ]
      },
      "ApiSharedEnumba3dc7ee2b": {
        "type": "string",
        "enum": [
          "inflow",
          "outflow"
        ]
      },
      "ApiSharedObject39414c953b": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "amount": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center1_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center2_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center3_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "account_id",
          "amount"
        ],
        "additionalProperties": false
      },
      "ApiSharedObjectfd7f591c89": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "required": [
          "source",
          "key"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject95caea9bee": {
        "type": "object",
        "properties": {
          "cost_center1_id": {
            "type": "string",
            "format": "uuid"
          },
          "amount_cents": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "cost_center1_id",
          "amount_cents"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject16a22cc706": {
        "type": "object",
        "properties": {
          "balance_type": {
            "$ref": "#/components/schemas/ApiSharedEnum53162db3eb"
          },
          "balance_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "balance_type",
          "balance_id"
        ],
        "additionalProperties": false
      },
      "ApiSharedObject828d107a8b": {
        "type": "object",
        "properties": {
          "treasury_movement_id": {
            "type": "string",
            "format": "uuid"
          },
          "balance_type": {
            "$ref": "#/components/schemas/ApiSharedEnum53162db3eb"
          },
          "balance_id": {
            "type": "string",
            "format": "uuid"
          },
          "amount": {
            "type": "integer"
          },
          "currency": {
            "type": "string",
            "const": "ARS"
          }
        },
        "required": [
          "treasury_movement_id",
          "balance_type",
          "balance_id",
          "amount",
          "currency"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnum1579b1abf3": {
        "type": "string",
        "enum": [
          "register",
          "safe"
        ]
      },
      "ApiSharedObject5884d24e45": {
        "type": "object",
        "properties": {
          "available": {
            "type": "number"
          },
          "on_hand": {
            "type": "number"
          },
          "reserved": {
            "type": "number"
          },
          "incoming": {
            "type": "number"
          }
        },
        "required": [
          "available",
          "on_hand",
          "reserved",
          "incoming"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnumed1129741e": {
        "type": "string",
        "enum": [
          "sale",
          "purchase"
        ]
      },
      "ApiSharedEnum6440f2bcc2": {
        "type": "string",
        "enum": [
          "ARS",
          "USD"
        ],
        "default": "ARS",
        "description": "Currency used for all monetary measures in the report."
      },
      "ApiSharedEnum59bd24ac3d": {
        "type": "string",
        "enum": [
          "original",
          "functional_ars"
        ]
      },
      "ApiSharedEnumab9ba78640": {
        "type": "string",
        "enum": [
          "today",
          "yesterday",
          "last_7_days",
          "last_30_days",
          "last_90_days",
          "this_month",
          "previous_month",
          "this_year"
        ]
      },
      "ApiSharedEnume8f16939df": {
        "type": "string",
        "enum": [
          "commercial",
          "fiscal"
        ]
      },
      "ApiSharedEnumef5c34521c": {
        "type": "string",
        "enum": [
          "sales",
          "purchases",
          "payments",
          "applied_collections",
          "commissions",
          "inventory",
          "treasury"
        ]
      },
      "ApiSharedObject5524465fb0": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "description": "Public filter field in snake_case."
          },
          "input": {
            "type": "string"
          },
          "resolved_id": {
            "type": "string",
            "description": "Verified entity ID or supported sentinel."
          },
          "resolved_label": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "input",
          "resolved_id",
          "resolved_label"
        ],
        "additionalProperties": false
      },
      "ApiSharedEnumb5a8e60557": {
        "type": "string",
        "enum": [
          "functional_ars",
          "exact_operation_rate",
          "native_usd",
          "bcra_transaction_date",
          "mixed_by_source",
          "treasury_original_currency",
          "treasury_functional_ars_accounting_value"
        ]
      },
      "ApiSharedEnume975a7c122": {
        "type": "string",
        "enum": [
          "invoiceDate",
          "dueDate"
        ],
        "default": "invoiceDate"
      },
      "ApiSharedEnumf007ccd7a1": {
        "type": "string",
        "enum": [
          "2026-08-20"
        ]
      },
      "ApiSharedObject44d57fbeb2": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObject2f89490657"
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        }
      },
      "ApiSharedObject2f89490657": {
        "type": "object",
        "properties": {
          "credit_note": {
            "$ref": "#/components/schemas/ApiSharedObject2d5ef0a199"
          }
        }
      },
      "ApiSharedObject2d5ef0a199": {
        "type": "object",
        "properties": {
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnumed3bc9006a"
          },
          "sale_id": {
            "type": "string",
            "format": "uuid"
          },
          "total": {
            "type": [
              "integer",
              "null"
            ]
          },
          "invoice_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoice_number": {
            "type": [
              "integer",
              "null"
            ]
          },
          "formatted_invoice_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "voucher_type": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ApiSharedEnumed3bc9006a": {
        "type": "string",
        "enum": [
          "credit_note"
        ]
      },
      "ApiSharedEnum8ef2575a44": {
        "type": "string",
        "enum": [
          "active",
          "voided",
          "all"
        ],
        "default": "active"
      },
      "ApiSharedEnuma4e4082638": {
        "type": "string",
        "enum": [
          "equal",
          "between"
        ]
      },
      "ApiSharedEnume0cf0306aa": {
        "type": "string",
        "enum": [
          "list"
        ]
      },
      "ApiSharedObject1923b260ad": {
        "type": "object",
        "required": [
          "request_id",
          "effective_scope",
          "data"
        ],
        "properties": {
          "request_id": {
            "type": "string"
          },
          "effective_scope": {
            "description": "Circuito sobre el que corrió el reporte: `all`, o el circuito pedido (`circuit_id` null es General).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum901b3341d8"
              },
              {
                "$ref": "#/components/schemas/ApiSharedObject8d2ab49c4a"
              }
            ]
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "ApiSharedEnum901b3341d8": {
        "type": "string",
        "enum": [
          "all"
        ]
      },
      "ApiSharedObject8d2ab49c4a": {
        "type": "object",
        "required": [
          "circuit_id",
          "circuit_name"
        ],
        "properties": {
          "circuit_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "circuit_name": {
            "type": "string"
          }
        }
      },
      "ApiSharedObjectb1775d2f55": {
        "type": "object",
        "required": [
          "request_id",
          "effective_scope",
          "data"
        ],
        "properties": {
          "request_id": {
            "type": "string"
          },
          "effective_scope": {
            "description": "Circuito sobre el que corrió el reporte: `all`, o el circuito pedido (`circuit_id` null es General).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ApiSharedEnum901b3341d8"
              },
              {
                "$ref": "#/components/schemas/ApiSharedObject8d2ab49c4a"
              }
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ApiSharedObjectefe736f3c8"
          }
        }
      },
      "ApiSharedObjectefe736f3c8": {
        "type": "object",
        "required": [
          "object",
          "functional_currency",
          "summary",
          "buckets",
          "is_filtered_subset",
          "groups"
        ],
        "properties": {
          "object": {
            "$ref": "#/components/schemas/ApiSharedEnum08c2c3face"
          },
          "functional_currency": {
            "$ref": "#/components/schemas/ApiSharedEnumd709360a4b"
          },
          "summary": {
            "$ref": "#/components/schemas/ApiSharedObject824a704f0f"
          },
          "buckets": {
            "type": "array",
            "description": "Saldo por tramo de vencimiento, siempre los seis en este orden: undated (sin vencimiento), current (a vencer), 1_30, 31_60, 61_90 y 90_plus (días de mora). Importes en pesos, en unidades menores.",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject6f9fa68da4"
            }
          },
          "is_filtered_subset": {
            "type": "boolean",
            "description": "true si el saldo no es el de toda la organización: filtraste por contacto, fechas o un circuito (en una organización con circuitos), o la clave delega a un usuario que solo ve parte de los datos (propios, clientes o sucursales asignados)."
          },
          "groups": {
            "type": "array",
            "description": "Un grupo por contacto con saldo abierto.",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObjectb4692c73ee"
            }
          }
        }
      },
      "ApiSharedEnum08c2c3face": {
        "type": "string",
        "enum": [
          "accounts_receivable",
          "accounts_payable"
        ]
      },
      "ApiSharedEnumd709360a4b": {
        "type": "string",
        "enum": [
          "ARS"
        ],
        "description": "Moneda de todos los importes del reporte. Un comprobante en dólares ya viene convertido a pesos en `functional_balance`."
      },
      "ApiSharedObject824a704f0f": {
        "type": "object",
        "required": [
          "total",
          "undated",
          "current",
          "overdue"
        ],
        "properties": {
          "total": {
            "type": "integer"
          },
          "undated": {
            "type": "integer"
          },
          "current": {
            "type": "integer"
          },
          "overdue": {
            "type": "integer"
          }
        }
      },
      "ApiSharedObject6f9fa68da4": {
        "type": "object",
        "required": [
          "bucket",
          "label",
          "amount"
        ],
        "properties": {
          "bucket": {
            "$ref": "#/components/schemas/ApiSharedEnumc325e8c877"
          },
          "label": {
            "type": "string"
          },
          "amount": {
            "type": "integer"
          }
        }
      },
      "ApiSharedEnumc325e8c877": {
        "type": "string",
        "enum": [
          "undated",
          "current",
          "1_30",
          "31_60",
          "61_90",
          "90_plus"
        ]
      },
      "ApiSharedObjectb4692c73ee": {
        "type": "object",
        "required": [
          "contact_id",
          "contact_name",
          "total_balance",
          "overdue_balance",
          "document_count",
          "buckets"
        ],
        "properties": {
          "contact_id": {
            "type": "string",
            "format": "uuid"
          },
          "contact_name": {
            "type": "string"
          },
          "total_balance": {
            "type": "integer"
          },
          "overdue_balance": {
            "type": "integer"
          },
          "document_count": {
            "type": "integer"
          },
          "buckets": {
            "type": "array",
            "description": "Saldo por tramo de vencimiento, siempre los seis en este orden: undated (sin vencimiento), current (a vencer), 1_30, 31_60, 61_90 y 90_plus (días de mora). Importes en pesos, en unidades menores.",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject6f9fa68da4"
            }
          },
          "items": {
            "type": "array",
            "description": "Solo con include_items=true.",
            "items": {
              "$ref": "#/components/schemas/ApiSharedObject75b1e48314"
            }
          }
        }
      },
      "ApiSharedObject75b1e48314": {
        "type": "object",
        "required": [
          "origin",
          "origin_label",
          "source_type",
          "source_id",
          "reference",
          "document_number",
          "voucher_type",
          "document_date",
          "due_date",
          "source_currency",
          "functional_balance",
          "days_overdue",
          "bucket"
        ],
        "properties": {
          "origin": {
            "$ref": "#/components/schemas/ApiSharedEnum5a50422bbd"
          },
          "origin_label": {
            "type": "string"
          },
          "source_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "document_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "voucher_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "document_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "source_currency": {
            "type": "string",
            "description": "Moneda del comprobante."
          },
          "functional_balance": {
            "type": "integer",
            "description": "Saldo en `functional_currency` (pesos), aunque el comprobante sea en otra moneda."
          },
          "days_overdue": {
            "type": [
              "integer",
              "null"
            ]
          },
          "bucket": {
            "$ref": "#/components/schemas/ApiSharedEnumc325e8c877"
          }
        }
      },
      "ApiSharedEnum5a50422bbd": {
        "type": "string",
        "enum": [
          "sale",
          "purchase",
          "manual",
          "advance",
          "credit_note",
          "unapplied_credit",
          "compensation",
          "other"
        ]
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "Incluí tu API key en el header Authorization con el prefijo Bearer."
      }
    }
  },
  "paths": {
    "/api/v1/organization": {
      "get": {
        "summary": "Obtener la organización autenticada",
        "description": "Devuelve una proyección segura de identidad fiscal y defaults operativos. No incluye settings internos, CBU, billing, límites, permisos ni credenciales de integraciones.",
        "operationId": "getApiOrganization",
        "tags": [
          "API"
        ],
        "responses": {
          "200": {
            "description": "Organización autenticada obtenida exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiOrganizationResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope settings:read faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope settings:read faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Organización inexistente o inactiva",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Organización inexistente o inactiva",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "settings:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst organization = await lapyme.organization.get();\n"
          }
        ]
      }
    },
    "/api/v1/bank-accounts": {
      "get": {
        "summary": "Listar cuentas bancarias",
        "description": "Lista referencias de cuentas bancarias para integraciones de tesorería y pagos. No expone IDs contables internos ni permite administrar la configuración.",
        "operationId": "listApiBankAccounts",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumd952d5ce8e"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Busca por ID, banco, nombre de cuenta, CBU o alias",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cuentas bancarias obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiBankAccountListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope treasury:read faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope treasury:read faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "treasury:read"
        ]
      }
    },
    "/api/v1/bank-accounts/{bank_account_id}": {
      "get": {
        "summary": "Obtener una cuenta bancaria",
        "description": "Devuelve la configuración pública de una cuenta bancaria sin exponer su cuenta contable interna. Los saldos se consultan por separado.",
        "operationId": "getApiBankAccount",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "bank_account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cuenta bancaria obtenida exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiBankAccountDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "ID o parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "ID o parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope treasury:read faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope treasury:read faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Cuenta bancaria no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Cuenta bancaria no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "treasury:read"
        ]
      }
    },
    "/api/v1/treasury/balances": {
      "get": {
        "summary": "Listar saldos de tesorería",
        "description": "Lista saldos funcionales en ARS derivados del diario contable para cuentas bancarias, cajas registradoras y cajas fuertes denominadas en ARS. Las fuentes USD quedan fuera hasta que exista un contrato canónico de importes nativos y contables.",
        "operationId": "listApiTreasuryBalances",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "balance_type",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnum53162db3eb"
            }
          },
          {
            "name": "balance_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumd952d5ce8e"
            }
          },
          {
            "name": "as_of",
            "in": "query",
            "description": "Fecha argentina inclusive para calcular los saldos",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Saldos de tesorería obtenidos exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTreasuryBalanceListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope treasury:read faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope treasury:read faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "treasury:read"
        ]
      }
    },
    "/api/v1/treasury/movements/{treasury_movement_id}": {
      "get": {
        "operationId": "getApiTreasuryMovement",
        "summary": "get manual Treasury movement",
        "description": "Use native currency cents. USD outflows use carrying value. The path ID is treasury_adjustments.id or treasury_movement_id from lists, not the unified row id. Payments and transfers require their own tools. Registers are excluded.",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "treasury_movement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Movement saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiManualTreasuryMovementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Not manual, changed version, or idempotency conflict"
          },
          "422": {
            "description": "Business requirement unmet"
          },
          "500": {
            "description": "Internal error"
          }
        },
        "x-required-scopes": [
          "treasury:read"
        ]
      },
      "put": {
        "operationId": "updateApiTreasuryMovement",
        "summary": "update manual Treasury movement",
        "description": "Use native currency cents. USD outflows use carrying value. The path ID is treasury_adjustments.id or treasury_movement_id from lists, not the unified row id. Payments and transfers require their own tools. Registers are excluded.",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "treasury_movement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiUpdateTreasuryMovementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Movement saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiManualTreasuryMovementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Not manual, changed version, or idempotency conflict"
          },
          "422": {
            "description": "Business requirement unmet"
          },
          "500": {
            "description": "Internal error"
          }
        },
        "x-required-scopes": [
          "treasury:write"
        ]
      },
      "delete": {
        "operationId": "deleteApiTreasuryMovement",
        "summary": "delete manual Treasury movement",
        "description": "Use native currency cents. USD outflows use carrying value. The path ID is treasury_adjustments.id or treasury_movement_id from lists, not the unified row id. Payments and transfers require their own tools. Registers are excluded.",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "treasury_movement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiDeleteTreasuryMovementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Movement saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiDeletedTreasuryMovementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Not manual, changed version, or idempotency conflict"
          },
          "422": {
            "description": "Business requirement unmet"
          },
          "500": {
            "description": "Internal error"
          }
        },
        "x-required-scopes": [
          "treasury:write"
        ]
      }
    },
    "/api/v1/treasury/movements": {
      "post": {
        "operationId": "createApiTreasuryMovement",
        "summary": "create manual Treasury movement",
        "description": "Use native currency cents. USD outflows use carrying value. The path ID is treasury_adjustments.id or treasury_movement_id from lists, not the unified row id. Payments and transfers require their own tools. Registers are excluded.",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiManualTreasuryMovementRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Movement saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiManualTreasuryMovementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Not manual, changed version, or idempotency conflict"
          },
          "422": {
            "description": "Business requirement unmet"
          },
          "500": {
            "description": "Internal error"
          }
        },
        "x-required-scopes": [
          "treasury:write"
        ]
      },
      "get": {
        "summary": "Listar movimientos de tesorería",
        "description": "Lista movimientos funcionales en ARS respaldados por el diario para fuentes denominadas en ARS. Un importe positivo aumenta el saldo y uno negativo lo reduce; las fuentes USD no se publican todavía.",
        "operationId": "listApiTreasuryMovements",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "balance_type",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnum53162db3eb"
            }
          },
          {
            "name": "balance_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "movement_type",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumc1c44f3acf"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Movimientos de tesorería obtenidos exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTreasuryMovementListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope treasury:read faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope treasury:read faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "treasury:read"
        ]
      }
    },
    "/api/v1/funds-transfers": {
      "get": {
        "summary": "Listar transferencias de fondos",
        "description": "Lista transferencias ARS visibles en orden determinista por fecha de negocio, creación e ID. El filtro de saldo requiere balance_type y balance_id y coincide con cualquiera de las dos puntas.",
        "operationId": "listApiFundsTransfers",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "balance_type",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnum53162db3eb"
            }
          },
          {
            "name": "balance_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "description": "Fecha de negocio argentina inicial inclusiva",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "description": "Fecha de negocio argentina final inclusiva",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transferencias de fondos obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFundsTransferListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope treasury:read faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope treasury:read faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "treasury:read"
        ]
      },
      "post": {
        "summary": "Crear una transferencia de fondos",
        "description": "Mueve un importe entero en centavos entre dos saldos ARS visibles y devuelve el hecho confirmado con sus dos efectos contables. La operación es atómica, permite saldo negativo y exige Idempotency-Key.",
        "operationId": "createApiFundsTransfer",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiFundsTransferCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Transferencia creada o reproducida idempotentemente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFundsTransferDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud o Idempotency-Key inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud o Idempotency-Key inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope treasury:write faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope treasury:write faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Saldo inexistente, oculto o de otra organización",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Saldo inexistente, oculto o de otra organización",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o estado del saldo o cuenta vinculada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o estado del saldo o cuenta vinculada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Moneda no soportada, fecha futura o configuración contable faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Moneda no soportada, fecha futura o configuración contable faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Falla transitoria; el cliente puede reintentar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Falla transitoria; el cliente puede reintentar",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "treasury:write"
        ]
      }
    },
    "/api/v1/funds-transfers/{funds_transfer_id}": {
      "get": {
        "summary": "Obtener una transferencia de fondos",
        "description": "Devuelve una transferencia ARS visible y exactamente dos efectos contables firmados, ordenados origen y destino, vinculados a movimientos de tesorería.",
        "operationId": "getApiFundsTransfer",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "funds_transfer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transferencia de fondos obtenida exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiFundsTransferDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "ID o parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "ID o parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope treasury:read faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope treasury:read faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Transferencia no encontrada o no visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Transferencia no encontrada o no visible",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno o evidencia contable inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno o evidencia contable inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "treasury:read"
        ]
      }
    },
    "/api/v1/tax-rates": {
      "get": {
        "summary": "Listar alícuotas impositivas",
        "description": "Lista los códigos estatutarios de IVA aceptados por los campos públicos tax_rate_id. El code es el identificador legal estable; no es un UUID de recurso de la organización.",
        "operationId": "listApiTaxRates",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Alícuotas obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTaxRateReferenceListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope settings:read faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope settings:read faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "settings:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst taxRates = await lapyme.taxRates.list({ limit: 100 });\n"
          }
        ]
      }
    },
    "/api/v1/voucher-types": {
      "get": {
        "summary": "Listar tipos de comprobante válidos",
        "description": "Devuelve candidatos contextuales para una venta o compra. La selección usa la configuración fiscal canónica de la organización y vuelve a validarse al escribir. Para ventas con total_amount, currency es obligatorio; USD también requiere exchange_rate en ARS por USD.",
        "operationId": "listApiVoucherTypes",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "operation",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumed1129741e"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "description": "UUID obligatorio cuando operation=sale",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "point_of_sale_id",
            "in": "query",
            "description": "UUID obligatorio cuando operation=sale",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "supplier_id",
            "in": "query",
            "description": "UUID obligatorio cuando operation=purchase",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "total_amount",
            "in": "query",
            "description": "Total opcional de la venta en unidades menores de currency. Habilita la evaluación de FCE.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "currency",
            "in": "query",
            "description": "Obligatorio cuando se envía total_amount",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
            }
          },
          {
            "name": "exchange_rate",
            "in": "query",
            "description": "Pesos argentinos por dólar. Obligatorio solamente para currency=USD.",
            "required": false,
            "schema": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tipos de comprobante obtenidos exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiVoucherTypeReferenceListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Contexto inválido o incompleto",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Contexto inválido o incompleto",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope settings:read faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope settings:read faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Contraparte o punto de venta inexistente o inaccesible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Contraparte o punto de venta inexistente o inaccesible",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "settings:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst voucherTypes = await lapyme.voucherTypes.list({\n  operation: \"sale\",\n  customerId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n  pointOfSaleId: \"8b1743dc-59fd-4d56-93f0-4f10c70e4569\",\n  totalAmount: 500000000,\n  currency: \"ARS\",\n});\n"
          }
        ]
      }
    },
    "/api/v1/suppliers": {
      "get": {
        "summary": "Listar proveedores",
        "description": "Devuelve una lista de proveedores de la organización. Permite buscar por nombre, CUIT o email.",
        "operationId": "listApiSuppliers",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por nombre, CUIT o email",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "description": "Filtra por estado activo",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Estados exactos a incluir. Enviá ambos para incluir proveedores activos e inactivos.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiSharedEnumd952d5ce8e"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Proveedores obtenidos exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSupplierListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_suppliers_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for listing suppliers",
                        "retryable": false,
                        "details": [
                          {
                            "field": "limit",
                            "code": "too_big",
                            "message": "Too big: expected number to be <=100"
                          }
                        ],
                        "type": "invalid_request_error"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_suppliers_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_suppliers_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_suppliers_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list suppliers",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "suppliers:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst suppliers = await lapyme.suppliers.list({\n  limit: 20,\n  query: \"Textiles\",\n});\n"
          }
        ]
      },
      "post": {
        "summary": "Crear proveedor",
        "description": "Crea un proveedor para usarlo en compras, cuentas corrientes y reportes.",
        "operationId": "createApiSupplier",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiSupplierMutationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Proveedor creado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSupplierCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "suppliers:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst supplier = await lapyme.suppliers.createSupplier({\n  idempotencyKey: crypto.randomUUID(),\n  body: {\n    name: \"Textiles Norte\",\n    taxId: \"30700111222\",\n    email: \"ventas@textilesnorte.com.ar\",\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/suppliers/{supplier_id}": {
      "get": {
        "summary": "Obtener proveedor",
        "description": "Devuelve los datos de un proveedor por ID.",
        "operationId": "getApiSupplier",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "supplier_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Proveedor obtenido exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSupplierDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Proveedor no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Proveedor no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "suppliers:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst supplier = await lapyme.suppliers.getSupplier({\n  supplierId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n});\n"
          }
        ]
      },
      "put": {
        "summary": "Actualizar proveedor",
        "description": "Actualiza los datos comerciales, fiscales y de contacto de un proveedor. Si el proveedor también es cliente, cambiar el DNI o CUIT a uno que ya pertenece a otro cliente de la organización responde 409 CONFLICT.",
        "operationId": "updateApiSupplier",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "supplier_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiSupplierUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Proveedor actualizado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSupplierUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Proveedor no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Proveedor no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Documento de otro cliente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "CONFLICT",
                    "value": {
                      "request_id": "req_supplier_update_1",
                      "error": {
                        "code": "CONFLICT",
                        "message": "Ya existe un cliente con ese documento",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "suppliers:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst supplier = await lapyme.suppliers.updateSupplier({\n  supplierId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n  body: {\n    email: \"administracion@textilesnorte.com.ar\",\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/categories": {
      "get": {
        "summary": "Listar categorías",
        "description": "Devuelve las categorías de productos de la organización.",
        "operationId": "listApiCategories",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Categorías obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCategoryListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "categories:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst categories = await lapyme.categories.get({\n  limit: 20,\n  query: \"indumentaria\",\n});\n"
          }
        ]
      },
      "post": {
        "summary": "Crear categoría",
        "description": "Crea una categoría para organizar productos y asociar actividad económica predeterminada.",
        "operationId": "createApiCategory",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCategoryMutationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Categoría creada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCategoryCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "categories:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst category = await lapyme.categories.create({\n  idempotencyKey: crypto.randomUUID(),\n  body: {\n    name: \"Indumentaria\",\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/categories/{category_id}": {
      "get": {
        "summary": "Obtener categoría",
        "description": "Devuelve una categoría por ID.",
        "operationId": "getApiCategory",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "category_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Categoría obtenida exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCategoryDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Categoría no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Categoría no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "categories:read"
        ]
      },
      "put": {
        "summary": "Actualizar categoría",
        "description": "Actualiza el nombre, la categoría padre o la actividad económica de una categoría.",
        "operationId": "updateApiCategory",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "category_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCategoryMutationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Categoría actualizada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCategoryUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Categoría no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Categoría no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "categories:write"
        ]
      }
    },
    "/api/v1/products": {
      "get": {
        "summary": "Listar productos",
        "description": "Lista los productos de la organización con precios. Soporta búsqueda y filtros por categoría, tipo y estado.",
        "operationId": "listApiProducts",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por nombre, SKU, código de barras u opciones",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category_id",
            "in": "query",
            "description": "Filtra por categoría",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "description": "Filtra por estado activo",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "product_type",
            "in": "query",
            "description": "Filtra por tipo de producto",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumff49232140"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Productos obtenidos exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProductListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_products_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for listing products",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_products_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_products_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_products_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list products",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "products:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst products = await lapyme.products.list({\n  limit: 20,\n  query: \"remera\",\n  productType: \"product\",\n});\n"
          }
        ]
      },
      "post": {
        "summary": "Crear producto",
        "description": "Crea un producto simple, servicio o kit; un producto con hasta tres opciones y 250 variantes; o un combo con su composición completa y no vacía. La creación de un combo persiste producto, precio y componentes de forma atómica.",
        "operationId": "createApiProduct",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave única para evitar duplicados al reintentar la misma creación de producto.",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProductMutationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Producto creado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProductCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_product_create_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for creating products",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_product_create_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_product_create_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurso relacionado inexistente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_product_create_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Category not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de negocio o idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "CONFLICT",
                    "value": {
                      "request_id": "req_product_create_1",
                      "error": {
                        "code": "CONFLICT",
                        "message": "A product with this SKU already exists",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_product_create_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not process the product",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "products:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst product = await lapyme.products.create({\n  idempotencyKey: crypto.randomUUID(),\n  body: {\n    name: \"Remera basica\",\n    sku: \"REM-BASICA-M\",\n    productType: \"product\",\n    price: 1250000,\n    cost: 700000,\n    currency: \"ARS\",\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/products/bulk-adjustments": {
      "post": {
        "summary": "Actualizar productos masivamente",
        "description": "Aplica ajustes masivos de costo o precio base sobre una selección de productos.",
        "operationId": "createApiProductBulkAdjustment",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave única para evitar aplicar dos veces el mismo ajuste masivo.",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProductBulkAdjustmentRequest"
              },
              "examples": {
                "supplierCostIncrease": {
                  "summary": "Aumento de costos por proveedor",
                  "value": {
                    "target": "cost",
                    "operation_type": "increase",
                    "adjustment_type": "percentage",
                    "adjustment_value": 5,
                    "default_supplier_id": "550e8400-e29b-41d4-a716-446655440201",
                    "selection": {
                      "type": "all",
                      "excluded_ids": []
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ajuste aplicado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProductBulkAdjustmentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_product_bulk_adjust_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for bulk adjusting products",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_product_bulk_adjust_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_product_bulk_adjust_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "IDEMPOTENCY_CONFLICT",
                    "value": {
                      "request_id": "req_product_bulk_adjust_1",
                      "error": {
                        "code": "IDEMPOTENCY_CONFLICT",
                        "message": "The same Idempotency-Key was already used with a different bulk adjustment.",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_product_bulk_adjust_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not bulk adjust products",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "products:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst adjustment = await lapyme.productBulkAdjustments.create({\n  idempotencyKey: crypto.randomUUID(),\n  body: {\n    target: \"price\",\n    operationType: \"increase\",\n    adjustmentType: \"percentage\",\n    adjustmentValue: 10,\n    selection: {\n      type: \"specific\",\n      ids: [\"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\"],\n    },\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/products/metafield-definitions": {
      "get": {
        "summary": "Listar definiciones de campos personalizados de productos",
        "description": "Devuelve las definiciones no sistémicas disponibles para productos. Las definiciones select incluyen todos los valores configurados u observados, deduplicados y con su cantidad de productos. Los valores de texto libre no se enumeran. La disponibilidad depende de que los campos personalizados estén habilitados para la organización.",
        "operationId": "listApiProductMetafieldDefinitions",
        "tags": [
          "API"
        ],
        "responses": {
          "200": {
            "description": "Definiciones obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProductMetafieldDefinitionsResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_product_metafields_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "Authentication required",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o funcionalidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_product_metafields_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Los campos personalizados no están incluidos en tu contrato actual",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_product_metafields_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list product metafield definitions",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "products:read"
        ]
      }
    },
    "/api/v1/products/{product_id}": {
      "get": {
        "summary": "Obtener producto por ID",
        "description": "Devuelve el detalle persistido del producto.",
        "operationId": "getApiProductById",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "product_id",
            "in": "path",
            "description": "ID del producto",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Producto obtenido exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProductDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetro inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_product_detail_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for retrieving the product",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_product_detail_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_product_detail_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Producto no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_product_detail_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Product not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_product_detail_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not retrieve the product",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "products:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst product = await lapyme.products.getProductById({\n  productId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n});\n"
          }
        ]
      },
      "put": {
        "summary": "Actualizar producto",
        "description": "Actualiza un producto y devuelve el detalle persistido. La actualización de un combo requiere Idempotency-Key para deduplicar reintentos.",
        "operationId": "updateApiProduct",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "product_id",
            "in": "path",
            "description": "ID del producto",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable obligatoria cuando product_type es combo. Reutilizala solo para reintentar exactamente la misma actualización.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProductUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Producto actualizado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProductUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_product_update_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for updating products",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_product_update_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_product_update_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Producto o recurso relacionado inexistente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_product_update_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Product not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "CONFLICT",
                    "value": {
                      "request_id": "req_product_update_1",
                      "error": {
                        "code": "CONFLICT",
                        "message": "A product with this SKU already exists",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_product_update_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not update the product",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "products:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst product = await lapyme.products.update({\n  productId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n  body: {\n    price: 1390000,\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/products/{product_id}/metafields": {
      "patch": {
        "summary": "Actualizar campos personalizados de un producto",
        "description": "Actualiza solo las claves enviadas. Un string asigna el valor y null lo elimina. Los valores pertenecen al grupo y se comparten entre variantes. La disponibilidad depende de que los campos personalizados estén habilitados para la organización.",
        "operationId": "patchApiProductMetafields",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiProductMetafieldPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Campos actualizados exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProductUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud o valor inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_product_metafields_patch_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid product metafield request",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_product_metafields_patch_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "Authentication required",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o funcionalidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_product_metafields_patch_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Los campos personalizados no están incluidos en tu contrato actual",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Producto no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_product_metafields_patch_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Product not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_product_metafields_patch_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not update product metafields",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "products:write"
        ]
      }
    },
    "/api/v1/warehouses": {
      "get": {
        "summary": "Listar depósitos",
        "description": "Lista los depósitos activos de la organización.",
        "operationId": "listApiWarehouses",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por nombre",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ubicaciones obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiWarehouseListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_warehouses_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for listing warehouses",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_warehouses_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_warehouses_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_warehouses_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list warehouses",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "warehouses:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst warehouses = await lapyme.warehouses.list({\n  limit: 20,\n});\n"
          }
        ]
      },
      "post": {
        "summary": "Crear depósito",
        "description": "Crea un depósito para operar stock, puntos de venta y disponibilidad.",
        "operationId": "createApiWarehouse",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave única para evitar duplicados al reintentar la misma creación de depósito.",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiWarehouseMutationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Depósito creado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiWarehouseCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_warehouse_create_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for creating warehouses",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_warehouse_create_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_warehouse_create_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de negocio o idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "CONFLICT",
                    "value": {
                      "request_id": "req_warehouse_create_1",
                      "error": {
                        "code": "CONFLICT",
                        "message": "A warehouse with this name already exists",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_warehouse_create_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not process the warehouse",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "warehouses:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst warehouse = await lapyme.warehouses.create({\n  idempotencyKey: crypto.randomUUID(),\n  body: {\n    name: \"Deposito central\",\n    address: \"Av. Corrientes 1234\",\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/warehouses/{warehouse_id}": {
      "get": {
        "summary": "Obtener depósito por ID",
        "description": "Devuelve el detalle del depósito.",
        "operationId": "getApiWarehouseById",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "warehouse_id",
            "in": "path",
            "description": "ID del depósito",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Depósito obtenido exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiWarehouseDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetro inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_warehouse_detail_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for retrieving the warehouse",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_warehouse_detail_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_warehouse_detail_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Depósito no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_warehouse_detail_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Warehouse not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_warehouse_detail_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not retrieve the warehouse",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "warehouses:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst warehouse = await lapyme.warehouses.getWarehouseById({\n  warehouseId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n});\n"
          }
        ]
      },
      "put": {
        "summary": "Actualizar depósito",
        "description": "Actualiza un depósito y devuelve el detalle persistido.",
        "operationId": "updateApiWarehouse",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "warehouse_id",
            "in": "path",
            "description": "ID del depósito",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiWarehouseUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Depósito actualizado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiWarehouseUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_warehouse_update_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for updating warehouses",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_warehouse_update_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_warehouse_update_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Depósito no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_warehouse_update_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Warehouse not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "CONFLICT",
                    "value": {
                      "request_id": "req_warehouse_update_1",
                      "error": {
                        "code": "CONFLICT",
                        "message": "A warehouse with this name already exists",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_warehouse_update_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not update the warehouse",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "warehouses:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst warehouse = await lapyme.warehouses.updateWarehouse({\n  warehouseId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n  body: {\n    name: \"Deposito central\",\n    address: \"Av. Corrientes 1234\",\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/price-lists": {
      "get": {
        "summary": "Listar listas de precios",
        "description": "Lista las listas de precios de la organización.",
        "operationId": "listApiPriceLists",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por nombre",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Listas de precios obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPriceListListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_price_lists_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for listing price lists",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_price_lists_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_price_lists_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_price_lists_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list price lists",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "price_lists:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst priceLists = await lapyme.priceLists.get({\n  limit: 20,\n});\n"
          }
        ]
      },
      "post": {
        "summary": "Crear lista de precios",
        "description": "Crea una lista de precios para vender con reglas y valores comerciales diferenciados.",
        "operationId": "createApiPriceList",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave única para evitar duplicados al reintentar la misma creación de lista de precios.",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiPriceListMutationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lista de precios creada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPriceListCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_price_list_create_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for creating price lists",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_price_list_create_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_price_list_create_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de negocio o idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "CONFLICT",
                    "value": {
                      "request_id": "req_price_list_create_1",
                      "error": {
                        "code": "CONFLICT",
                        "message": "A price list with this name already exists",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_price_list_create_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not process the price list",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "price_lists:write"
        ]
      }
    },
    "/api/v1/price-lists/{price_list_id}": {
      "get": {
        "summary": "Obtener lista de precios por ID",
        "description": "Devuelve el detalle de la lista de precios.",
        "operationId": "getApiPriceListById",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "price_list_id",
            "in": "path",
            "description": "ID de la lista de precios",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de precios obtenida exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPriceListDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetro inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_price_list_detail_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for retrieving the price list",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_price_list_detail_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_price_list_detail_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Lista de precios no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_price_list_detail_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Price list not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_price_list_detail_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not retrieve the price list",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "price_lists:read"
        ]
      },
      "put": {
        "summary": "Actualizar lista de precios",
        "description": "Actualiza una lista de precios y devuelve el detalle persistido, incluyendo si se disparó la sincronización de precios.",
        "operationId": "updateApiPriceList",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "price_list_id",
            "in": "path",
            "description": "ID de la lista de precios",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiPriceListMutationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lista de precios actualizada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPriceListUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_price_list_update_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for updating price lists",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_price_list_update_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_price_list_update_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Lista de precios o recurso relacionado no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_price_list_update_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Price list not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "CONFLICT",
                    "value": {
                      "request_id": "req_price_list_update_1",
                      "error": {
                        "code": "CONFLICT",
                        "message": "A price list with this name already exists",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_price_list_update_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not update the price list",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "price_lists:write"
        ]
      },
      "delete": {
        "summary": "Eliminar lista de precios",
        "description": "Elimina una lista de precios existente.",
        "operationId": "deleteApiPriceList",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "price_list_id",
            "in": "path",
            "description": "ID de la lista de precios",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de precios eliminada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPriceListDeleteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetro inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_price_list_delete_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for deleting the price list",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_price_list_delete_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_price_list_delete_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Lista de precios no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_price_list_delete_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Price list not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "CONFLICT",
                    "value": {
                      "request_id": "req_price_list_delete_1",
                      "error": {
                        "code": "CONFLICT",
                        "message": "Could not delete the price list",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_price_list_delete_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not delete the price list",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "price_lists:write"
        ]
      }
    },
    "/api/v1/price-lists/{price_list_id}/prices": {
      "get": {
        "summary": "Listar precios resueltos de una lista",
        "description": "Devuelve el precio unitario base efectivo de cada variante vendible para una lista de precios. Se ordena por product_id ascendente. No incluye nombres, SKU, stock, costos ni precios transaccionales. Si PRICE_LIST_PRICES_CHANGED responde 409, reiniciá la paginación sin cursor.",
        "operationId": "listApiPriceListPrices",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "price_list_id",
            "in": "path",
            "description": "ID de la lista de precios",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor opaco de next_cursor recibido en la respuesta anterior. Está ligado a pricing_revision.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "description": "Filtra variantes activas o inactivas. Si se omite, incluye ambas.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "description": "ETag débil de una respuesta inicial equivalente. No se aplica a páginas con cursor.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Precios efectivos obtenidos exitosamente",
            "headers": {
              "ETag": {
                "description": "Validador débil de la revisión y representación solicitada.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPriceListPricesListResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Precio fijo y fallback de la lista",
                    "value": {
                      "request_id": "req_price_list_prices_1",
                      "object": "list",
                      "url": "/api/v1/price-lists/550e8400-e29b-41d4-a716-446655440601/prices",
                      "pricing_revision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "data": [
                        {
                          "object": "price_list_price",
                          "price_list_id": "550e8400-e29b-41d4-a716-446655440601",
                          "product_id": "550e8400-e29b-41d4-a716-446655440602",
                          "status": "priced",
                          "unit_price": 123400,
                          "currency": "ARS",
                          "tax_inclusive": false,
                          "tax_rate": {
                            "id": 5,
                            "value": 21
                          },
                          "is_exempt": false,
                          "calculation": {
                            "origin": "product_rule",
                            "type": "fixed_price",
                            "source_price_list_id": null
                          }
                        }
                      ],
                      "has_more": false,
                      "next_cursor": null
                    }
                  }
                }
              }
            }
          },
          "304": {
            "description": "La representación inicial no cambió. La respuesta no contiene cuerpo.",
            "headers": {
              "ETag": {
                "description": "Validador débil vigente.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope price_lists:read insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope price_lists:read insuficiente",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Lista de precios no encontrada o no visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Lista de precios no encontrada o no visible",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "PRICE_LIST_CONFIGURATION_INVALID para una configuración inválida o PRICE_LIST_PRICES_CHANGED cuando cambia la revisión durante la paginación",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "PRICE_LIST_PRICES_CHANGED",
                    "value": {
                      "request_id": "req_price_list_prices_1",
                      "error": {
                        "code": "PRICE_LIST_PRICES_CHANGED",
                        "message": "Price-list prices changed. Restart pagination from the first page.",
                        "retryable": true,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "price_lists:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst prices = await lapyme.priceListPrices.list({\n  priceListId: \"550e8400-e29b-41d4-a716-446655440601\",\n  limit: 50,\n  isActive: true,\n});\n"
          }
        ]
      }
    },
    "/api/v1/price-lists/{price_list_id}/prices/{product_id}": {
      "get": {
        "summary": "Obtener un precio resuelto de una lista",
        "description": "Devuelve el precio unitario base efectivo para la identidad compuesta price_list_id y product_id. El valor no es una cotización por cliente, cantidad, fecha o promoción.",
        "operationId": "getApiPriceListPrice",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "price_list_id",
            "in": "path",
            "description": "ID de la lista de precios",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "product_id",
            "in": "path",
            "description": "ID de la variante vendible",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "description": "ETag débil de una respuesta equivalente anterior.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Precio efectivo obtenido exitosamente",
            "headers": {
              "ETag": {
                "description": "Validador débil de la revisión y del producto solicitado.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPriceListPriceDetailResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Precio derivado de una lista fuente",
                    "value": {
                      "request_id": "req_price_list_price_1",
                      "pricing_revision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "data": {
                        "object": "price_list_price",
                        "price_list_id": "550e8400-e29b-41d4-a716-446655440601",
                        "product_id": "550e8400-e29b-41d4-a716-446655440602",
                        "status": "priced",
                        "unit_price": 129570,
                        "currency": "ARS",
                        "tax_inclusive": false,
                        "tax_rate": {
                          "id": 5,
                          "value": 21
                        },
                        "is_exempt": false,
                        "calculation": {
                          "origin": "list_policy",
                          "type": "base_adjustment",
                          "source_price_list_id": "550e8400-e29b-41d4-a716-446655440603"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "304": {
            "description": "La representación no cambió. La respuesta no contiene cuerpo.",
            "headers": {
              "ETag": {
                "description": "Validador débil vigente.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope price_lists:read insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope price_lists:read insuficiente",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Lista o producto no encontrado o no visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Lista o producto no encontrado o no visible",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "PRICE_LIST_CONFIGURATION_INVALID para una configuración inválida o PRICE_LIST_PRICES_CHANGED cuando cambia la revisión",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "PRICE_LIST_CONFIGURATION_INVALID para una configuración inválida o PRICE_LIST_PRICES_CHANGED cuando cambia la revisión",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "price_lists:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst price = await lapyme.priceListPrices.get({\n  priceListId: \"550e8400-e29b-41d4-a716-446655440601\",\n  productId: \"550e8400-e29b-41d4-a716-446655440602\",\n});\n"
          }
        ]
      }
    },
    "/api/v1/purchases": {
      "get": {
        "summary": "Listar compras",
        "description": "Lista las compras de la organización. Soporta filtros por fecha, importe y búsqueda de proveedor.",
        "operationId": "listApiPurchases",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por proveedor, CUIT o número de factura del proveedor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "description": "Fecha inicial para el filtro",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "description": "Fecha final para el filtro",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_attribute",
            "in": "query",
            "description": "Campo de fecha a usar para el filtro",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnume975a7c122"
            }
          },
          {
            "name": "amount_attribute",
            "in": "query",
            "description": "Campo monetario a usar para min/max",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "balance",
                "total"
              ],
              "default": "balance"
            }
          },
          {
            "name": "min_balance",
            "in": "query",
            "description": "Importe mínimo para el filtro",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "max_balance",
            "in": "query",
            "description": "Importe máximo para el filtro",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Compras obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPurchaseListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_purchase_list_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for listing purchases",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_purchase_list_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_purchase_list_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_purchase_list_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list purchases",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst purchases = await lapyme.purchases.listPurchases({\n  limit: 20,\n  dateFrom: new Date(\"2026-03-01\"),\n  dateTo: new Date(\"2026-03-31\"),\n});\n"
          }
        ]
      },
      "post": {
        "summary": "Crear compra",
        "description": "Registra una compra y devuelve la operación creada junto con sus efectos de stock y contabilidad.",
        "operationId": "createApiPurchase",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave única para evitar duplicados al reintentar la misma creación de compra.",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiPurchaseTransactionRequest"
              },
              "examples": {
                "purchase_without_receipt": {
                  "summary": "Purchase invoice without receiving stock",
                  "value": {
                    "supplier_id": "afafcbec-9d94-4174-8d5c-ec8d72780947",
                    "voucher_type": 1,
                    "supplier_invoice_number": "0001-00000001",
                    "invoice_date": "2026-03-10",
                    "currency": "ARS",
                    "exchange_rate": 1,
                    "products_received": false,
                    "update_product_variant_cost": true,
                    "items": [
                      {
                        "product_id": "9c692e8b-0f9a-4f7c-8b99-061a2eb188ae",
                        "quantity": 1,
                        "unit_cost": 8250,
                        "tax_rate_id": 5
                      }
                    ]
                  }
                },
                "service_expense_with_accounting_allocation": {
                  "summary": "Service expense with account and cost center",
                  "value": {
                    "supplier_id": "afafcbec-9d94-4174-8d5c-ec8d72780947",
                    "voucher_type": 1,
                    "supplier_invoice_number": "0001-00000003",
                    "invoice_date": "2026-03-10",
                    "currency": "ARS",
                    "products_received": false,
                    "items": [
                      {
                        "name": "Meta Ads",
                        "quantity": 1,
                        "unit_cost": 100000,
                        "tax_rate_id": 5,
                        "account_id": "550e8400-e29b-41d4-a716-446655440301",
                        "cost_center_1_id": "550e8400-e29b-41d4-a716-446655440401"
                      }
                    ]
                  }
                },
                "totals_only_with_manual_accounts": {
                  "summary": "Totals-only purchase with manual account allocation",
                  "value": {
                    "supplier_id": "afafcbec-9d94-4174-8d5c-ec8d72780947",
                    "voucher_type": 1,
                    "supplier_invoice_number": "0001-00000004",
                    "invoice_date": "2026-03-10",
                    "currency": "ARS",
                    "subtotal": 100000,
                    "tax_amount": 21000,
                    "total": 121000,
                    "iva_breakdown": [
                      {
                        "tax_rate_id": 5,
                        "base_amount": 100000,
                        "tax_amount": 21000
                      }
                    ],
                    "manual_account_allocations": {
                      "gravado21": "550e8400-e29b-41d4-a716-446655440301"
                    }
                  }
                },
                "purchase_with_receipt": {
                  "summary": "Purchase invoice receiving stock",
                  "value": {
                    "supplier_id": "afafcbec-9d94-4174-8d5c-ec8d72780947",
                    "voucher_type": 1,
                    "supplier_invoice_number": "0001-00000002",
                    "invoice_date": "2026-03-10",
                    "currency": "ARS",
                    "exchange_rate": 1,
                    "products_received": true,
                    "warehouse_id": "550e8400-e29b-41d4-a716-446655440010",
                    "update_product_variant_cost": true,
                    "items": [
                      {
                        "product_id": "9c692e8b-0f9a-4f7c-8b99-061a2eb188ae",
                        "quantity": 3,
                        "unit_cost": 8250,
                        "tax_rate_id": 5
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Compra creada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPurchaseTransactionSuccessResponse"
                },
                "examples": {
                  "created": {
                    "summary": "Compra creada",
                    "value": {
                      "request_id": "req_purchase_commit_1",
                      "data": {
                        "purchase_id": "cf19b3ae-4c08-48be-b9d7-e6f2f5baf609",
                        "receipt_created": false,
                        "idempotent_replay": false,
                        "normalized_purchase": {
                          "supplier_id": "afafcbec-9d94-4174-8d5c-ec8d72780947",
                          "voucher_type": 1,
                          "supplier_invoice_number": "0001-00000001",
                          "invoice_date": "2026-03-10",
                          "account_date": null,
                          "due_date": null,
                          "payment_term_id": null,
                          "payment_term_days": null,
                          "import_document_role": null,
                          "import_source_purchase_id": null,
                          "import_nationalization_status": null,
                          "customs_dispatch_number": null,
                          "warehouse_id": null,
                          "products_received": false,
                          "products_returned": false,
                          "inventory_effect": "none",
                          "update_product_variant_cost": true,
                          "currency": "ARS",
                          "exchange_rate": 1,
                          "subtotal": 8250,
                          "tax_amount": 1733,
                          "total": 9983,
                          "discount": 0,
                          "exempt_amount": 0,
                          "non_taxed_amount": null,
                          "base_amount": null,
                          "vat_perception_amount": null,
                          "national_tax_amount": null,
                          "gross_income_tax_amount": null,
                          "municipal_tax_amount": null,
                          "internal_tax_amount": null,
                          "other_tax_amount": null,
                          "notes": null,
                          "pdf_path": null,
                          "items": []
                        },
                        "projected_effects": {
                          "inventory": {
                            "will_receive_products": false,
                            "will_create_receipt": false,
                            "will_increase_direct_stock": false,
                            "will_return_products": false,
                            "will_decrease_direct_stock": false,
                            "inventory_effect": "none",
                            "warehouse_id": null,
                            "product_line_count": 1,
                            "total_quantity": 1,
                            "purchase_order_ids": []
                          },
                          "accounting": {
                            "will_create_journal_entry": true,
                            "currency": "ARS",
                            "exchange_rate": 1
                          }
                        }
                      },
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_purchase_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for creating purchases",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_purchase_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_purchase_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "IDEMPOTENCY_CONFLICT",
                    "value": {
                      "request_id": "req_purchase_1",
                      "error": {
                        "code": "IDEMPOTENCY_CONFLICT",
                        "message": "The same Idempotency-Key was already used with a different purchase.",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Business precondition not satisfied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "PRECONDITION_FAILED",
                    "value": {
                      "request_id": "req_purchase_1",
                      "error": {
                        "code": "PRECONDITION_FAILED",
                        "message": "The purchase could not be created because a business precondition failed.",
                        "retryable": false,
                        "details": [
                          {
                            "field": "input.items",
                            "code": "INVENTORY",
                            "message": "Stock insuficiente. Stock actual: -34, cambio solicitado: 1"
                          }
                        ],
                        "type": "invalid_request_error"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_purchase_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not process the purchase transaction",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:write"
        ]
      }
    },
    "/api/v1/webhook-event-types": {
      "get": {
        "summary": "Listar tipos de evento de webhook",
        "description": "Lista eventos suscribibles con el recurso, scopes de lectura y versiones de payload requeridos.",
        "operationId": "listApiWebhookEventTypes",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tipos de evento listados",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiWebhookEventTypeListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope webhooks:read faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope webhooks:read faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "webhooks:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst eventTypes = await lapyme.webhookEventTypes.list({ limit: 100 });\n"
          }
        ]
      }
    },
    "/api/v1/webhook-endpoints": {
      "get": {
        "summary": "Listar endpoints de webhook",
        "description": "Lista endpoints visibles para la credencial. Por defecto incluye activos y pausados, no deshabilitados.",
        "operationId": "listApiWebhookEndpoints",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnum1c9cda998e"
            }
          },
          {
            "name": "owner_type",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnum4b017f6476"
            }
          },
          {
            "name": "event_type",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnum09382f5041"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Endpoints listados",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiWebhookEndpointListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope webhooks:read faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope webhooks:read faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "webhooks:read"
        ]
      },
      "post": {
        "summary": "Crear endpoint de webhook",
        "description": "Crea un endpoint activo y devuelve su signing_secret una sola vez. Requiere los scopes de lectura de todos los eventos habilitados.",
        "operationId": "createApiWebhookEndpoint",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiWebhookEndpointCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Endpoint creado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiWebhookEndpointSecretResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "webhooks:write"
        ],
        "x-dynamic-scope-requirement": {
          "source": "body",
          "field": "enabled_events",
          "resolver": "webhook_event_catalog"
        },
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst endpoint = await lapyme.webhookEndpoints.create({\n  idempotencyKey: crypto.randomUUID(),\n  body: {\n    label: \"Tienda principal\",\n    url: \"https://integracion.example.com/lapyme/webhooks\",\n    enabledEvents: [\"order.created\", \"order.updated\"],\n    apiVersion: \"2026-06-29\",\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/webhook-endpoints/{webhook_endpoint_id}": {
      "get": {
        "summary": "Obtener endpoint de webhook",
        "description": "Devuelve un endpoint visible sin material secreto ni IDs internos de grants.",
        "operationId": "getApiWebhookEndpoint",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "webhook_endpoint_id",
            "in": "path",
            "description": "ID del endpoint de webhook",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Endpoint obtenido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiWebhookEndpointResponse"
                }
              }
            }
          },
          "400": {
            "description": "ID inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "ID inválido",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope webhooks:read faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope webhooks:read faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Endpoint no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Endpoint no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "webhooks:read"
        ]
      },
      "patch": {
        "summary": "Actualizar endpoint de webhook",
        "description": "Actualiza label, URL, eventos o versión. El status es de solo lectura y se cambia mediante acciones nombradas.",
        "operationId": "updateApiWebhookEndpoint",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "webhook_endpoint_id",
            "in": "path",
            "description": "ID del endpoint de webhook",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiWebhookEndpointUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Endpoint actualizado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiWebhookEndpointResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Endpoint no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Endpoint no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de estado o idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de estado o idempotencia",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "webhooks:write"
        ],
        "x-dynamic-scope-requirement": {
          "source": "persisted_resource",
          "field": "resulting_enabled_events",
          "resolver": "webhook_event_catalog"
        }
      }
    },
    "/api/v1/webhook-endpoints/{webhook_endpoint_id}/pause": {
      "post": {
        "summary": "Pausar endpoint de webhook",
        "description": "Pausa un endpoint activo sin descartar sus entregas en cola.",
        "operationId": "pauseApiWebhookEndpoint",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "webhook_endpoint_id",
            "in": "path",
            "description": "ID del endpoint de webhook",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operación de webhook aceptada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiWebhookEndpointResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Endpoint no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Endpoint no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de estado o idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de estado o idempotencia",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "webhooks:write"
        ]
      }
    },
    "/api/v1/webhook-endpoints/{webhook_endpoint_id}/resume": {
      "post": {
        "summary": "Reanudar endpoint de webhook",
        "description": "Reanuda un endpoint pausado después de revalidar los scopes de sus eventos persistidos.",
        "operationId": "resumeApiWebhookEndpoint",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "webhook_endpoint_id",
            "in": "path",
            "description": "ID del endpoint de webhook",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operación de webhook aceptada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiWebhookEndpointResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Endpoint no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Endpoint no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de estado o idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de estado o idempotencia",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "webhooks:write"
        ],
        "x-dynamic-scope-requirement": {
          "source": "persisted_resource",
          "field": "enabled_events",
          "resolver": "webhook_event_catalog"
        }
      }
    },
    "/api/v1/webhook-endpoints/{webhook_endpoint_id}/disable": {
      "post": {
        "summary": "Deshabilitar endpoint de webhook",
        "description": "Deshabilita permanentemente el endpoint y cancela entregas pendientes o reintentables.",
        "operationId": "disableApiWebhookEndpoint",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "webhook_endpoint_id",
            "in": "path",
            "description": "ID del endpoint de webhook",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operación de webhook aceptada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiWebhookEndpointResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Endpoint no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Endpoint no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de estado o idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de estado o idempotencia",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "webhooks:write"
        ]
      }
    },
    "/api/v1/webhook-endpoints/{webhook_endpoint_id}/rotate-secret": {
      "post": {
        "summary": "Rotar secreto de webhook",
        "description": "Reemplaza el secreto inmediatamente y devuelve el nuevo signing_secret una sola vez.",
        "operationId": "rotateSecretApiWebhookEndpoint",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "webhook_endpoint_id",
            "in": "path",
            "description": "ID del endpoint de webhook",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operación de webhook aceptada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiWebhookEndpointSecretResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Endpoint no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Endpoint no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de estado o idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de estado o idempotencia",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "webhooks:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst endpoint = await lapyme.webhookEndpoints.rotateSecret({\n  webhookEndpointId,\n  idempotencyKey: crypto.randomUUID(),\n});\n"
          }
        ]
      }
    },
    "/api/v1/webhook-endpoints/{webhook_endpoint_id}/test": {
      "post": {
        "summary": "Probar endpoint de webhook",
        "description": "Crea una entrega durable y sintética webhook.test para un endpoint activo o pausado.",
        "operationId": "testApiWebhookEndpoint",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "webhook_endpoint_id",
            "in": "path",
            "description": "ID del endpoint de webhook",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Operación de webhook aceptada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiWebhookTestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Endpoint no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Endpoint no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de estado o idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de estado o idempotencia",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "webhooks:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst test = await lapyme.webhookEndpoints.test({\n  webhookEndpointId,\n  idempotencyKey: crypto.randomUUID(),\n});\n"
          }
        ]
      }
    },
    "/api/v1/quotes": {
      "get": {
        "summary": "Listar presupuestos",
        "description": "Lista presupuestos de la organización en orden estable por creación e ID descendentes. Permite búsqueda y filtros por cliente y estado.",
        "operationId": "listApiQuotes",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Busca por cliente o número de presupuesto",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "description": "Filtra por cliente",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filtra por estado del presupuesto",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumfbc137f7cc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Presupuestos listados exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiQuoteListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope quotes:read faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope quotes:read faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quotes:read"
        ]
      },
      "post": {
        "summary": "Crear presupuesto",
        "description": "Crea un presupuesto en borrador. Si se omite currency, usa pesos argentinos (ARS). Todos los precios, descuentos por importe e importes están en centavos de la moneda elegida. USD requiere que la organización lo tenga habilitado. pricing_ars_per_usd_rate documenta una conversión explícita de precios; no determina el tipo de cambio fiscal de una factura. La API asigna el número, calcula importes y administra la reserva opcional. Requiere Idempotency-Key.",
        "operationId": "createApiQuote",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiQuoteRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Presupuesto creado o reproducido idempotentemente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiQuoteWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud o Idempotency-Key inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud o Idempotency-Key inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope quotes:write faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope quotes:write faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Presupuesto o referencia no encontrados",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Presupuesto o referencia no encontrados",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o presupuesto fuera de estado borrador",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o presupuesto fuera de estado borrador",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "No se pudo reservar stock por una condición de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "No se pudo reservar stock por una condición de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quotes:write"
        ]
      }
    },
    "/api/v1/quotes/{quote_id}": {
      "get": {
        "summary": "Obtener presupuesto por ID",
        "description": "Devuelve el presupuesto con sus líneas, importes persistidos, reserva activa y estado de ciclo de vida.",
        "operationId": "getApiQuoteById",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "quote_id",
            "in": "path",
            "description": "ID del presupuesto",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Presupuesto obtenido exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiQuoteDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "ID inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "ID inválido",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope quotes:read faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope quotes:read faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Presupuesto no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Presupuesto no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quotes:read"
        ]
      },
      "put": {
        "summary": "Reemplazar presupuesto en borrador",
        "description": "Reemplaza los datos mutables de un presupuesto en borrador. Si se omite currency, conserva la moneda guardada. Un cambio de moneda requiere currency_change_mode: keep o convert; convert requiere pricing_ars_per_usd_rate en ARS por USD. Los importes enviados están en centavos de la moneda elegida y nunca se convierten automáticamente. Recalcula importes y ajusta la reserva en una transacción. Requiere Idempotency-Key.",
        "operationId": "updateApiQuote",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "quote_id",
            "in": "path",
            "description": "ID del presupuesto",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiQuoteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Presupuesto actualizado o reproducido idempotentemente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiQuoteWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud o Idempotency-Key inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud o Idempotency-Key inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope quotes:write faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope quotes:write faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Presupuesto o referencia no encontrados",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Presupuesto o referencia no encontrados",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o presupuesto fuera de estado borrador",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o presupuesto fuera de estado borrador",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "No se pudo reservar stock por una condición de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "No se pudo reservar stock por una condición de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quotes:write"
        ]
      },
      "delete": {
        "summary": "Eliminar presupuesto en borrador",
        "description": "Elimina un presupuesto solo si está en borrador y libera su reserva activa en la misma transacción. Requiere Idempotency-Key.",
        "operationId": "deleteApiQuote",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "quote_id",
            "in": "path",
            "description": "ID del presupuesto",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Presupuesto eliminado o reproducción idempotente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiQuoteDeleteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud o Idempotency-Key inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud o Idempotency-Key inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope quotes:write faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope quotes:write faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Presupuesto o referencia no encontrados",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Presupuesto o referencia no encontrados",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o presupuesto fuera de estado borrador",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o presupuesto fuera de estado borrador",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "No se pudo reservar stock por una condición de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "No se pudo reservar stock por una condición de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quotes:write"
        ]
      }
    },
    "/api/v1/delivery-notes": {
      "get": {
        "summary": "Listar remitos",
        "description": "Lista los remitos de la organización autenticada con paginación estable por cursor y filtros opcionales por venta, cliente, búsqueda y fecha.",
        "operationId": "listApiDeliveryNotes",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "sale_id",
            "in": "query",
            "description": "Filtra remitos originados en una venta",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "description": "Filtra por cliente",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Busca por cliente o número de remito",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "description": "Fecha inicial del remito (inclusive)",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "description": "Fecha final del remito (inclusive)",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Remitos listados exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiDeliveryNoteListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Credencial de API faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Credencial de API faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes o acceso a la ubicación no autorizado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes o acceso a la ubicación no autorizado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:read"
          ]
        ]
      },
      "post": {
        "summary": "Crear remito",
        "description": "Crea un remito a partir de una venta existente de la organización o de datos independientes. Si el origen es una venta, toma de ella el cliente, punto de venta, artículos, cantidades, productos y depósitos. La creación es independiente de la facturación y mantiene la regla de un solo remito por venta.",
        "operationId": "createApiDeliveryNote",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiDeliveryNoteCreateRequest"
              },
              "examples": {
                "sale": {
                  "summary": "Crear remito desde una venta existente",
                  "value": {
                    "origin": {
                      "type": "sale",
                      "sale_id": "550e8400-e29b-41d4-a716-446655440100"
                    },
                    "date": "2026-08-30",
                    "notes": "2 pallets; peso verificado: 850 kg",
                    "carrier": "Transporte Norte",
                    "delivery_address": "Ruta 9 km 12",
                    "recipient_name": "Juan Pérez",
                    "recipient_document": "30123456"
                  }
                },
                "custom": {
                  "summary": "Crear remito independiente",
                  "value": {
                    "origin": {
                      "type": "custom"
                    },
                    "customer_id": "550e8400-e29b-41d4-a716-446655440101",
                    "point_of_sale_id": "550e8400-e29b-41d4-a716-446655440102",
                    "items": [
                      {
                        "product_id": "550e8400-e29b-41d4-a716-446655440103",
                        "warehouse_id": "550e8400-e29b-41d4-a716-446655440104",
                        "quantity": 2
                      },
                      {
                        "is_custom": true,
                        "name": "Bulto adicional",
                        "quantity": 1
                      }
                    ],
                    "notes": "Entregar por muelle 3"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reproducción idempotente del remito existente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiDeliveryNoteWriteResponse"
                }
              }
            }
          },
          "201": {
            "description": "Remito creado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiDeliveryNoteWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida o Idempotency-Key faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida o Idempotency-Key faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Credencial de API faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Credencial de API faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes o acceso a la ubicación no autorizado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes o acceso a la ubicación no autorizado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Venta o referencia del remito independiente no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Venta o referencia del remito independiente no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de estado o idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "IDEMPOTENCY_CONFLICT",
                    "value": {
                      "request_id": "req_delivery_note_1",
                      "error": {
                        "type": "idempotency_error",
                        "code": "IDEMPOTENCY_CONFLICT",
                        "message": "La Idempotency-Key ya se usó con una solicitud de remito diferente.",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:write"
          ]
        ]
      }
    },
    "/api/v1/delivery-notes/{delivery_note_id}": {
      "get": {
        "summary": "Obtener remito por ID",
        "description": "Devuelve el detalle completo de un remito de la organización. Los borradores incluyen eligible_talonarios para seleccionar el papel antes de emitir; los documentos emitidos conservan el cliente, artículos, fecha, notas y emisor de la emisión.",
        "operationId": "getApiDeliveryNoteById",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "delivery_note_id",
            "in": "path",
            "description": "ID del remito",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Remito obtenido exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiDeliveryNoteDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "ID del remito inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "ID del remito inválido",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Credencial de API faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Credencial de API faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes o acceso a la ubicación no autorizado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes o acceso a la ubicación no autorizado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Remito no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Remito no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:read"
          ]
        ]
      }
    },
    "/api/v1/delivery-notes/{delivery_note_id}/issue": {
      "post": {
        "summary": "Emitir remito",
        "description": "El CAI y el papel se administran en Comprobantes. Requiere sales:write; un remito de preparación también requiere orders:write. La emisión fija el documento y usa una sola hoja. La anulación conserva el número y no modifica el stock.",
        "operationId": "issueApiDeliveryNote",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "delivery_note_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiDeliveryNoteIssueRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remito actualizado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiDeliveryNoteDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Datos o Idempotency-Key inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Datos o Idempotency-Key inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Credencial inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Credencial inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Sin acceso al remito",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Sin acceso al remito",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Remito o talonario no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Remito o talonario no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "El borrador, la hoja o la solicitud cambió",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "El borrador, la hoja o la solicitud cambió",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "CAI, fecha o capacidad del papel no válidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "CAI, fecha o capacidad del papel no válidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "sales:write"
        ]
      }
    },
    "/api/v1/delivery-notes/{delivery_note_id}/void": {
      "post": {
        "summary": "Anular remito",
        "description": "El CAI y el papel se administran en Comprobantes. Requiere sales:write; un remito de preparación también requiere orders:write. La emisión fija el documento y usa una sola hoja. La anulación conserva el número y no modifica el stock.",
        "operationId": "voidApiDeliveryNote",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "delivery_note_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiDeliveryNoteVoidRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remito actualizado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiDeliveryNoteDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Datos o Idempotency-Key inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Datos o Idempotency-Key inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Credencial inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Credencial inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Sin acceso al remito",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Sin acceso al remito",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Remito o talonario no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Remito o talonario no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "El borrador, la hoja o la solicitud cambió",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "El borrador, la hoja o la solicitud cambió",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "CAI, fecha o capacidad del papel no válidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "CAI, fecha o capacidad del papel no válidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "sales:write"
        ]
      }
    },
    "/api/v1/remitos": {
      "get": {
        "summary": "Listar remitos (ruta anterior)",
        "description": "Ruta de compatibilidad deprecada. Lista remitos de la organización. Migrá a GET /api/v1/delivery-notes.",
        "operationId": "listApiRemitos",
        "tags": [
          "API"
        ],
        "deprecated": true,
        "x-excluded": true,
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "sale_id",
            "in": "query",
            "description": "Filtra remitos originados en una venta",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "description": "Filtra por cliente",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Busca por cliente o número de remito",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "description": "Fecha inicial del remito",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "description": "Fecha final del remito",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Remitos listados exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiRemitoListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parametros invalidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parametros invalidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o invalida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o invalida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:read"
          ]
        ]
      }
    },
    "/api/v1/remitos/{remito_id}": {
      "get": {
        "summary": "Obtener remito por ID (ruta anterior)",
        "description": "Ruta de compatibilidad deprecada. Devuelve el detalle de un remito. Migrá a GET /api/v1/delivery-notes/{delivery_note_id}.",
        "operationId": "getApiRemitoById",
        "tags": [
          "API"
        ],
        "deprecated": true,
        "x-excluded": true,
        "parameters": [
          {
            "name": "remito_id",
            "in": "path",
            "description": "ID del remito",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Remito obtenido exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiRemitoDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parametros invalidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parametros invalidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o invalida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o invalida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Remito no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Remito no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:read"
          ]
        ]
      }
    },
    "/api/v1/sales": {
      "get": {
        "summary": "Listar ventas",
        "description": "Lista las ventas de la organización. Soporta filtros por cliente, fecha, estado, punto de venta, vendedor e integración.",
        "operationId": "listApiSales",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated top-level sale sections to include. Omit for the list default: id, document, customer, amounts, reversesVoucher, integration, audit, tags.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "id",
                  "invoicePdf",
                  "document",
                  "customer",
                  "amounts",
                  "items",
                  "payments",
                  "applications",
                  "fiscal",
                  "integration",
                  "reversesVoucher",
                  "audit",
                  "tags"
                ]
              }
            },
            "style": "form",
            "explode": false
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por cliente, CUIT, número de comprobante, ID de integración, producto, SKU, código de barras o variante",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "description": "Filtra por cliente",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "description": "Fecha inicial",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "description": "Fecha final",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_attribute",
            "in": "query",
            "description": "Campo de fecha a usar para el filtro",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnume975a7c122"
            }
          },
          {
            "name": "integration_sources",
            "in": "query",
            "description": "Fuentes de integración. Puede repetirse o enviarse separada por comas.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "point_of_sale_ids",
            "in": "query",
            "description": "IDs de puntos de venta. Puede repetirse o enviarse separada por comas.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "register_ids",
            "in": "query",
            "description": "IDs de cajas. Puede repetirse o enviarse separada por comas.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "seller_ids",
            "in": "query",
            "description": "IDs de vendedores. Puede repetirse o enviarse separada por comas.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "invoice_statuses",
            "in": "query",
            "description": "Estados fiscales. Puede repetirse o enviarse separada por comas.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiSharedEnum9ac70a3316"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "payment_statuses",
            "in": "query",
            "description": "Estados de cobranza. Puede repetirse o enviarse separada por comas.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "paid",
                  "owed"
                ]
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "voucher_types",
            "in": "query",
            "description": "Tipos de comprobante. Puede repetirse o enviarse separada por comas.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "amount_attribute",
            "in": "query",
            "description": "Campo monetario a usar para min/max",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "total",
                "balance"
              ],
              "default": "balance"
            }
          },
          {
            "name": "min_amount",
            "in": "query",
            "description": "Importe mínimo en centavos",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "max_amount",
            "in": "query",
            "description": "Importe máximo en centavos",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ventas obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSaleListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_sales_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for listing sales",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_sales_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_sales_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_sales_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list sales",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "sales:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst sales = await lapyme.sales.list({\n  limit: 20,\n  dateFrom: new Date(\"2026-03-01\"),\n  dateTo: new Date(\"2026-03-31\"),\n});\n"
          }
        ]
      },
      "post": {
        "summary": "Crear venta",
        "description": "Registra una venta y devuelve sus efectos fiscales, de stock, pagos y contabilidad. Enviá Lapyme-Version: 2026-08-20 para usar el contrato estricto: total es obligatorio, unit_price es neto para comprobantes A y final para comprobantes a consumidor final, y los importes derivados se calculan una sola vez. Omitir el header conserva los campos históricos, total opcional y la configuración de precios con IVA de la organización, de forma deprecada. Ambos contratos calculan el IVA una sola vez. Idempotency-Key solo protege reintentos; si necesitás guardar una referencia externa visible, enviá integration_source e integration_id en el cuerpo.",
        "operationId": "createApiSale",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Lapyme-Version",
            "in": "header",
            "description": "Versión fechada del contrato de creación de ventas. Usá 2026-08-20 en integraciones nuevas. Omitirla conserva el contrato de entrada histórico deprecado; ambos contratos calculan el IVA una sola vez.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumf007ccd7a1"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave única para evitar duplicados al reintentar la misma creación de venta.",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiSaleTransactionRequest"
              },
              "examples": {
                "product_invoice_a_net_price": {
                  "summary": "Producto con comprobante A e importe neto",
                  "value": {
                    "customer_id": "550e8400-e29b-41d4-a716-446655440101",
                    "voucher_type": 1,
                    "point_of_sale_id": "550e8400-e29b-41d4-a716-446655440002",
                    "invoice_date": "2026-08-21",
                    "currency": "ARS",
                    "items": [
                      {
                        "product_id": "9c692e8b-0f9a-4f7c-8b99-061a2eb188ae",
                        "warehouse_id": "550e8400-e29b-41d4-a716-446655440010",
                        "quantity": 1,
                        "unit_price": 10000,
                        "tax_rate_id": 5
                      }
                    ],
                    "total": 12100
                  }
                },
                "custom_invoice_a_net_price": {
                  "summary": "Renglón libre con comprobante A e importe neto",
                  "value": {
                    "customer_id": "550e8400-e29b-41d4-a716-446655440101",
                    "voucher_type": 1,
                    "point_of_sale_id": "550e8400-e29b-41d4-a716-446655440002",
                    "invoice_date": "2026-08-21",
                    "currency": "ARS",
                    "items": [
                      {
                        "name": "Servicio técnico",
                        "product_type": "service",
                        "quantity": 1,
                        "unit_price": 10000,
                        "tax_rate_id": 5
                      }
                    ],
                    "total": 12100
                  }
                },
                "product_invoice_b_final_price": {
                  "summary": "Producto con comprobante B e importe final",
                  "value": {
                    "voucher_type": 6,
                    "point_of_sale_id": "550e8400-e29b-41d4-a716-446655440002",
                    "invoice_date": "2026-08-21",
                    "currency": "ARS",
                    "items": [
                      {
                        "product_id": "9c692e8b-0f9a-4f7c-8b99-061a2eb188ae",
                        "warehouse_id": "550e8400-e29b-41d4-a716-446655440010",
                        "quantity": 1,
                        "unit_price": 12100,
                        "tax_rate_id": 5
                      }
                    ],
                    "total": 12100
                  }
                },
                "total_mismatch": {
                  "summary": "Total declarado que no coincide",
                  "value": {
                    "customer_id": "550e8400-e29b-41d4-a716-446655440101",
                    "voucher_type": 1,
                    "point_of_sale_id": "550e8400-e29b-41d4-a716-446655440002",
                    "invoice_date": "2026-08-21",
                    "currency": "ARS",
                    "items": [
                      {
                        "name": "Servicio técnico",
                        "product_type": "service",
                        "quantity": 1,
                        "unit_price": 10000,
                        "tax_rate_id": 5
                      }
                    ],
                    "total": 10000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Venta creada exitosamente",
            "headers": {
              "Lapyme-Version": {
                "description": "Contrato fechado aplicado a la creación. Se devuelve cuando la solicitud envía una versión soportada.",
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedEnumf007ccd7a1"
                }
              },
              "Deprecation": {
                "description": "Fecha de deprecación del contrato histórico. Se devuelve cuando la solicitud omite Lapyme-Version.",
                "schema": {
                  "type": "string",
                  "example": "@1787184000"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSaleTransactionSuccessResponse"
                },
                "examples": {
                  "created": {
                    "summary": "Venta creada",
                    "value": {
                      "request_id": "req_sale_commit_1",
                      "data": {
                        "sale": {
                          "sale_id": "cf19b3ae-4c08-48be-b9d7-e6f2f5baf609",
                          "customer_id": null,
                          "voucher_type": "90",
                          "point_of_sale_id": "550e8400-e29b-41d4-a716-446655440002",
                          "invoice_number": 84,
                          "formatted_invoice_number": "PRES-00001-00000084",
                          "invoice_status": "not_required",
                          "invoice_date": "2026-04-18",
                          "due_date": "2026-04-18",
                          "currency": "ARS",
                          "subtotal": 8264,
                          "tax_amount": 1736,
                          "total": 10000,
                          "exempt_amount": 0,
                          "non_taxed_amount": 0,
                          "tributes_amount": 0,
                          "discount_amount": 0,
                          "balance": 10000,
                          "created_at": "2026-04-18T12:00:00.000Z"
                        },
                        "normalized_sale": {
                          "customer_id": null,
                          "customer_tax_category_override": null,
                          "voucher_type": 90,
                          "point_of_sale_id": "550e8400-e29b-41d4-a716-446655440002",
                          "register_id": null,
                          "operator_id": null,
                          "invoice_date": "2026-04-18",
                          "due_date": "2026-04-18",
                          "service_from": null,
                          "service_to": null,
                          "currency": "ARS",
                          "exchange_rate": null,
                          "same_currency_payment": false,
                          "notes": null,
                          "subtotal": 8264,
                          "tax_amount": 1736,
                          "total": 10000,
                          "exempt_amount": 0,
                          "non_taxed_amount": 0,
                          "tributes_amount": 0,
                          "national_perception_amount": 0,
                          "gross_income_perception_amount": 0,
                          "gross_income_tax_breakdown": [],
                          "municipal_perception_amount": 0,
                          "internal_tribute_amount": 0,
                          "uncategorized_vat_perception_amount": 0,
                          "other_tribute_amount": 0,
                          "discount_type": null,
                          "discount_value": null,
                          "discount_amount": 0,
                          "balance": 10000,
                          "is_full_amount_pending": false,
                          "items": [
                            {
                              "product_id": null,
                              "product_name": null,
                              "sku": null,
                              "warehouse_id": null,
                              "name": "Technical service",
                              "product_type": "service",
                              "quantity": 1,
                              "unit_price": 10000,
                              "unit_cost": null,
                              "tax_rate_id": 5,
                              "is_exempt": false,
                              "discount": null,
                              "notes": null,
                              "account_id": null,
                              "cost_center1_id": null,
                              "cost_center2_id": null,
                              "cost_center3_id": null
                            }
                          ],
                          "payment_methods": []
                        },
                        "projected_effects": {
                          "inventory": {
                            "will_affect_stock": false,
                            "warehouse_ids": [],
                            "product_line_count": 0,
                            "total_quantity": 0
                          },
                          "accounting": {
                            "will_create_sale_entry": true,
                            "will_create_payment_entry": false
                          },
                          "fiscal": {
                            "invoice_status": "not_required"
                          },
                          "payments": {
                            "will_create_payments": false,
                            "payment_method_count": 0,
                            "total_amount": 0,
                            "pending_amount": 10000
                          }
                        },
                        "idempotent_replay": false
                      },
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "headers": {
              "Lapyme-Version": {
                "description": "Contrato fechado aplicado a la creación. Se devuelve cuando la solicitud envía una versión soportada.",
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedEnumf007ccd7a1"
                }
              },
              "Deprecation": {
                "description": "Fecha de deprecación del contrato histórico. Se devuelve cuando la solicitud omite Lapyme-Version.",
                "schema": {
                  "type": "string",
                  "example": "@1787184000"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_sale_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for creating sales",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "headers": {
              "Lapyme-Version": {
                "description": "Contrato fechado aplicado a la creación. Se devuelve cuando la solicitud envía una versión soportada.",
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedEnumf007ccd7a1"
                }
              },
              "Deprecation": {
                "description": "Fecha de deprecación del contrato histórico. Se devuelve cuando la solicitud omite Lapyme-Version.",
                "schema": {
                  "type": "string",
                  "example": "@1787184000"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_sale_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "headers": {
              "Lapyme-Version": {
                "description": "Contrato fechado aplicado a la creación. Se devuelve cuando la solicitud envía una versión soportada.",
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedEnumf007ccd7a1"
                }
              },
              "Deprecation": {
                "description": "Fecha de deprecación del contrato histórico. Se devuelve cuando la solicitud omite Lapyme-Version.",
                "schema": {
                  "type": "string",
                  "example": "@1787184000"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_sale_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia",
            "headers": {
              "Lapyme-Version": {
                "description": "Contrato fechado aplicado a la creación. Se devuelve cuando la solicitud envía una versión soportada.",
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedEnumf007ccd7a1"
                }
              },
              "Deprecation": {
                "description": "Fecha de deprecación del contrato histórico. Se devuelve cuando la solicitud omite Lapyme-Version.",
                "schema": {
                  "type": "string",
                  "example": "@1787184000"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "IDEMPOTENCY_CONFLICT",
                    "value": {
                      "request_id": "req_sale_1",
                      "error": {
                        "code": "IDEMPOTENCY_CONFLICT",
                        "message": "The same Idempotency-Key was already used with a different sale.",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Business precondition not satisfied",
            "headers": {
              "Lapyme-Version": {
                "description": "Contrato fechado aplicado a la creación. Se devuelve cuando la solicitud envía una versión soportada.",
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedEnumf007ccd7a1"
                }
              },
              "Deprecation": {
                "description": "Fecha de deprecación del contrato histórico. Se devuelve cuando la solicitud omite Lapyme-Version.",
                "schema": {
                  "type": "string",
                  "example": "@1787184000"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "PRECONDITION_FAILED",
                    "value": {
                      "request_id": "req_sale_1",
                      "error": {
                        "code": "PRECONDITION_FAILED",
                        "message": "The sale could not be created because a business precondition failed.",
                        "retryable": false,
                        "details": [
                          {
                            "field": "input.payment_methods",
                            "code": "VALIDATION",
                            "message": "You cannot send payment_methods when is_full_amount_pending=true"
                          }
                        ],
                        "type": "invalid_request_error"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "El total declarado no coincide con el total calculado por La Pyme",
            "headers": {
              "Lapyme-Version": {
                "description": "Contrato fechado aplicado a la creación. Se devuelve cuando la solicitud envía una versión soportada.",
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedEnumf007ccd7a1"
                }
              },
              "Deprecation": {
                "description": "Fecha de deprecación del contrato histórico. Se devuelve cuando la solicitud omite Lapyme-Version.",
                "schema": {
                  "type": "string",
                  "example": "@1787184000"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "BUSINESS_REQUIREMENT_UNMET",
                    "value": {
                      "request_id": "req_sale_total_mismatch_1",
                      "error": {
                        "type": "business_error",
                        "code": "BUSINESS_REQUIREMENT_UNMET",
                        "message": "The declared total does not match the calculated total.",
                        "retryable": false,
                        "details": [
                          {
                            "field": "input.total",
                            "code": "TOTAL_MISMATCH",
                            "message": "The declared total does not match the calculated total.",
                            "metadata": {
                              "expected": 12100,
                              "received": 10000
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "headers": {
              "Lapyme-Version": {
                "description": "Contrato fechado aplicado a la creación. Se devuelve cuando la solicitud envía una versión soportada.",
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedEnumf007ccd7a1"
                }
              },
              "Deprecation": {
                "description": "Fecha de deprecación del contrato histórico. Se devuelve cuando la solicitud omite Lapyme-Version.",
                "schema": {
                  "type": "string",
                  "example": "@1787184000"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_sale_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not process the sale transaction",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "sales:write"
        ]
      }
    },
    "/api/v1/stock-transfers": {
      "get": {
        "summary": "Listar transferencias de stock",
        "description": "Lista las transferencias de stock de la organización con filtros por fecha, estado y depósitos.",
        "operationId": "listApiStockTransfers",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por nota, producto, SKU o variante",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "description": "Fecha inicial",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "description": "Fecha final",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "statuses",
            "in": "query",
            "description": "Estados de la transferencia. Puede repetirse o enviarse separada por comas.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiSharedEnum736f0d077b"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "source_warehouse_id",
            "in": "query",
            "description": "Depósito de origen",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "target_warehouse_id",
            "in": "query",
            "description": "Depósito de destino",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transferencias obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTransferListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_transfers_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for listing stock transfers",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_transfers_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_transfers_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_transfers_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list stock transfers",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "transfers:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst transfers = await lapyme.stockTransfers.listStockTransfers({\n  limit: 20,\n});\n"
          }
        ]
      },
      "post": {
        "summary": "Crear transferencia de stock",
        "description": "Crea una transferencia para mover productos entre depósitos.",
        "operationId": "createApiStockTransfer",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave opcional para deduplicar reintentos de la misma creación de transferencia. Si se omite, no hay protección automática contra repeticiones.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiStockTransferRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transferencia creada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiStockTransferSuccessResponse"
                },
                "examples": {
                  "created": {
                    "summary": "Transferencia creada",
                    "value": {
                      "request_id": "req_transfer_commit_1",
                      "data": {
                        "transfer": {
                          "id": "cf19b3ae-4c08-48be-b9d7-e6f2f5baf609",
                          "organization_id": "550e8400-e29b-41d4-a716-446655440001",
                          "source_warehouse_id": "550e8400-e29b-41d4-a716-446655440010",
                          "target_warehouse_id": "550e8400-e29b-41d4-a716-446655440011",
                          "transfer_date": "2026-04-18T13:00:00.000Z",
                          "notes": "Storefront replenishment",
                          "status": "in_transit",
                          "created_at": "2026-04-18T13:00:00.000Z",
                          "updated_at": "2026-04-18T13:05:00.000Z",
                          "created_by": "550e8400-e29b-41d4-a716-446655440020",
                          "updated_by": "550e8400-e29b-41d4-a716-446655440020",
                          "source_warehouse": {
                            "id": "550e8400-e29b-41d4-a716-446655440010",
                            "name": "Central warehouse"
                          },
                          "target_warehouse": {
                            "id": "550e8400-e29b-41d4-a716-446655440011",
                            "name": "Showroom"
                          },
                          "items": [
                            {
                              "id": "550e8400-e29b-41d4-a716-446655440030",
                              "product_id": "550e8400-e29b-41d4-a716-446655440040",
                              "quantity": 5,
                              "received_quantity": 0,
                              "rejected_quantity": 0,
                              "product": {
                                "id": "550e8400-e29b-41d4-a716-446655440040",
                                "name": "Cable HDMI 2m",
                                "sku": "HDMI-2M",
                                "variant_options": null,
                                "option_names": []
                              }
                            }
                          ]
                        },
                        "idempotent_replay": false
                      },
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Payload inválido o validación de negocio fallida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "VALIDATION_ERROR",
                    "value": {
                      "request_id": "req_transfer_1",
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Source and target warehouses must be different",
                        "retryable": false,
                        "details": [
                          {
                            "field": "source_warehouse_id",
                            "code": "VALIDATION",
                            "message": "The source warehouse must be different from the target warehouse."
                          }
                        ],
                        "type": "invalid_request_error"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_transfer_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_transfer_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurso relacionado inexistente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_transfer_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Transfer not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de stock o de idempotencia cuando se reutiliza una clave distinta",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "CONFLICT",
                    "value": {
                      "request_id": "req_transfer_1",
                      "error": {
                        "code": "CONFLICT",
                        "message": "Stock insuficiente para transferir 5 unidades.",
                        "retryable": false,
                        "details": [
                          {
                            "field": "items",
                            "code": "CONFLICT",
                            "message": "Stock insuficiente para transferir 5 unidades."
                          }
                        ],
                        "type": "invalid_request_error"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_transfer_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not process the stock transfer",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "transfers:write"
        ]
      }
    },
    "/api/v1/reference-candidates": {
      "get": {
        "summary": "Listar candidatos de referencia",
        "description": "Lista hasta seis coincidencias de nombre, código o identificador para la organización autenticada. Los resultados exactos aparecen primero. Los kinds inventory_* requieren inventory:read y resuelven categorías, productos o depósitos para consultas de inventario. kind=tag sólo devuelve scopes autorizados. Esta operación no crea efectos durables.",
        "operationId": "listApiReferenceCandidates",
        "tags": [
          "API"
        ],
        "x-excluded": true,
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "account",
                "category",
                "cost_center",
                "customer",
                "inventory_category",
                "inventory_product_variant",
                "inventory_product_variant_group",
                "inventory_warehouse",
                "payment_method",
                "point_of_sale",
                "price_list",
                "product_variant",
                "product_variant_group",
                "register",
                "safe",
                "seller",
                "supplier",
                "tag",
                "tag_customer",
                "tag_supplier",
                "tag_product",
                "tag_sale",
                "tag_purchase",
                "tag_purchase_order",
                "tag_transfer",
                "warehouse"
              ]
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Candidatos acotados",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiReferenceCandidateListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Autenticación requerida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "Error interno",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                }
              }
            }
          }
        },
        "x-required-scopes": [],
        "x-required-scopes-by-query": {
          "parameter": "kind",
          "values": {
            "account": [
              "accounting:read"
            ],
            "category": [
              "categories:read"
            ],
            "cost_center": [
              "reports:read"
            ],
            "customer": [
              "customers:read"
            ],
            "inventory_category": [
              "inventory:read"
            ],
            "inventory_product_variant": [
              "inventory:read"
            ],
            "inventory_product_variant_group": [
              "inventory:read"
            ],
            "inventory_warehouse": [
              "inventory:read"
            ],
            "payment_method": [
              "payment_methods:read"
            ],
            "point_of_sale": [
              "sales:read"
            ],
            "price_list": [
              "price_lists:read"
            ],
            "product_variant": [
              "products:read"
            ],
            "product_variant_group": [
              "products:read"
            ],
            "register": [
              "treasury:read"
            ],
            "safe": [
              "treasury:read"
            ],
            "seller": [
              "sales:read"
            ],
            "supplier": [
              "suppliers:read"
            ],
            "tag": [
              "admin"
            ],
            "tag_customer": [
              "customers:read"
            ],
            "tag_supplier": [
              "suppliers:read"
            ],
            "tag_product": [
              "products:read"
            ],
            "tag_sale": [
              "sales:read"
            ],
            "tag_purchase": [
              "purchases:read"
            ],
            "tag_purchase_order": [
              "purchases:read"
            ],
            "tag_transfer": [
              "transfers:read"
            ],
            "warehouse": [
              "warehouses:read"
            ]
          }
        }
      }
    },
    "/api/v1/reports/catalog": {
      "get": {
        "summary": "Consultar catálogo de reportes",
        "description": "Devuelve fuentes, dimensiones, medidas, filtros y semántica de reportes para la organización autenticada. Esta operación no crea efectos durables.",
        "operationId": "getApiReportCatalog",
        "tags": [
          "API"
        ],
        "x-excluded": true,
        "responses": {
          "200": {
            "description": "Catálogo de reportes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiReportCatalogResponse"
                }
              }
            }
          },
          "401": {
            "description": "Autenticación requerida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "Error interno",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "reports:read"
        ]
      }
    },
    "/api/v1/reports/query": {
      "post": {
        "summary": "Consultar reporte",
        "description": "Ejecuta una consulta analítica agrupada sobre ventas, compras, pagos, inventario, tesorería o publicaciones de Mercado Libre. marketplace_listings usa una instantánea sin período, en ARS, con permisos de costo vigentes. El campo `source` determina qué dimensiones y métricas están disponibles. Las consultas de tesorería requieren además el scope `treasury:read`. Usá `response_mode=assistant` para resolución de nombres, períodos predefinidos, comparaciones y paginación compatibles con run_report.",
        "operationId": "queryApiReport",
        "tags": [
          "API"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ReportRequest"
                  },
                  {
                    "$ref": "#/components/schemas/AssistantReportRequest"
                  }
                ]
              },
              "examples": {
                "sales_by_product": {
                  "summary": "Ventas por producto en Q1 2026",
                  "value": {
                    "source": "sales",
                    "period": {
                      "start_date": "2026-01-01",
                      "end_date": "2026-03-31"
                    },
                    "dimensions": [
                      "product"
                    ],
                    "measures": [
                      "total",
                      "units",
                      "count"
                    ],
                    "include_totals": true
                  }
                },
                "purchases_by_supplier": {
                  "summary": "Compras por proveedor en marzo de 2026",
                  "value": {
                    "source": "purchases",
                    "period": {
                      "start_date": "2026-03-01",
                      "end_date": "2026-03-31"
                    },
                    "dimensions": [
                      "supplier"
                    ],
                    "measures": [
                      "purchase_total",
                      "purchase_count"
                    ]
                  }
                },
                "payments_by_method": {
                  "summary": "Cobros y pagos por método en marzo de 2026",
                  "value": {
                    "source": "payments",
                    "period": {
                      "start_date": "2026-03-01",
                      "end_date": "2026-03-31"
                    },
                    "dimensions": [
                      "payment_method"
                    ],
                    "measures": [
                      "payment_net_cashflow",
                      "payment_collected_total",
                      "payment_paid_total"
                    ]
                  }
                },
                "marketplace_listing_estimate": {
                  "summary": "Contribución estimada por publicación al precio vigente",
                  "value": {
                    "response_mode": "assistant",
                    "source": "marketplace_listings",
                    "dimensions": [
                      "marketplace_item_id",
                      "marketplace_listing"
                    ],
                    "measures": [
                      "listing_price",
                      "estimated_contribution",
                      "estimated_contribution_percent",
                      "recent_units"
                    ],
                    "sort_by": "estimated_contribution_percent",
                    "sort_direction": "asc",
                    "limit": 50
                  }
                },
                "inventory_snapshot": {
                  "summary": "Inventario final por producto",
                  "value": {
                    "source": "inventory",
                    "period": {
                      "start_date": "2026-03-01",
                      "end_date": "2026-03-31"
                    },
                    "dimensions": [
                      "product",
                      "warehouse"
                    ],
                    "measures": [
                      "ending_inventory_units",
                      "ending_inventory_value"
                    ]
                  }
                },
                "treasury_ending_balance_by_account": {
                  "summary": "Saldo final de tesorería por cuenta",
                  "value": {
                    "source": "treasury",
                    "period": {
                      "start_date": "2026-03-01",
                      "end_date": "2026-03-31"
                    },
                    "dimensions": [
                      "treasury_account"
                    ],
                    "measures": [
                      "treasury_ending_balance"
                    ],
                    "treasury_currency_basis": "functional_ars",
                    "reporting_currency": "ARS",
                    "include_totals": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reporte ejecutado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ReportQueryResponse"
                    },
                    {
                      "$ref": "#/components/schemas/AssistantReportResponse"
                    }
                  ]
                },
                "examples": {
                  "sales_example": {
                    "summary": "Ventas por producto",
                    "value": {
                      "request_id": "req_report_1",
                      "data": {
                        "rows": [
                          {
                            "id": "9c692e8b",
                            "ids": [
                              "9c692e8b-0f9a-4f7c-8b99-061a2eb188ae"
                            ],
                            "labels": [
                              "Almohada Microfibra 80x50"
                            ],
                            "measures": {
                              "total": 998300,
                              "units": 12,
                              "count": 8
                            }
                          },
                          {
                            "id": "3b4a1c2d",
                            "ids": [
                              "3b4a1c2d-1234-5678-abcd-ef1234567890"
                            ],
                            "labels": [
                              "King size sheet"
                            ],
                            "measures": {
                              "total": 450000,
                              "units": 5,
                              "count": 4
                            }
                          }
                        ],
                        "totals": {
                          "total": 1448300,
                          "units": 17,
                          "count": 12
                        },
                        "metadata": {
                          "source": "sales",
                          "dimensions": [
                            "product"
                          ],
                          "measures": [
                            "total",
                            "units",
                            "count"
                          ],
                          "period": {
                            "start_date": "2026-01-01",
                            "end_date": "2026-03-31"
                          },
                          "date_basis": "commercial"
                        }
                      }
                    }
                  },
                  "treasury_original_currency_example": {
                    "summary": "Saldo nativo de tesorería con calidad de importe",
                    "value": {
                      "request_id": "req_report_treasury_1",
                      "data": {
                        "rows": [
                          {
                            "id": "bank_account:9c692e8b",
                            "ids": [
                              "bank_account:9c692e8b"
                            ],
                            "labels": [
                              "Banco USD"
                            ],
                            "measures": {
                              "treasury_ending_balance": null
                            },
                            "measure_qualities": {
                              "treasury_ending_balance": "unavailable"
                            }
                          }
                        ],
                        "totals": null,
                        "total_amount_quality": {
                          "treasury_ending_balance": "unavailable"
                        },
                        "metadata": {
                          "source": "treasury",
                          "dimensions": [
                            "treasury_account"
                          ],
                          "measures": [
                            "treasury_ending_balance"
                          ],
                          "period": {
                            "start_date": "2026-03-01",
                            "end_date": "2026-03-31"
                          },
                          "reporting_currency": "USD",
                          "rate_basis": "treasury_original_currency",
                          "treasury_currency_basis": "original",
                          "treasury_visibility_scope": "organization",
                          "amount_quality_by_measure": {
                            "treasury_ending_balance": "unavailable"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_report_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for querying reports",
                        "retryable": false,
                        "details": [
                          {
                            "field": "measures",
                            "code": "too_small",
                            "message": "Select at least one measure"
                          }
                        ],
                        "type": "invalid_request_error"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_report_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_report_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_report_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not run the report query",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "reports:read"
        ],
        "x-dynamic-scope-requirement": {
          "source": "body",
          "field": "source",
          "values": {
            "treasury": [
              "treasury:read"
            ]
          }
        },
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst report = await lapyme.reports.query({\n  source: \"sales\",\n  period: {\n    startDate: \"2026-01-01\",\n    endDate: \"2026-03-31\",\n  },\n  dimensions: [\"product\"],\n  measures: [\"total\", \"units\", \"count\"],\n  includeTotals: true,\n});\n"
          }
        ]
      }
    },
    "/api/v1/purchases/{purchase_id}": {
      "get": {
        "summary": "Obtener compra por ID",
        "description": "Devuelve el detalle de la compra.",
        "operationId": "getApiPurchaseById",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "purchase_id",
            "in": "path",
            "description": "ID de la compra",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Compra obtenida exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPurchaseDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_purchase_detail_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_purchase_detail_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Compra no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_purchase_detail_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Purchase not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_purchase_detail_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not retrieve the purchase",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst purchase = await lapyme.purchases.getPurchaseById({\n  purchaseId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n});\n"
          }
        ]
      },
      "put": {
        "summary": "Actualizar compra",
        "description": "Actualiza una compra existente y devuelve el detalle persistido. El campo items es requerido y reemplaza los renglones de la compra. Requiere Idempotency-Key.",
        "operationId": "updateApiPurchase",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "purchase_id",
            "in": "path",
            "description": "ID de la compra",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiPurchaseUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Compra actualizada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPurchaseDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Compra no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Compra no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Precondición de negocio no satisfecha",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Precondición de negocio no satisfecha",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:write"
        ]
      },
      "delete": {
        "summary": "Eliminar compra",
        "description": "Elimina una compra existente. Puede revertir stock directo con undo_stock=true. Requiere Idempotency-Key.",
        "operationId": "deleteApiPurchase",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "purchase_id",
            "in": "path",
            "description": "ID de la compra",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "undo_stock",
            "in": "query",
            "description": "Si es true, revierte los movimientos de stock directo creados por la compra cuando sea posible.",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Compra eliminada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPurchaseDeleteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Compra no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Compra no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "La compra no puede eliminarse en su estado actual",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "La compra no puede eliminarse en su estado actual",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "No se pudo revertir stock por precondición de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "No se pudo revertir stock por precondición de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:write"
        ]
      }
    },
    "/api/v1/purchase-orders": {
      "get": {
        "summary": "Listar órdenes de compra",
        "description": "Lista las órdenes de compra de la organización. Soporta búsqueda por proveedor o número de orden y filtros por fecha y estado.",
        "operationId": "listApiPurchaseOrders",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por proveedor o número de orden",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "description": "Fecha inicial de la orden",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "description": "Fecha final de la orden",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Estado o lista de estados separados por coma: draft, sent, partially_received, received, closed, cancelled",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumf2073aa092"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Órdenes de compra obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPurchaseOrderListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst purchaseOrders = await lapyme.purchaseOrders.listPurchaseOrders({\n  limit: 20,\n  status: \"draft\",\n});\n"
          }
        ]
      },
      "post": {
        "summary": "Crear orden de compra",
        "description": "Crea una orden de compra en borrador. Requiere Idempotency-Key.",
        "operationId": "createApiPurchaseOrder",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiPurchaseOrderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Orden de compra creada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPurchaseOrderWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Orden de compra no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Orden de compra no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:write"
        ]
      }
    },
    "/api/v1/purchase-orders/{purchase_order_id}": {
      "get": {
        "summary": "Obtener orden de compra por ID",
        "description": "Devuelve el detalle de una orden de compra.",
        "operationId": "getApiPurchaseOrderById",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "purchase_order_id",
            "in": "path",
            "description": "ID de la orden de compra",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Orden de compra obtenida exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPurchaseOrderDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Orden de compra no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Orden de compra no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst purchaseOrder = await lapyme.purchaseOrders.getPurchaseOrderById({\n  purchaseOrderId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n});\n"
          }
        ]
      },
      "put": {
        "summary": "Actualizar orden de compra",
        "description": "Actualiza una orden de compra editable y devuelve el detalle persistido. Requiere Idempotency-Key.",
        "operationId": "updateApiPurchaseOrder",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "purchase_order_id",
            "in": "path",
            "description": "ID de la orden de compra",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiPurchaseOrderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Orden de compra actualizada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPurchaseOrderWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Orden de compra no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Orden de compra no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:write"
        ]
      },
      "delete": {
        "summary": "Eliminar orden de compra en borrador",
        "description": "Elimina una orden de compra solo si todavía está en estado borrador.",
        "operationId": "deleteApiDraftPurchaseOrder",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "purchase_order_id",
            "in": "path",
            "description": "ID de la orden de compra",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Orden de compra eliminada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPurchaseOrderDeleteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Orden de compra no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Orden de compra no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:write"
        ]
      }
    },
    "/api/v1/purchase-orders/{purchase_order_id}/confirm": {
      "post": {
        "summary": "Confirmar orden de compra",
        "description": "Confirma una orden de compra y devuelve el detalle persistido.",
        "operationId": "confirmApiPurchaseOrder",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "purchase_order_id",
            "in": "path",
            "description": "ID de la orden de compra",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Orden de compra confirmada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPurchaseOrderWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Orden de compra no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Orden de compra no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst purchaseOrder = await lapyme.purchaseOrders.confirm({\n  purchaseOrderId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n});\n"
          }
        ]
      }
    },
    "/api/v1/purchase-orders/{purchase_order_id}/close": {
      "post": {
        "summary": "Cerrar orden de compra",
        "description": "Cierra una orden de compra y devuelve el detalle persistido.",
        "operationId": "closeApiPurchaseOrder",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "purchase_order_id",
            "in": "path",
            "description": "ID de la orden de compra",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Orden de compra cerrada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPurchaseOrderWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Orden de compra no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Orden de compra no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:write"
        ]
      }
    },
    "/api/v1/purchase-orders/{purchase_order_id}/reopen": {
      "post": {
        "summary": "Reabrir orden de compra",
        "description": "Reabre una orden de compra cerrada y devuelve el detalle persistido.",
        "operationId": "reopenApiPurchaseOrder",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "purchase_order_id",
            "in": "path",
            "description": "ID de la orden de compra",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Orden de compra reabierta exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPurchaseOrderWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Orden de compra no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Orden de compra no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:write"
        ]
      }
    },
    "/api/v1/purchase-orders/{purchase_order_id}/receipts": {
      "post": {
        "summary": "Recibir orden de compra",
        "description": "Registra la recepción de líneas de una orden de compra confirmada. Requiere Idempotency-Key.",
        "operationId": "receiveApiPurchaseOrder",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "purchase_order_id",
            "in": "path",
            "description": "ID de la orden de compra",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiPurchaseOrderReceiptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recepción creada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPurchaseOrderReceiptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Orden de compra no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Orden de compra no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:write"
        ]
      }
    },
    "/api/v1/orders": {
      "get": {
        "summary": "Listar pedidos",
        "description": "Lista pedidos de comercio con paginación por cursor. No expone page, offset, total ni total_pages.",
        "operationId": "listApiOrders",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnum4ac9200c4a"
            }
          },
          {
            "name": "preparation_status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumb49e56b125"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pedidos obtenidos exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiOrderListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:read"
          ]
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst orders = await lapyme.orders.listOrders({\n  limit: 20,\n});\n"
          }
        ]
      },
      "post": {
        "summary": "Crear pedido",
        "description": "Crea un pedido de comercio y su trabajo inicial de preparación. Requiere Idempotency-Key.",
        "operationId": "createApiOrder",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiOrderCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pedido creado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiOrderWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pedido no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pedido no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:write"
          ]
        ]
      }
    },
    "/api/v1/orders/{order_id}": {
      "get": {
        "summary": "Obtener pedido",
        "description": "Devuelve el detalle persistido de un pedido de comercio.",
        "operationId": "getApiOrderById",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "ID del pedido",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pedido obtenido exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiOrderDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pedido no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pedido no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:read"
          ]
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst order = await lapyme.orders.getOrderById({\n  orderId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n});\n"
          }
        ]
      },
      "patch": {
        "summary": "Editar pedido",
        "description": "Acepta el contrato histórico de solo notas sin Idempotency-Key. Para cambiar cliente, lista de precios, depósito, entrega, fecha, impuestos, descuento o líneas, enviá la representación estructural completa, expected_updated_at cuando necesites concurrencia optimista e Idempotency-Key. unit_price usa importes netos como los devueltos por el GET, y los campos opcionales omitidos conservan su valor actual. Un cambio de depósito o entrega traslada el trabajo pendiente y sus reservas en la misma operación.",
        "operationId": "patchApiOrder",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "ID del pedido",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Obligatoria para ediciones estructurales. Se omite para el contrato histórico que actualiza solo notes.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/ApiOrderNotesPatchRequest"
                  },
                  {
                    "$ref": "#/components/schemas/ApiOrderEditRequest"
                  }
                ]
              },
              "examples": {
                "notes_only_compatibility": {
                  "summary": "Actualizar solo las notas",
                  "value": {
                    "notes": "Retira por sucursal."
                  }
                },
                "structural_edit": {
                  "summary": "Editar estructura, importes y líneas",
                  "value": {
                    "assigned_warehouse_id": "550e8400-e29b-41d4-a716-446655440003",
                    "delivery_method": "shipping",
                    "expected_updated_at": "2026-08-28T12:00:00.000Z",
                    "tax_inclusive": false,
                    "lines": [
                      {
                        "order_line_id": "550e8400-e29b-41d4-a716-446655440004",
                        "product_id": "550e8400-e29b-41d4-a716-446655440005",
                        "product_name_snapshot": "Mate",
                        "sku_snapshot": "MATE-1",
                        "ordered_quantity": 2,
                        "unit_price": 10000,
                        "tax_rate_id": 5
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pedido actualizado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiOrderWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pedido no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pedido no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:write"
          ]
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst order = await lapyme.orders.patchOrder({\n  orderId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n  idempotencyKey: crypto.randomUUID(),\n  body: {\n    assignedWarehouseId: \"8c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n    deliveryMethod: \"shipping\",\n    expectedUpdatedAt: \"2026-08-28T12:00:00.000Z\",\n    taxInclusive: false,\n    lines: [{\n      orderLineId: \"7c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n      productNameSnapshot: \"Mate\",\n      skuSnapshot: \"MATE-1\",\n      orderedQuantity: 2,\n      unitPrice: 10000,\n      taxRateId: 5,\n    }],\n  },\n});\n"
          }
        ]
      },
      "delete": {
        "summary": "Eliminar pedido archivado",
        "description": "Elimina únicamente pedidos archivados; la validación de estado vive en la capability de commerce.",
        "operationId": "deleteApiArchivedOrder",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "ID del pedido",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pedido archivado eliminado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pedido no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pedido no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:write"
          ]
        ]
      }
    },
    "/api/v1/orders/{order_id}/archive": {
      "post": {
        "summary": "Archivar pedido",
        "description": "Archiva un pedido elegible y permite registrar un motivo opcional sin modificar sus líneas ni importes.",
        "operationId": "archiveApiOrder",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "ID del pedido",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiOrderOptionalReasonRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pedido archivado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiOrderWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pedido no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pedido no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:write"
          ]
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst order = await lapyme.orders.archive({\n  orderId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n});\n"
          }
        ]
      }
    },
    "/api/v1/orders/{order_id}/cancel": {
      "post": {
        "summary": "Cancelar pedido",
        "description": "Cancela un pedido elegible y devuelve el estado persistido después de aplicar sus efectos de cancelación.",
        "operationId": "cancelApiOrder",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "ID del pedido",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pedido cancelado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiOrderWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pedido no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pedido no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:write"
          ]
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst order = await lapyme.orders.cancel({\n  orderId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n});\n"
          }
        ]
      }
    },
    "/api/v1/orders/{order_id}/preparation": {
      "patch": {
        "summary": "Actualizar preparación pendiente",
        "description": "Marca un grupo de preparación como en preparación o cambia el depósito de sus unidades pendientes.",
        "operationId": "updateApiOrderPreparation",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "ID del pedido",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiOrderPreparationUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preparación pendiente actualizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiOrderWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pedido no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pedido no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:write"
          ]
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst order = await lapyme.orders.updatePreparation({\n  orderId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n  body: {\n    preparationGroupId: \"8b692e8b-0f9a-4f7c-8b99-061a2eb188af\",\n    status: \"in_progress\",\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/orders/{order_id}/unarchive": {
      "post": {
        "summary": "Desarchivar pedido",
        "description": "Restaura un pedido archivado y devuelve el estado persistido resultante.",
        "operationId": "unarchiveApiOrder",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "ID del pedido",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pedido desarchivado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiOrderWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pedido no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pedido no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:write"
          ]
        ]
      }
    },
    "/api/v1/orders/{order_id}/preparations": {
      "post": {
        "summary": "Marcar líneas como preparadas",
        "description": "Registra cantidades preparadas para un grupo del pedido y requiere Idempotency-Key.",
        "operationId": "createApiOrderPreparation",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "ID del pedido",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiOrderPreparationCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preparación creada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiOrderWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pedido no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pedido no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:write"
          ]
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst order = await lapyme.orders.createPreparation({\n  orderId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n  idempotencyKey: crypto.randomUUID(),\n  body: {\n    preparationGroupId: \"8b692e8b-0f9a-4f7c-8b99-061a2eb188af\",\n    items: [\n      {\n        orderLineId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n        quantity: 1,\n      },\n    ],\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/orders/{order_id}/preparations/{preparation_id}/cancel": {
      "post": {
        "summary": "Cancelar preparación",
        "description": "Cancela una preparación existente del pedido y permite registrar un motivo opcional.",
        "operationId": "cancelApiOrderPreparation",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "ID del pedido",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "preparation_id",
            "in": "path",
            "description": "ID de la preparación",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiOrderOptionalReasonRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preparación cancelada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiOrderWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pedido no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pedido no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:write"
          ]
        ]
      }
    },
    "/api/v1/purchases/{purchase_id}/document": {
      "get": {
        "summary": "Descargar documento de compra",
        "description": "Revalida la API key, el scope purchases:read, la organización y la procedencia del documento. Responde 302 hacia una URL firmada de cinco minutos para el PDF o imagen original. Seguí el redirect y no persistas el Location.",
        "operationId": "downloadApiPurchaseDocument",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "purchase_id",
            "in": "path",
            "description": "ID de la compra",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Authorized redirect to a short-lived signed storage URL. Clients should follow redirects immediately and must not persist the Location value.",
            "headers": {
              "Location": {
                "description": "Short-lived signed URL for the document bytes.",
                "required": true,
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "Cache-Control": {
                "description": "Always private, no-store.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "X-Request-Id": {
                "description": "Request identifier for support and tracing.",
                "schema": {
                  "type": "string",
                  "example": "req_document_1"
                }
              },
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            }
          },
          "400": {
            "description": "ID de recurso inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "ID de recurso inválido",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurso o documento no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Recurso o documento no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno al validar la procedencia segura del documento",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno al validar la procedencia segura del documento",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "No se pudo firmar el documento temporalmente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RETRYABLE_DEPENDENCY_FAILURE",
                    "value": {
                      "request_id": "req_document_1",
                      "error": {
                        "code": "RETRYABLE_DEPENDENCY_FAILURE",
                        "message": "Document storage is temporarily unavailable.",
                        "retryable": true,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst response = await fetch(\n  \"https://api.lapyme.com.ar/api/v1/purchases/9c692e8b-0f9a-4f7c-8b99-061a2eb188ae/document\",\n  {\n    headers: { Authorization: `Bearer ${process.env[\"LAPYME_API_KEY\"]}` },\n    redirect: \"follow\",\n  }\n);\nif (!response.ok) throw new Error(await response.text());\nconst documentBytes = await response.arrayBuffer();\n"
          }
        ]
      }
    },
    "/api/v1/orders/{order_id}/invoices": {
      "post": {
        "summary": "Facturar pedido",
        "description": "Factura líneas del pedido y requiere Idempotency-Key.",
        "operationId": "createApiOrderInvoice",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "ID del pedido",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiOrderInvoiceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pedido facturado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiOrderWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pedido no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pedido no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "orders:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:write"
          ]
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst order = await lapyme.orders.createInvoice({\n  orderId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n  idempotencyKey: crypto.randomUUID(),\n  body: {\n    voucherType: 6,\n    pointOfSaleId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n    invoiceDate: \"2026-05-26\",\n    lines: [\n      {\n        orderLineId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n        quantityToInvoice: 1,\n      },\n    ],\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/sales/{sale_id}": {
      "get": {
        "summary": "Obtener venta por ID",
        "description": "Devuelve el detalle de la venta.",
        "operationId": "getApiSaleById",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "sale_id",
            "in": "path",
            "description": "ID de la venta",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated top-level sale sections to include. Omit for the detail default: id, invoicePdf, document, customer, amounts, items, payments, applications, fiscal, reversesVoucher, integration, audit, tags, accounting. accounting needs the reports:read scope and runs an extra query, so leave it out when you do not need the journal evidence.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "id",
                  "invoicePdf",
                  "document",
                  "customer",
                  "amounts",
                  "items",
                  "payments",
                  "applications",
                  "fiscal",
                  "integration",
                  "reversesVoucher",
                  "audit",
                  "tags",
                  "accounting"
                ]
              }
            },
            "style": "form",
            "explode": false
          }
        ],
        "responses": {
          "200": {
            "description": "Venta obtenida exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSaleDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_sale_detail_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_sale_detail_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Venta no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_sale_detail_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Sale not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_sale_detail_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not retrieve the sale",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "sales:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst sale = await lapyme.sales.getSaleById({\n  saleId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n});\n"
          }
        ]
      },
      "patch": {
        "summary": "Actualizar metadatos de venta",
        "description": "Actualiza solo metadatos operativos de una venta: notas, referencia de integracion externa y vendedor. No permite modificar items, importes, pagos ni datos fiscales.",
        "operationId": "patchApiSaleMetadata",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "sale_id",
            "in": "path",
            "description": "ID de la venta",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiSaleMetadataPatchRequest"
              },
              "examples": {
                "update_notes_and_reference": {
                  "summary": "Actualizar notas y referencia externa",
                  "value": {
                    "notes": "Pedido conciliado con ERP",
                    "integration_source": "ERP",
                    "integration_id": "SO-10045"
                  }
                },
                "clear_external_reference": {
                  "summary": "Limpiar referencia externa",
                  "value": {
                    "integration_source": null,
                    "integration_id": null
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Venta actualizada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSaleDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Payload invalido o metadatos no permitidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_sale_patch_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for updating the sale",
                        "retryable": false,
                        "details": [
                          {
                            "field": "integration_id",
                            "code": "custom",
                            "message": "integration_source and integration_id must be provided together."
                          }
                        ],
                        "type": "invalid_request_error"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o invalida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_sale_patch_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_sale_patch_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Venta no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_sale_patch_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Sale not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "La referencia de integracion ya esta asociada a otra venta",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "CONFLICT",
                    "value": {
                      "request_id": "req_sale_patch_1",
                      "error": {
                        "code": "CONFLICT",
                        "message": "Sale integration reference already exists.",
                        "retryable": false,
                        "details": [
                          {
                            "field": "integration_id",
                            "code": "duplicate_integration_reference",
                            "message": "Another sale already uses this integration source and ID."
                          }
                        ],
                        "type": "invalid_request_error"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_sale_patch_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not update the sale",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "sales:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst sale = await lapyme.sales.patchMetadata({\n  saleId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n  body: {\n    notes: \"Referencia actualizada desde integracion\",\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/sales/{sale_id}/invoice": {
      "post": {
        "summary": "Facturar una venta existente",
        "description": "Factura la venta existente identificada por saleId sin crear otra venta. Usá esta ruta para ventas importadas que ya existen en La Pyme. Requiere Idempotency-Key.",
        "operationId": "invoiceApiSale",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "sale_id",
            "in": "path",
            "description": "ID de la venta existente",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Venta facturada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiExistingSaleInvoiceResponse"
                }
              }
            }
          },
          "202": {
            "description": "La venta todavía no fue facturada. Consultá su estado antes de volver a intentar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiExistingSaleInvoiceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Sale ID o Idempotency-Key inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Sale ID o Idempotency-Key inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope sales:write faltante",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope sales:write faltante",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Venta no encontrada en la organización",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Venta no encontrada en la organización",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "La venta ya fue facturada, su estado no permite facturar o la key fue reutilizada con otra solicitud",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "La venta ya fue facturada, su estado no permite facturar o la key fue reutilizada con otra solicitud",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Configuración fiscal faltante, estado fiscal inválido o rechazo final previo al envío",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Configuración fiscal faltante, estado fiscal inválido o rechazo final previo al envío",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Dependencia temporalmente no disponible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Dependencia temporalmente no disponible",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "sales:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst invoice = await lapyme.sales.invoice({\n  saleId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n  idempotencyKey: crypto.randomUUID(),\n});\n"
          }
        ]
      }
    },
    "/api/v1/stock-transfers/{transfer_id}": {
      "get": {
        "summary": "Obtener transferencia por ID",
        "description": "Devuelve el detalle de la transferencia de stock.",
        "operationId": "getApiStockTransferById",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "transfer_id",
            "in": "path",
            "description": "ID de la transferencia",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transferencia obtenida exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTransferDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_transfer_detail_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_transfer_detail_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Transferencia no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_transfer_detail_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Transferencia no encontrada",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_transfer_detail_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not retrieve the transfer",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "transfers:read"
        ]
      }
    },
    "/api/v1/stock-movements": {
      "post": {
        "summary": "Crear movimiento de stock",
        "description": "Registra un movimiento manual para ajustar stock. En mode replace, items[].expected_quantity compara el stock disponible observado con el valor actual bajo bloqueo. Si falta, el reemplazo es incondicional. En mode delta, expected_quantity no se acepta. Para un combo, compará la cantidad disponible del combo.",
        "operationId": "createApiStockMovement",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave única para evitar duplicados al reintentar el mismo movimiento de stock.",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiStockMovementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Movimiento de stock creado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiStockMovementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_stock_movement_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for creating stock movements",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_stock_movement_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_stock_movement_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurso relacionado inexistente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_stock_movement_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Warehouse not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de stock disponible. Si el stock cambió, consultalo otra vez y enviá una nueva decisión con otra Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "STATE_CONFLICT",
                    "value": {
                      "request_id": "req_stock_movement_1",
                      "error": {
                        "code": "STATE_CONFLICT",
                        "message": "El stock disponible cambió. Consultá el stock actual y volvé a decidir.",
                        "retryable": false,
                        "details": [
                          {
                            "field": "items.0.expected_quantity",
                            "code": "stock_quantity_mismatch",
                            "message": "El stock disponible cambió desde la consulta.",
                            "metadata": {
                              "expected_quantity": 43,
                              "current_quantity": 40
                            }
                          }
                        ],
                        "type": "invalid_request_error"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_stock_movement_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not process the stock movement",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "stock_movements:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "inventory:write"
          ],
          [
            "products:write"
          ]
        ]
      }
    },
    "/api/v1/customers/metafield-definitions": {
      "get": {
        "summary": "Listar definiciones de campos personalizados de clientes",
        "description": "Devuelve páginas de definiciones de contacto no sistémicas de la empresa autenticada, ordenadas por clave e ID ascendentes. Usa el cursor opaco next_cursor para continuar; limit vale 50 por defecto y admite entre 1 y 100. Incluye su UUID para enviarlo como definition_id al crear o actualizar clientes y las validaciones required, límites de texto o número y opciones configuradas de select. No devuelve valores ingresados por clientes, valores observados ni cantidades. Usa customers:read; customers:write y admin conservan su implicación existente. No requiere Idempotency-Key.",
        "operationId": "listApiCustomerMetafieldDefinitions",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Valor opaco de next_cursor recibido en la respuesta anterior",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Cantidad máxima de definiciones por página",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Definiciones obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCustomerMetafieldDefinitionsResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Campo obligatorio que la integración puede descubrir",
                    "value": {
                      "request_id": "req_customer_definitions_1",
                      "object": "list",
                      "url": "/api/v1/customers/metafield-definitions",
                      "has_more": false,
                      "next_cursor": null,
                      "data": [
                        {
                          "object": "metafield_definition",
                          "id": "550e8400-e29b-41d4-a716-446655440701",
                          "key": "tipo_de_cliente",
                          "name": "Tipo de cliente",
                          "description": null,
                          "field_type": "select",
                          "validations": {
                            "required": true,
                            "options": [
                              "Mayorista",
                              "Minorista"
                            ]
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Cursor o límite inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_customer_definitions_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for listing customer metafield definitions",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Credencial faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_customer_definitions_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "Authentication required",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_customer_definitions_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Permisos insuficientes",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_customer_definitions_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list customer metafield definitions",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "customers:read"
        ]
      }
    },
    "/api/v1/customers": {
      "get": {
        "summary": "Listar clientes",
        "description": "Devuelve clientes de la organización. Permite buscar por nombre, CUIT o email.",
        "operationId": "listApiCustomers",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por nombre, CUIT o email",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "description": "Filtra por estado activo",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Estado lógico del cliente. Puede repetirse o enviarse separado por comas.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiSharedEnumd952d5ce8e"
              }
            },
            "style": "form",
            "explode": true
          }
        ],
        "responses": {
          "200": {
            "description": "Clientes obtenidos exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCustomerListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_customers_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for listing customers",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_customers_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_customers_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_customers_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list customers",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "customers:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst customers = await lapyme.customers.get({\n  limit: 20,\n  query: \"Acme\",\n});\n"
          }
        ]
      },
      "post": {
        "summary": "Crear cliente",
        "description": "Crea un cliente para ventas, cuentas corrientes, etiquetas y reportes. Un DNI o CUIT que ya pertenece a otro cliente de la organización responde 409 CONFLICT.",
        "operationId": "createApiCustomer",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave única para evitar duplicados al reintentar la misma creación de cliente.",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCustomerMutationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cliente creado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCustomerCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_customer_create_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for creating customers",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_customer_create_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_customer_create_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurso relacionado inexistente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_customer_create_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Default price list not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de negocio o idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "CONFLICT",
                    "value": {
                      "request_id": "req_customer_create_1",
                      "error": {
                        "code": "CONFLICT",
                        "message": "Ya existe un cliente con ese documento",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_customer_create_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not process the customer",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "customers:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst customer = await lapyme.customers.create({\n  idempotencyKey: crypto.randomUUID(),\n  body: {\n    name: \"Acme S.A.\",\n    taxId: \"30711222333\",\n    email: \"compras@acme.com.ar\",\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/customers/{customer_id}": {
      "get": {
        "summary": "Obtener cliente por ID",
        "description": "Devuelve los datos del cliente.",
        "operationId": "getApiCustomerById",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "ID del cliente",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cliente obtenido exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCustomerDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetro inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_customer_detail_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for retrieving the customer",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_customer_detail_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_customer_detail_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Cliente no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_customer_detail_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Customer not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_customer_detail_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not retrieve the customer",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "customers:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst customer = await lapyme.customers.getCustomerById({\n  customerId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n});\n"
          }
        ]
      },
      "put": {
        "summary": "Actualizar cliente",
        "description": "Actualiza un cliente y devuelve los datos persistidos. Cambiar el DNI o CUIT a uno que ya pertenece a otro cliente de la organización responde 409 CONFLICT; reenviar el documento guardado no lo valida otra vez.",
        "operationId": "updateApiCustomer",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "ID del cliente",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCustomerUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cliente actualizado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCustomerUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_customer_update_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for updating customers",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_customer_update_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_customer_update_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Cliente o recurso relacionado inexistente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_customer_update_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Customer not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "CONFLICT",
                    "value": {
                      "request_id": "req_customer_update_1",
                      "error": {
                        "code": "CONFLICT",
                        "message": "Ya existe un cliente con ese documento",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_customer_update_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not update the customer",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "customers:write"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst customer = await lapyme.customers.updateCustomer({\n  customerId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n  body: {\n    email: \"administracion@acme.com.ar\",\n  },\n});\n"
          }
        ]
      }
    },
    "/api/v1/tags": {
      "get": {
        "summary": "Listar etiquetas",
        "description": "Lista el catálogo de etiquetas para un scope específico. Puede incluir etiquetas archivadas.",
        "operationId": "listApiTags",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "description": "Scope del catálogo de etiquetas",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnum09f8155a9a"
            }
          },
          {
            "name": "include_archived",
            "in": "query",
            "description": "Incluye etiquetas archivadas en la respuesta",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Etiquetas obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTagsListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_tags_list_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for listing tags",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_tags_list_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_tags_list_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_tags_list_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list tags",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [],
        "x-required-scopes-by-query": {
          "parameter": "scope",
          "values": {
            "customer": [
              "customers:read"
            ],
            "supplier": [
              "suppliers:read"
            ],
            "product": [
              "products:read"
            ],
            "sale": [
              "sales:read"
            ],
            "purchase": [
              "purchases:read"
            ],
            "purchase_order": [
              "purchases:read"
            ],
            "transfer": [
              "transfers:read"
            ]
          }
        }
      },
      "post": {
        "summary": "Crear etiqueta",
        "description": "Crea una etiqueta para clasificar clientes, proveedores, productos o ventas.",
        "operationId": "createApiTag",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave única para evitar duplicados al reintentar la misma creación de etiqueta.",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiTagCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Etiqueta creada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTagCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_tag_create_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for creating tags",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_tag_create_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_tag_create_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de negocio o idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "CONFLICT",
                    "value": {
                      "request_id": "req_tag_create_1",
                      "error": {
                        "code": "CONFLICT",
                        "message": "A tag with this name already exists for this record type.",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_tag_create_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not create the tag",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "admin"
        ]
      }
    },
    "/api/v1/tags/{tag_id}": {
      "patch": {
        "summary": "Actualizar etiqueta",
        "description": "Renombra, actualiza metadatos o archiva/desarchiva una etiqueta existente.",
        "operationId": "updateApiTag",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "tag_id",
            "in": "path",
            "description": "ID de la etiqueta",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiTagUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Etiqueta actualizada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTagUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_tag_update_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for updating tags",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_tag_update_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_tag_update_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Etiqueta no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_tag_update_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Etiqueta no encontrada",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "CONFLICT",
                    "value": {
                      "request_id": "req_tag_update_1",
                      "error": {
                        "code": "CONFLICT",
                        "message": "A tag with this name already exists for this record type.",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_tag_update_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not update the tag",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "admin"
        ]
      }
    },
    "/api/v1/purchases/tags/apply": {
      "post": {
        "summary": "Aplicar etiquetas a compras",
        "description": "Agrega y/o remueve etiquetas de scope `purchase` en un lote de compras.",
        "operationId": "applyApiPurchaseTags",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiApplyTagsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Etiquetas aplicadas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiApplyTagsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_purchase_tags_apply_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for applying tags to purchases",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_purchase_tags_apply_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_purchase_tags_apply_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_purchase_tags_apply_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not apply tags to purchases",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "purchases:write"
        ]
      }
    },
    "/api/v1/customers/tags/apply": {
      "post": {
        "summary": "Aplicar etiquetas a clientes",
        "description": "Agrega y/o remueve etiquetas de scope `customer` en un lote de clientes.",
        "operationId": "applyApiCustomerTags",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiApplyTagsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Etiquetas aplicadas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiApplyTagsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_customer_tags_apply_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for applying tags to customers",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_customer_tags_apply_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_customer_tags_apply_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_customer_tags_apply_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not apply tags to customers",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "customers:write"
        ]
      }
    },
    "/api/v1/suppliers/tags/apply": {
      "post": {
        "summary": "Aplicar etiquetas a proveedores",
        "description": "Agrega y/o remueve etiquetas de scope `supplier` en un lote de proveedores.",
        "operationId": "applyApiSupplierTags",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiApplyTagsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Etiquetas aplicadas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiApplyTagsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_supplier_tags_apply_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for applying tags to suppliers",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_supplier_tags_apply_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_supplier_tags_apply_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_supplier_tags_apply_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not apply tags to suppliers",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "suppliers:write"
        ]
      }
    },
    "/api/v1/products/tags/apply": {
      "post": {
        "summary": "Aplicar etiquetas a productos",
        "description": "Agrega y/o remueve etiquetas de scope `product` en un lote de productos.",
        "operationId": "applyApiProductTags",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiApplyTagsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Etiquetas aplicadas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiApplyTagsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_product_tags_apply_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for applying tags to products",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_product_tags_apply_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_product_tags_apply_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_product_tags_apply_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not apply tags to products",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "products:write"
        ]
      }
    },
    "/api/v1/sales/{sale_id}/document": {
      "get": {
        "summary": "Descargar comprobante de venta",
        "description": "Revalida la API key, el scope sales:read, la organización, el estado del PDF y su procedencia. Responde 302 hacia una URL firmada de cinco minutos. Seguí el redirect y no persistas el Location. Un PDF pendiente responde 409 retryable con Retry-After; uno fallido responde 409 no retryable.",
        "operationId": "downloadApiSaleDocument",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "sale_id",
            "in": "path",
            "description": "ID de la venta",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Authorized redirect to a short-lived signed storage URL. Clients should follow redirects immediately and must not persist the Location value.",
            "headers": {
              "Location": {
                "description": "Short-lived signed URL for the document bytes.",
                "required": true,
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "Cache-Control": {
                "description": "Always private, no-store.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "X-Request-Id": {
                "description": "Request identifier for support and tracing.",
                "schema": {
                  "type": "string",
                  "example": "req_document_1"
                }
              },
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            }
          },
          "400": {
            "description": "ID de recurso inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "ID de recurso inválido",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurso o documento no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Recurso o documento no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "El comprobante está pendiente o falló",
            "headers": {
              "Retry-After": {
                "description": "Presente con valor 5 solamente cuando el documento sigue pendiente.",
                "schema": {
                  "type": "string",
                  "example": "5"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "PRECONDITION_FAILED",
                    "value": {
                      "request_id": "req_sale_document_1",
                      "error": {
                        "code": "PRECONDITION_FAILED",
                        "message": "Sale document is not ready.",
                        "retryable": true,
                        "details": [
                          {
                            "field": "document",
                            "code": "document_pending",
                            "message": "The invoice document is still being generated."
                          }
                        ],
                        "type": "invalid_request_error"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno al validar la procedencia segura del documento",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno al validar la procedencia segura del documento",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "No se pudo firmar el documento temporalmente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RETRYABLE_DEPENDENCY_FAILURE",
                    "value": {
                      "request_id": "req_document_1",
                      "error": {
                        "code": "RETRYABLE_DEPENDENCY_FAILURE",
                        "message": "Document storage is temporarily unavailable.",
                        "retryable": true,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "sales:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst response = await fetch(\n  \"https://api.lapyme.com.ar/api/v1/sales/9c692e8b-0f9a-4f7c-8b99-061a2eb188ae/document\",\n  {\n    headers: { Authorization: `Bearer ${process.env[\"LAPYME_API_KEY\"]}` },\n    redirect: \"follow\",\n  }\n);\nif (!response.ok) throw new Error(await response.text());\nconst invoicePdf = await response.arrayBuffer();\n"
          }
        ]
      }
    },
    "/api/v1/sales/{sale_id}/returns": {
      "post": {
        "summary": "Crear nota de crédito por devolución",
        "description": "Crea una nota de crédito vinculada a una venta existente. Usá este endpoint cuando tenés un sale_id de La Pyme y querés devolver parcial o totalmente sus renglones.",
        "operationId": "createApiReturnCreditNote",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "sale_id",
            "in": "path",
            "description": "ID de la venta original",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "items"
                ],
                "properties": {
                  "items": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "sale_item_id",
                        "quantity",
                        "unit_price"
                      ],
                      "properties": {
                        "sale_item_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "product_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "uuid"
                        },
                        "warehouse_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "uuid"
                        },
                        "quantity": {
                          "type": "number",
                          "exclusiveMinimum": 0
                        },
                        "unit_price": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "discount_amount": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "minimum": 0
                        },
                        "discount_percentage": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0,
                          "maximum": 100
                        },
                        "subtotal": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "tax_amount": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        }
                      }
                    }
                  },
                  "payment_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "notes": {
                    "type": "string"
                  },
                  "refund_amounts_by_method": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "restock_inventory": {
                    "type": "boolean"
                  },
                  "integration_source": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "integration_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "auto_invoicing": {
                    "type": "boolean"
                  },
                  "skip_refund_payment": {
                    "type": "boolean"
                  },
                  "operator_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Nota de crédito creada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedObject44d57fbeb2"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pedido no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pedido no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "sales:write"
        ]
      }
    },
    "/api/v1/credit-notes": {
      "post": {
        "summary": "Crear nota de crédito independiente",
        "description": "Crea una nota de crédito independiente, asociada a un comprobante externo o a un período asociado explícitamente soportado. No usar para devoluciones de ventas internas: en ese caso usá /api/v1/sales/{sale_id}/returns.",
        "operationId": "createApiStandaloneCreditNote",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "customer_id",
                  "voucher_type",
                  "point_of_sale_id",
                  "issue_date",
                  "items"
                ],
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "currency": {
                          "const": "USD"
                        }
                      },
                      "required": [
                        "currency"
                      ]
                    },
                    "then": {
                      "required": [
                        "exchange_rate"
                      ]
                    }
                  }
                ],
                "properties": {
                  "customer_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "voucher_type": {
                    "type": "integer",
                    "enum": [
                      3,
                      8,
                      13,
                      53,
                      95,
                      100,
                      203,
                      208,
                      213
                    ],
                    "description": "AFIP credit-note voucher type."
                  },
                  "point_of_sale_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "register_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "operator_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "issue_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "cbtes_asoc": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "tipo": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "punto_venta": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "numero": {
                        "type": "integer",
                        "minimum": 1
                      }
                    }
                  },
                  "associated_period": {
                    "type": "object",
                    "description": "Associated service period. For fiscal credit notes, this can be used instead of cbtes_asoc.",
                    "properties": {
                      "desde": {
                        "type": "string",
                        "format": "date"
                      },
                      "hasta": {
                        "type": "string",
                        "format": "date"
                      }
                    }
                  },
                  "currency": {
                    "$ref": "#/components/schemas/ApiSharedEnumffb4886f2b"
                  },
                  "exchange_rate": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "description": "Exact exchange rate in ARS per USD. Required when currency is USD."
                  },
                  "cost_centers": {
                    "type": "object",
                    "properties": {
                      "cost_center_1_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "cost_center_2_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "cost_center_3_id": {
                        "type": "string",
                        "format": "uuid"
                      }
                    }
                  },
                  "items": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "quantity",
                        "unit_price",
                        "tax_rate_id"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "product_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "product_name": {
                          "type": "string"
                        },
                        "product_sku": {
                          "type": "string"
                        },
                        "product_type": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "product",
                            "combo",
                            "kit",
                            "service",
                            null
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "quantity": {
                          "type": "number",
                          "exclusiveMinimum": 0
                        },
                        "unit_price": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "tax_rate_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "is_exempt": {
                          "type": "boolean",
                          "default": false
                        },
                        "discount_percentage": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 100
                        },
                        "account_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "account_name": {
                          "type": "string"
                        },
                        "warehouse_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "cost_center_1_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "uuid"
                        },
                        "cost_center_2_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "uuid"
                        },
                        "cost_center_3_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "uuid"
                        }
                      }
                    }
                  },
                  "restock_inventory": {
                    "type": "boolean",
                    "default": false
                  },
                  "warehouse_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "notes": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Nota de crédito creada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedObject44d57fbeb2"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pedido no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pedido no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o de negocio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o de negocio",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "sales:write"
        ]
      }
    },
    "/api/v1/sales/tags/apply": {
      "post": {
        "summary": "Aplicar etiquetas a ventas",
        "description": "Agrega y/o remueve etiquetas de scope `sale` en un lote de ventas.",
        "operationId": "applyApiSaleTags",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiApplyTagsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Etiquetas aplicadas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiApplyTagsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_sale_tags_apply_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid request for applying tags to sales",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_sale_tags_apply_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_sale_tags_apply_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_sale_tags_apply_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not apply tags to sales",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "sales:write"
        ]
      }
    },
    "/api/v1/customer-payments": {
      "get": {
        "summary": "Listar cobranzas de clientes",
        "description": "Lista cobranzas de clientes con búsqueda, filtro por fecha, estado y paginación por cursor.",
        "operationId": "listApiCustomerPayments",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por cliente, número de cobranza o método de pago",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Estado de la cobranza",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnum8ef2575a44"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "description": "Fecha inicial en formato YYYY-MM-DD",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "description": "Fecha final en formato YYYY-MM-DD",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cobranzas obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCustomerPaymentListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_customer_payments_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid customer payments query parameters",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "payments:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:read"
          ]
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst payments = await lapyme.customerPayments.listCustomerPayments({\n  limit: 20,\n  dateFrom: new Date(\"2026-03-01\"),\n  dateTo: new Date(\"2026-03-31\"),\n});\n"
          }
        ]
      },
      "post": {
        "summary": "Crear cobranza de cliente",
        "description": "Registra una cobranza de cliente con uno o más métodos de pago, aplicaciones a ventas o cuenta corriente, retenciones y datos de cheque cuando corresponde.",
        "operationId": "createApiCustomerPayment",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCustomerPaymentCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cobranza creada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCustomerPaymentCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_customer_payment_create_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid customer payment payload",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "payments:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:write"
          ]
        ]
      }
    },
    "/api/v1/customer-payments/{payment_id}": {
      "get": {
        "summary": "Obtener cobranza de cliente",
        "description": "Obtiene una cobranza de cliente por ID.",
        "operationId": "getApiCustomerPayment",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "payment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cobranza obtenida exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCustomerPaymentDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "ID inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "ID inválido",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Cobranza no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Cobranza no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "payments:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:read"
          ]
        ]
      }
    },
    "/api/v1/customer-payments/{payment_id}/void": {
      "post": {
        "summary": "Anular cobranza de cliente",
        "description": "Anula una cobranza de cliente existente por ID.",
        "operationId": "voidApiCustomerPayment",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "payment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cobranza anulada exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCustomerPaymentVoidResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Cobranza no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Cobranza no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "payments:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "sales:write"
          ]
        ]
      }
    },
    "/api/v1/supplier-payments": {
      "get": {
        "summary": "Listar pagos a proveedores",
        "description": "Lista pagos a proveedores con búsqueda, filtro por fecha, estado y paginación por cursor.",
        "operationId": "listApiSupplierPayments",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por proveedor, número de pago o método de pago",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Estado del pago",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnum8ef2575a44"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "description": "Fecha inicial en formato YYYY-MM-DD",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "description": "Fecha final en formato YYYY-MM-DD",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pagos obtenidos exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSupplierPaymentListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "payments:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "purchases:read"
          ]
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst payments = await lapyme.supplierPayments.listSupplierPayments({\n  limit: 20,\n  dateFrom: new Date(\"2026-03-01\"),\n  dateTo: new Date(\"2026-03-31\"),\n});\n"
          }
        ]
      },
      "post": {
        "summary": "Crear pago a proveedor",
        "description": "Registra un pago a proveedor con uno o más métodos de pago, aplicaciones a compras o cuenta corriente, retenciones y datos de cheque cuando corresponde.",
        "operationId": "createApiSupplierPayment",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiSupplierPaymentCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pago creado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSupplierPaymentCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "payments:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "purchases:write"
          ]
        ]
      }
    },
    "/api/v1/supplier-payments/{payment_id}": {
      "get": {
        "summary": "Obtener pago a proveedor",
        "description": "Obtiene un pago a proveedor por ID.",
        "operationId": "getApiSupplierPayment",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "payment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pago obtenido exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSupplierPaymentDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "ID inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "ID inválido",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pago no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pago no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "payments:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "purchases:read"
          ]
        ]
      },
      "put": {
        "summary": "Actualizar pago a proveedor",
        "description": "Actualiza un pago a proveedor existente y devuelve el detalle persistido. Requiere Idempotency-Key.",
        "operationId": "updateApiSupplierPayment",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "payment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiSupplierPaymentUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pago actualizado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSupplierPaymentUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pago no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pago no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "payments:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "purchases:write"
          ]
        ]
      }
    },
    "/api/v1/supplier-payments/{payment_id}/void": {
      "post": {
        "summary": "Anular pago a proveedor",
        "description": "Anula un pago a proveedor existente por ID.",
        "operationId": "voidApiSupplierPayment",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "payment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pago anulado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSupplierPaymentVoidResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pago no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Pago no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "payments:write"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "purchases:write"
          ]
        ]
      }
    },
    "/api/v1/payment-methods": {
      "get": {
        "summary": "Listar métodos de pago",
        "description": "Lista los métodos de pago operativos para ventas. Devuelve solo métodos activos por defecto.",
        "operationId": "listApiPaymentMethods",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por nombre",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "description": "Filtra por estado activo. Si se omite, el endpoint usa true por defecto.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Métodos de pago obtenidos exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPaymentMethodListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_payment_methods_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for listing payment methods",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_payment_methods_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_payment_methods_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_payment_methods_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list payment methods",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "payment_methods:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst paymentMethods = await lapyme.paymentMethods.list({\n  limit: 20,\n});\n"
          }
        ]
      },
      "post": {
        "summary": "Crear método de pago",
        "description": "Crea un método de pago para registrar cobros y pagos.",
        "operationId": "createApiPaymentMethod",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiPaymentMethodMutationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Método de pago creado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPaymentMethodCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "payment_methods:write"
        ]
      }
    },
    "/api/v1/payment-methods/{payment_method_id}": {
      "get": {
        "summary": "Obtener método de pago",
        "description": "Obtiene un método de pago por ID.",
        "operationId": "getApiPaymentMethod",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "payment_method_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Método de pago obtenido exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPaymentMethodDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Parámetros inválidos",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Método de pago no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Método de pago no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "payment_methods:read"
        ]
      },
      "put": {
        "summary": "Actualizar método de pago",
        "description": "Actualiza el nombre, estado o configuración contable de un método de pago.",
        "operationId": "updateApiPaymentMethod",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "payment_method_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiPaymentMethodMutationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Método de pago actualizado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPaymentMethodUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Método de pago no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Método de pago no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "payment_methods:write"
        ]
      }
    },
    "/api/v1/cash-sources": {
      "get": {
        "summary": "Listar cajas para efectivo",
        "description": "Lista las cajas operativas y cajas fuertes accesibles para registrar pagos en efectivo en ventas.",
        "operationId": "listApiCashSources",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por nombre, ubicación o punto de venta",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Tipo de caja a devolver. Puede repetirse o enviarse separado por comas.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiSharedEnum1579b1abf3"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "types",
            "in": "query",
            "description": "Alias plural de type.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiSharedEnum1579b1abf3"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "include_inactive",
            "in": "query",
            "description": "Incluye cajas inactivas",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cajas obtenidas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCashSourceListResponse"
                },
                "examples": {
                  "cash_sources": {
                    "summary": "Cajas para pagos en efectivo",
                    "value": {
                      "request_id": "req_cash_sources_1",
                      "object": "list",
                      "url": "/api/v1/cash-sources",
                      "data": [
                        {
                          "object": "cash_source",
                          "id": "550e8400-e29b-41d4-a716-446655440701",
                          "type": "register",
                          "name": "Caja mostrador",
                          "currency": "ARS",
                          "warehouse_id": "550e8400-e29b-41d4-a716-446655440010",
                          "warehouse_name": "Local",
                          "default_point_of_sale_id": "550e8400-e29b-41d4-a716-446655440002",
                          "default_point_of_sale_name": "Mostrador",
                          "is_active": true,
                          "created_at": "2026-04-10T10:00:00.000Z",
                          "updated_at": "2026-04-10T10:00:00.000Z"
                        },
                        {
                          "object": "cash_source",
                          "id": "550e8400-e29b-41d4-a716-446655440702",
                          "type": "safe",
                          "name": "Caja fuerte",
                          "currency": "ARS",
                          "warehouse_id": null,
                          "warehouse_name": null,
                          "default_point_of_sale_id": null,
                          "default_point_of_sale_name": null,
                          "is_active": true,
                          "created_at": "2026-04-10T10:00:00.000Z",
                          "updated_at": "2026-04-10T10:00:00.000Z"
                        }
                      ],
                      "has_more": false,
                      "next_cursor": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_cash_sources_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for listing cash sources",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scopes insuficientes",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_cash_sources_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list cash sources",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "sales:read"
        ]
      }
    },
    "/api/v1/points-of-sale": {
      "get": {
        "summary": "Listar puntos de venta",
        "description": "Lista los puntos de venta accesibles para la API key autenticada.",
        "operationId": "listApiPointsOfSale",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por nombre o número",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_inactive",
            "in": "query",
            "description": "Incluye puntos de venta inactivos",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Puntos de venta obtenidos exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPointOfSaleListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_points_of_sale_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for listing points of sale",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_points_of_sale_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_points_of_sale_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_points_of_sale_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list points of sale",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "sales:read"
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst pointsOfSale = await lapyme.pointsOfSale.listPointsOfSale({\n  limit: 20,\n});\n"
          }
        ]
      }
    },
    "/api/v1/inventory": {
      "get": {
        "summary": "Consultar inventario por depósito",
        "description": "Devuelve el inventario de un depósito específico con filtros por categoría, tipo y cantidades.",
        "operationId": "listApiInventory",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "warehouse_id",
            "in": "query",
            "description": "ID del depósito a consultar",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Texto de búsqueda por producto, SKU, código de barras o variante",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category_ids",
            "in": "query",
            "description": "IDs de categorías. Puede repetirse o enviarse separada por comas.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "product_types",
            "in": "query",
            "description": "Tipos de producto. Puede repetirse o enviarse separada por comas.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ApiSharedEnum5c962a8637"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "available_rule",
            "in": "query",
            "description": "Regla para el filtro de stock disponible",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnuma4e4082638"
            }
          },
          {
            "name": "available_amount",
            "in": "query",
            "description": "Cantidad exacta cuando availableRule=equal",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "available_min",
            "in": "query",
            "description": "Cantidad mínima cuando availableRule=between",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "available_max",
            "in": "query",
            "description": "Cantidad máxima cuando availableRule=between",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "on_hand_rule",
            "in": "query",
            "description": "Regla para el filtro de stock físico",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnuma4e4082638"
            }
          },
          {
            "name": "on_hand_amount",
            "in": "query",
            "description": "Cantidad exacta cuando onHandRule=equal",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "on_hand_min",
            "in": "query",
            "description": "Cantidad mínima cuando onHandRule=between",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "on_hand_max",
            "in": "query",
            "description": "Cantidad máxima cuando onHandRule=between",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "reserved_rule",
            "in": "query",
            "description": "Regla para el filtro de stock reservado",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnuma4e4082638"
            }
          },
          {
            "name": "reserved_amount",
            "in": "query",
            "description": "Cantidad exacta cuando reservedRule=equal",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "reserved_min",
            "in": "query",
            "description": "Cantidad mínima cuando reservedRule=between",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "reserved_max",
            "in": "query",
            "description": "Cantidad máxima cuando reservedRule=between",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "incoming_rule",
            "in": "query",
            "description": "Regla para el filtro de stock entrante",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnuma4e4082638"
            }
          },
          {
            "name": "incoming_amount",
            "in": "query",
            "description": "Cantidad exacta cuando incomingRule=equal",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "incoming_min",
            "in": "query",
            "description": "Cantidad mínima cuando incomingRule=between",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "incoming_max",
            "in": "query",
            "description": "Cantidad máxima cuando incomingRule=between",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Inventario obtenido exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiInventoryListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_inventory_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for querying inventory",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_inventory_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_inventory_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Depósito no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "NOT_FOUND",
                    "value": {
                      "request_id": "req_inventory_1",
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Warehouse not found",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_inventory_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not query inventory",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "inventory:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "products:read",
            "warehouses:read"
          ]
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst inventory = await lapyme.inventory.listInventory({\n  warehouseId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n  limit: 20,\n  query: \"remera\",\n});\n"
          }
        ]
      }
    },
    "/api/v1/inventory/movements": {
      "get": {
        "summary": "Listar movimientos de inventario",
        "description": "Lista el historial de movimientos de inventario del producto, opcionalmente filtrado por depósito.",
        "operationId": "listApiInventoryMovements",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "product_id",
            "in": "query",
            "description": "ID de producto o variante",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "warehouse_id",
            "in": "query",
            "description": "Filtra por depósito",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Movimientos obtenidos exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiInventoryMovementListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Parámetros inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_inventory_movements_1",
                      "error": {
                        "code": "INVALID_REQUEST",
                        "message": "Invalid parameters for listing inventory movements",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "AUTHENTICATION_REQUIRED",
                    "value": {
                      "request_id": "req_inventory_movements_1",
                      "error": {
                        "code": "AUTHENTICATION_REQUIRED",
                        "message": "API key is required in the Authorization header",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scopes insuficientes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "FORBIDDEN",
                    "value": {
                      "request_id": "req_inventory_movements_1",
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Your API key does not have permission for this operation",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INTERNAL_ERROR",
                    "value": {
                      "request_id": "req_inventory_movements_1",
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "message": "Could not list inventory movements",
                        "retryable": false,
                        "type": "invalid_request_error",
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "stock_movements:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "inventory:read"
          ],
          [
            "products:read"
          ]
        ],
        "x-codeSamples": [
          {
            "lang": "typescript",
            "label": "La Pyme SDK",
            "source": "import { Lapyme } from \"lapyme\";\n\nconst lapyme = new Lapyme({\n  bearerAuth: process.env[\"LAPYME_API_KEY\"] ?? \"\",\n});\n\nconst movements = await lapyme.inventory.listInventoryMovements({\n  limit: 20,\n  productId: \"9c692e8b-0f9a-4f7c-8b99-061a2eb188ae\",\n});\n"
          }
        ]
      }
    },
    "/api/v1/accounting/accounts": {
      "get": {
        "summary": "Listar cuentas contables",
        "description": "Lista el plan de cuentas disponible para asientos y reportes contables.",
        "operationId": "listApiAccountingAccounts",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "include_inactive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "is_postable",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnum5433445ffc"
            }
          },
          {
            "name": "parent_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "system_role",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnum87e38e3147"
            }
          },
          {
            "name": "is_inflation_adjustable",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cuentas listadas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request_id": {
                      "type": "string"
                    },
                    "object": {
                      "$ref": "#/components/schemas/ApiSharedEnume0cf0306aa"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiAccountingAccount"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "reports:read"
          ]
        ]
      },
      "post": {
        "summary": "Crear cuenta contable",
        "description": "Crea una cuenta contable y permite configurar system_role e is_inflation_adjustable en el recurso cuenta.",
        "operationId": "createApiAccountingAccount",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiAccountingAccountCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cuenta devuelta por replay idempotente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiAccountingAccountWriteResponse"
                }
              }
            }
          },
          "201": {
            "description": "Cuenta creada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiAccountingAccountWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de configuración contable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de configuración contable",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:write"
        ]
      }
    },
    "/api/v1/accounting/accounts/{account_id}": {
      "get": {
        "summary": "Obtener cuenta contable",
        "description": "Devuelve una cuenta contable visible de la organización autenticada por su ID.",
        "operationId": "getApiAccountingAccount",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cuenta encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/ApiAccountingAccount"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Cuenta no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Cuenta no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "reports:read"
          ]
        ]
      },
      "patch": {
        "summary": "Actualizar cuenta contable",
        "description": "Actualiza parcialmente metadatos y configuración de una cuenta contable, incluyendo system_role e is_inflation_adjustable.",
        "operationId": "updateApiAccountingAccount",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiAccountingAccountPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cuenta actualizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiAccountingAccountWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Cuenta no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Cuenta no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de configuración contable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de configuración contable",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:write"
        ]
      },
      "delete": {
        "summary": "Desactivar cuenta contable",
        "description": "Desactiva una cuenta contable sin borrar sus referencias históricas. Si la cuenta tenía system_role, el rol se limpia para mantener válida la configuración.",
        "operationId": "deactivateApiAccountingAccount",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cuenta desactivada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiAccountingAccountWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Cuenta no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Cuenta no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de configuración contable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de configuración contable",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:write"
        ]
      }
    },
    "/api/v1/accounting/cost-center-dimensions": {
      "get": {
        "summary": "Listar dimensiones de centros de costo",
        "description": "Lista las dimensiones de centros de costo disponibles y permite incluir dimensiones inactivas.",
        "operationId": "listApiCostCenterDimensions",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "include_inactive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dimensiones listadas exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request_id": {
                      "type": "string"
                    },
                    "object": {
                      "$ref": "#/components/schemas/ApiSharedEnume0cf0306aa"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiCostCenterDimension"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "reports:read"
          ]
        ]
      }
    },
    "/api/v1/accounting/cost-centers": {
      "get": {
        "summary": "Listar centros de costo",
        "description": "Lista centros de costo y permite filtrar por dimensión, posición y estado activo.",
        "operationId": "listApiCostCenters",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "dimension_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "position",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 3
            }
          },
          {
            "name": "include_inactive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Centros de costo listados exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request_id": {
                      "type": "string"
                    },
                    "object": {
                      "$ref": "#/components/schemas/ApiSharedEnume0cf0306aa"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiCostCenter"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "reports:read"
          ]
        ]
      }
    },
    "/api/v1/accounting/trial-balance": {
      "get": {
        "summary": "Obtener sumas y saldos",
        "description": "Calcula sumas y saldos para el período y los filtros contables solicitados.",
        "operationId": "getApiTrialBalance",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "description": "Fecha inicial del período. Obligatoria junto con date_to si no se envía period_preset.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "description": "Fecha final inclusiva del período. Obligatoria junto con date_from si no se envía period_preset.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "period_preset",
            "in": "query",
            "required": false,
            "description": "Atajo de período resuelto por la API a date_from/date_to en horario de Argentina. No enviarlo junto con date_from/date_to.",
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumab9ba78640"
            }
          },
          {
            "name": "cost_center_1_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "cost_center_2_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "cost_center_3_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "circuit_id",
            "in": "query",
            "required": false,
            "description": "Circuito contable del reporte: `general`, el id de un circuito de la organización (ver `accounting_circuits` en GET /api/v1/organization), o `all`. Omitido es `all`, todos los circuitos. Un id que no es de la organización devuelve 400 `circuit_not_found`.",
            "schema": {
              "type": "string",
              "default": "all"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sumas y saldos obtenido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedObject1923b260ad"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "reports:read"
          ]
        ]
      }
    },
    "/api/v1/accounting/accounts-receivable": {
      "get": {
        "summary": "Obtener cuentas a cobrar",
        "description": "Saldos abiertos de clientes por tramo de vencimiento: cuánto le deben a la organización y desde cuándo. Los tramos se miden contra hoy; las fechas filtran por fecha del comprobante. Un miembro ve lo que su visibilidad de datos le permite en la app.",
        "operationId": "getApiAccountsReceivable",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "circuit_id",
            "in": "query",
            "required": false,
            "description": "Circuito contable del reporte: `general`, el id de un circuito de la organización (ver `accounting_circuits` en GET /api/v1/organization), o `all`. Omitido es `all`, todos los circuitos. Un id que no es de la organización devuelve 400 `circuit_not_found`.",
            "schema": {
              "type": "string",
              "default": "all"
            }
          },
          {
            "name": "contact_id",
            "in": "query",
            "required": false,
            "description": "Limita el reporte a un cliente o proveedor.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "description": "Fecha inicial inclusiva del comprobante (no del vencimiento). Los tramos se miden siempre contra hoy: no devuelve una foto a esa fecha.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "description": "Fecha final inclusiva del comprobante (no del vencimiento). Los tramos se miden siempre contra hoy: no devuelve una foto a esa fecha.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "include_items",
            "in": "query",
            "required": false,
            "description": "Incluye los comprobantes abiertos de cada contacto. Sin esto devuelve un total por contacto y por tramo.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cuentas a cobrar obtenidas",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedObjectb1775d2f55"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "reports:read"
          ]
        ]
      }
    },
    "/api/v1/accounting/accounts-payable": {
      "get": {
        "summary": "Obtener cuentas a pagar",
        "description": "Saldos abiertos con proveedores por tramo de vencimiento: cuánto debe la organización y desde cuándo. Los tramos se miden contra hoy; las fechas filtran por fecha del comprobante. Un miembro ve lo que su visibilidad de datos le permite en la app.",
        "operationId": "getApiAccountsPayable",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "circuit_id",
            "in": "query",
            "required": false,
            "description": "Circuito contable del reporte: `general`, el id de un circuito de la organización (ver `accounting_circuits` en GET /api/v1/organization), o `all`. Omitido es `all`, todos los circuitos. Un id que no es de la organización devuelve 400 `circuit_not_found`.",
            "schema": {
              "type": "string",
              "default": "all"
            }
          },
          {
            "name": "contact_id",
            "in": "query",
            "required": false,
            "description": "Limita el reporte a un cliente o proveedor.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "description": "Fecha inicial inclusiva del comprobante (no del vencimiento). Los tramos se miden siempre contra hoy: no devuelve una foto a esa fecha.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "description": "Fecha final inclusiva del comprobante (no del vencimiento). Los tramos se miden siempre contra hoy: no devuelve una foto a esa fecha.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "include_items",
            "in": "query",
            "required": false,
            "description": "Incluye los comprobantes abiertos de cada contacto. Sin esto devuelve un total por contacto y por tramo.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cuentas a pagar obtenidas",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedObjectb1775d2f55"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "reports:read"
          ]
        ]
      }
    },
    "/api/v1/accounting/income-statement": {
      "get": {
        "summary": "Obtener estado de resultados",
        "description": "Calcula el estado de resultados para un período en la moneda de reporte solicitada.",
        "operationId": "getApiIncomeStatement",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "description": "Fecha inicial del período. Obligatoria junto con date_to si no se envía period_preset.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "description": "Fecha final inclusiva del período. Obligatoria junto con date_from si no se envía period_preset.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "period_preset",
            "in": "query",
            "required": false,
            "description": "Atajo de período resuelto por la API a date_from/date_to en horario de Argentina. No enviarlo junto con date_from/date_to.",
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumab9ba78640"
            }
          },
          {
            "name": "cost_center_1_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "cost_center_2_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "cost_center_3_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "circuit_id",
            "in": "query",
            "required": false,
            "description": "Circuito contable del reporte: `general`, el id de un circuito de la organización (ver `accounting_circuits` en GET /api/v1/organization), o `all`. Omitido es `all`, todos los circuitos. Un id que no es de la organización devuelve 400 `circuit_not_found`.",
            "schema": {
              "type": "string",
              "default": "all"
            }
          },
          {
            "name": "reporting_currency",
            "in": "query",
            "required": false,
            "description": "Moneda de presentación del estado de resultados. ARS devuelve importes en pesos argentinos; USD convierte los importes contables ARS a USD usando cotización BCRA por fecha de transacción.",
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumc519f4ab77"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Estado de resultados obtenido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedObject1923b260ad"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "reports:read"
          ]
        ]
      }
    },
    "/api/v1/accounting/income-statement/comparative": {
      "get": {
        "summary": "Obtener estado de resultados comparativo",
        "description": "Compara el estado de resultados de dos períodos con los mismos criterios de moneda y agrupación.",
        "operationId": "getApiComparativeIncomeStatement",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "description": "Fecha inicial del período. Obligatoria junto con date_to si no se envía period_preset.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "description": "Fecha final inclusiva del período. Obligatoria junto con date_from si no se envía period_preset.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "period_preset",
            "in": "query",
            "required": false,
            "description": "Atajo de período resuelto por la API a date_from/date_to en horario de Argentina. No enviarlo junto con date_from/date_to.",
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumab9ba78640"
            }
          },
          {
            "name": "cost_center_1_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "cost_center_2_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "cost_center_3_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "circuit_id",
            "in": "query",
            "required": false,
            "description": "Circuito contable del reporte: `general`, el id de un circuito de la organización (ver `accounting_circuits` en GET /api/v1/organization), o `all`. Omitido es `all`, todos los circuitos. Un id que no es de la organización devuelve 400 `circuit_not_found`.",
            "schema": {
              "type": "string",
              "default": "all"
            }
          },
          {
            "name": "reporting_currency",
            "in": "query",
            "required": false,
            "description": "Moneda de presentación del estado de resultados. ARS devuelve importes en pesos argentinos; USD convierte los importes contables ARS a USD usando cotización BCRA por fecha de transacción.",
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumc519f4ab77"
            }
          },
          {
            "name": "compare_date_from",
            "in": "query",
            "required": false,
            "description": "Fecha inicial del período de comparación. Obligatoria junto con compare_date_to si compare_enabled=true y no se envía compare_period_preset.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_date_to",
            "in": "query",
            "required": false,
            "description": "Fecha final inclusiva del período de comparación. Obligatoria junto con compare_date_from si compare_enabled=true y no se envía compare_period_preset.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_period_preset",
            "in": "query",
            "required": false,
            "description": "Atajo para el período de comparación. No enviarlo junto con compare_date_from/compare_date_to.",
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumab9ba78640"
            }
          },
          {
            "name": "compare_enabled",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comparativo obtenido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedObject1923b260ad"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "reports:read"
          ]
        ]
      }
    },
    "/api/v1/accounting/income-statement/by-cost-center": {
      "get": {
        "summary": "Obtener estado de resultados por centro de costo",
        "description": "Calcula el estado de resultados agrupado por la posición de centro de costo solicitada.",
        "operationId": "getApiIncomeStatementByCostCenter",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "description": "Fecha inicial del período. Obligatoria junto con date_to si no se envía period_preset.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "description": "Fecha final inclusiva del período. Obligatoria junto con date_from si no se envía period_preset.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "period_preset",
            "in": "query",
            "required": false,
            "description": "Atajo de período resuelto por la API a date_from/date_to en horario de Argentina. No enviarlo junto con date_from/date_to.",
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumab9ba78640"
            }
          },
          {
            "name": "cost_center_1_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "cost_center_2_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "cost_center_3_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "circuit_id",
            "in": "query",
            "required": false,
            "description": "Circuito contable del reporte: `general`, el id de un circuito de la organización (ver `accounting_circuits` en GET /api/v1/organization), o `all`. Omitido es `all`, todos los circuitos. Un id que no es de la organización devuelve 400 `circuit_not_found`.",
            "schema": {
              "type": "string",
              "default": "all"
            }
          },
          {
            "name": "reporting_currency",
            "in": "query",
            "required": false,
            "description": "Moneda de presentación del estado de resultados. ARS devuelve importes en pesos argentinos; USD convierte los importes contables ARS a USD usando cotización BCRA por fecha de transacción.",
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumc519f4ab77"
            }
          },
          {
            "name": "group_by_cost_center_position",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 3,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reporte por centro de costo obtenido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedObject1923b260ad"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "reports:read"
          ]
        ]
      }
    },
    "/api/v1/accounting/summarized-journal": {
      "get": {
        "summary": "Listar libro diario resumido",
        "description": "Lista asientos del libro diario en formato resumido con filtros y paginación por cursor.",
        "operationId": "listApiSummarizedJournal",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "description": "Fecha inicial del período. Obligatoria junto con date_to si no se envía period_preset.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "description": "Fecha final inclusiva del período. Obligatoria junto con date_from si no se envía period_preset.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "period_preset",
            "in": "query",
            "required": false,
            "description": "Atajo de período resuelto por la API a date_from/date_to en horario de Argentina. No enviarlo junto con date_from/date_to.",
            "schema": {
              "$ref": "#/components/schemas/ApiSharedEnumab9ba78640"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "circuit_id",
            "in": "query",
            "required": false,
            "description": "Circuito contable del reporte: `general`, el id de un circuito de la organización (ver `accounting_circuits` en GET /api/v1/organization), o `all`. Omitido es `all`, todos los circuitos. Un id que no es de la organización devuelve 400 `circuit_not_found`.",
            "schema": {
              "type": "string",
              "default": "all"
            }
          },
          {
            "name": "source_types",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "newest",
                "oldest"
              ],
              "default": "oldest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Libro diario resumido listado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiJournalEntriesListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "reports:read"
          ]
        ]
      }
    },
    "/api/v1/accounting/inflation-adjustments/preview": {
      "post": {
        "summary": "Previsualizar ajuste por inflación",
        "description": "Calcula en el servidor una previsualización mensual auditable. La clasificación configurada se usa cuando no se envía un reemplazo; los saldos iniciales requieren un cierre anterior vigente o meses de origen explícitos. Los reemplazos de índices oficiales requieren un motivo.",
        "operationId": "previewApiInflationAdjustment",
        "tags": [
          "API"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiInflationAdjustmentPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Previsualización generada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSharedObject1923b260ad"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:write"
        ]
      }
    },
    "/api/v1/accounting/inflation-adjustments": {
      "post": {
        "summary": "Crear ajuste por inflación",
        "description": "Recalcula y crea de forma idempotente el asiento mensual para el período solicitado. Los importes se calculan en el servidor y no se aceptan líneas calculadas por el cliente.",
        "operationId": "createApiInflationAdjustment",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiInflationAdjustmentCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Repetición idempotente del ajuste existente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiJournalEntryWriteResponse"
                }
              }
            }
          },
          "201": {
            "description": "Ajuste por inflación creado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiJournalEntryWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Ajuste duplicado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Ajuste duplicado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:write"
        ]
      }
    },
    "/api/v1/accounting/journal-entries": {
      "get": {
        "summary": "Listar asientos contables",
        "description": "Lista asientos contables publicados con filtros por origen, cuenta y fecha. Usá `source_type` y `source_id` para pasar desde una venta o compra a su evidencia contable.",
        "operationId": "listApiAccountingJournalEntries",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Valor de next_cursor recibido en la respuesta anterior",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Cantidad máxima de resultados por respuesta",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "source_type",
            "in": "query",
            "description": "Tipo de origen contable, por ejemplo sale o purchase",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source_id",
            "in": "query",
            "description": "ID del recurso de origen",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "description": "Filtra asientos que tengan al menos una línea en esta cuenta",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "description": "Fecha inicial del asiento",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "description": "Fecha final del asiento",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "circuit_id",
            "in": "query",
            "required": false,
            "description": "Circuito contable del reporte: `general`, el id de un circuito de la organización (ver `accounting_circuits` en GET /api/v1/organization), o `all`. Omitido es `all`, todos los circuitos. Un id que no es de la organización devuelve 400 `circuit_not_found`.",
            "schema": {
              "type": "string",
              "default": "all"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Asientos contables listados exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiJournalEntriesListResponse"
                },
                "examples": {
                  "sale_drilldown": {
                    "summary": "Asientos de una venta",
                    "value": {
                      "request_id": "req_accounting_1",
                      "effective_scope": "all",
                      "object": "list",
                      "url": "/api/v1/accounting/journal-entries",
                      "data": [
                        {
                          "object": "journal_entry",
                          "id": "550e8400-e29b-41d4-a716-446655440301",
                          "entry_number": 12,
                          "date": "2026-05-26",
                          "description": "Venta FCB-00003-00001234",
                          "reference": "FCB-00003-00001234",
                          "source_type": "sale",
                          "source_id": "550e8400-e29b-41d4-a716-446655440007",
                          "currency": "ARS",
                          "exchange_rate": null,
                          "created_at": "2026-05-26T12:00:00.000Z",
                          "updated_at": "2026-05-26T12:00:00.000Z",
                          "lines": []
                        }
                      ],
                      "has_more": false,
                      "next_cursor": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "reports:read"
          ]
        ]
      },
      "post": {
        "summary": "Crear asiento manual",
        "description": "Crea un asiento contable manual balanceado. Requiere Idempotency-Key.",
        "operationId": "createApiManualJournalEntry",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiManualJournalEntryRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Asiento manual creado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiJournalEntryWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicto de idempotencia o asiento no editable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de idempotencia o asiento no editable",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:write"
        ]
      }
    },
    "/api/v1/accounting/journal-entries/{journal_entry_id}": {
      "get": {
        "summary": "Obtener asiento contable",
        "description": "Devuelve el encabezado y las líneas completas de un asiento contable.",
        "operationId": "getApiAccountingJournalEntry",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "journal_entry_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Asiento contable encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/ApiJournalEntry"
                    }
                  }
                },
                "examples": {}
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Asiento no encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Asiento no encontrado",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "reports:read"
          ]
        ]
      },
      "put": {
        "summary": "Reemplazar asiento manual",
        "description": "Reemplaza un asiento manual editable y conserva las líneas identificadas por id. Si una línea imputada cambia financieramente, la primera solicitud devuelve allocations_require_unapply; repetí con un nuevo Idempotency-Key y unapply_allocated_lines=true para desimputar y editar en una sola transacción. Los asientos generados devuelven conflicto.",
        "operationId": "updateApiManualJournalEntry",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "journal_entry_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiManualJournalEntryUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Asiento manual actualizado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiJournalEntryWriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Asiento no editable, conflicto de idempotencia o confirmación de desimputación requerida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Asiento no editable, conflicto de idempotencia o confirmación de desimputación requerida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Conflicto de concurrencia",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Conflicto de concurrencia",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:write"
        ]
      },
      "delete": {
        "summary": "Eliminar asiento manual",
        "description": "Elimina solo asientos manuales editables.",
        "operationId": "deleteApiManualJournalEntry",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "journal_entry_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Clave estable para deduplicar reintentos de la misma operación.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Asiento manual eliminado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Asiento no editable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Asiento no editable",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:write"
        ]
      }
    },
    "/api/v1/accounting/accounts/{account_id}/ledger": {
      "get": {
        "summary": "Obtener mayor de cuenta",
        "description": "Devuelve líneas del mayor para una cuenta, con saldo inicial, saldo final y saldo corriente por línea dentro de la ventana filtrada.",
        "operationId": "getApiAccountLedger",
        "tags": [
          "API"
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "source_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contact_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cost_center_1_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "cost_center_2_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "cost_center_3_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "circuit_id",
            "in": "query",
            "required": false,
            "description": "Circuito contable del reporte: `general`, el id de un circuito de la organización (ver `accounting_circuits` en GET /api/v1/organization), o `all`. Omitido es `all`, todos los circuitos. Un id que no es de la organización devuelve 400 `circuit_not_found`.",
            "schema": {
              "type": "string",
              "default": "all"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Mayor de cuenta encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiAccountLedgerResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Mayor de clientes por cobrar",
                    "value": {
                      "request_id": "req_ledger_1",
                      "effective_scope": "all",
                      "data": {
                        "object": "account_ledger",
                        "account": {
                          "object": "account",
                          "id": "550e8400-e29b-41d4-a716-446655440303",
                          "code": "1.1.2",
                          "name": "Clientes por cobrar"
                        },
                        "opening_balance": 0,
                        "currency": "ARS",
                        "lines": [],
                        "closing_balance": 0,
                        "has_more": false,
                        "next_cursor": null
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Solicitud inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API key faltante o inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "API key faltante o inválida",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope insuficiente o contabilidad no habilitada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Scope insuficiente o contabilidad no habilitada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Cuenta no encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Cuenta no encontrada",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límite de solicitudes excedido para la organización",
            "headers": {
              "Retry-After": {
                "description": "Segundos a esperar antes de volver a intentar la solicitud.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Límite de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Segundos restantes hasta el reset de la ventana activa.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              },
              "RateLimit-Limit": {
                "description": "Límite de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "5000"
                }
              },
              "RateLimit-Remaining": {
                "description": "Solicitudes restantes en la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "0"
                }
              },
              "RateLimit-Reset": {
                "description": "Segundos hasta el reset de la ventana activa en formato estándar.",
                "schema": {
                  "type": "string",
                  "example": "30"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "RATE_LIMITED",
                    "value": {
                      "request_id": "req_rate_limit_1",
                      "error": {
                        "type": "rate_limit_error",
                        "code": "RATE_LIMITED",
                        "message": "The organization request limit was reached. Try again later.",
                        "retryable": true,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error interno del servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                },
                "examples": {
                  "default": {
                    "summary": "INVALID_REQUEST",
                    "value": {
                      "request_id": "req_error_1",
                      "error": {
                        "type": "invalid_request_error",
                        "code": "INVALID_REQUEST",
                        "message": "Error interno del servidor",
                        "retryable": false,
                        "details": []
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "accounting:read"
        ],
        "x-accepted-legacy-scope-sets": [
          [
            "reports:read"
          ]
        ]
      }
    }
  }
}