> ## Documentation Index
> Fetch the complete documentation index at: https://docs.y.uno/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# Crear cotización de impuestos

> Cotiza el impuesto de una suscripción de Stripe Billing para la dirección y la identificación fiscal del cliente antes del pago

Cotiza el impuesto del primer pago de una suscripción de Stripe Billing, para la dirección de facturación del cliente y, en el caso de una empresa, su identificación fiscal. La cotización usa Stripe Tax con los registros de tu cuenta de Stripe. Consulta [Precio local e impuestos](https://docs.y.uno/es/docs/payment-features/subscriptions/local-price-and-taxes.md).

> [!NOTE]
>
> **Habilitado por organización**
>
> El cobro de impuestos se habilita por organización y necesita el onboarding de Stripe Billing con Stripe Tax activo. Contacta a tu Key Account Manager (KAM) para habilitarlo.

* Vuelve a cotizar cada vez que cambien el país, el código postal o la identificación fiscal. Una cotización es válida por 30 minutos.
* El código postal es obligatorio para Estados Unidos y Canadá. Los demás países solo necesitan el país.
* Cobra `total` y envía cada línea de la cotización en `additional_data.order.taxes` del pago con `source: YUNO_TAX_QUOTE` y el `tax_quote_id` (`tax_base` es el `taxable_amount` de la línea). Después de que el pago es aprobado, Yuno crea la suscripción en Stripe con el mismo impuesto en su primera factura.
* `status` es `NO_TAX` cuando no se aplica ningún impuesto (`no_tax_reason` indica el motivo, por ejemplo `REVERSE_CHARGE` para una empresa con una identificación fiscal válida, o `NOT_SUBJECT_TO_TAX` cuando tu cuenta de Stripe no tiene registro).


## OpenAPI

````yaml openapi/taxes/create-tax-quote.json POST /taxes/quote
openapi: 3.0.1
info:
  title: Yuno Taxes API
  version: '1.0'
servers:
  - url: https://api-sandbox.y.uno/v1
  - url: https://api.y.uno/v1
security: []
paths:
  /taxes/quote:
    post:
      summary: Create tax quote
      description: >-
        Quotes the tax of a Stripe Billing subscription for the customer's
        address and optional tax ID, with Stripe Tax. Use the returned
        `tax_quote_id` in the tax line of the payment, and charge `total`. A
        quote is valid for 30 minutes.
      operationId: create-tax-quote
      parameters:
        - in: header
          name: PUBLIC-API-KEY
          required: true
          schema:
            type: string
          description: Your public API key.
        - in: header
          name: PRIVATE-SECRET-KEY
          required: false
          schema:
            type: string
          description: >-
            Your private secret key, when you quote from your backend. Never
            expose it client-side.
        - in: header
          name: X-Account-Code
          required: false
          schema:
            type: string
          description: The account the quote is for.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - address
              properties:
                account_id:
                  type: string
                  description: >-
                    Required with a secret key and must be the authenticated
                    account. Optional with a public key, where it must match the
                    checkout session.
                checkout_session:
                  type: string
                  description: >-
                    Required with a public key: the checkout session with
                    `tax_collection`, whose `external_subscription` is quoted.
                    Not allowed with a secret key.
                country:
                  type: string
                  description: >-
                    Optional. With a public key it must match the checkout
                    session.
                external_subscription:
                  type: object
                  description: >-
                    Required with a secret key, not allowed with a public key.
                    The subscription to quote.
                  properties:
                    customer_id:
                      type: string
                      description: The customer in Stripe (`cus_...`).
                    currency:
                      type: string
                      description: The currency of the prices.
                    items:
                      type: array
                      description: At least one item.
                      items:
                        type: object
                        properties:
                          price:
                            type: string
                            description: The price in Stripe (`price_...`).
                          quantity:
                            type: integer
                            description: Default `1`.
                address:
                  type: object
                  required:
                    - country
                  description: Where the subscription is consumed.
                  properties:
                    country:
                      type: string
                      description: Two-letter ISO country code.
                    postal_code:
                      type: string
                      description: Required for the United States and Canada.
                    state:
                      type: string
                    city:
                      type: string
                    line1:
                      type: string
                tax_information:
                  type: object
                  description: >-
                    Optional. The buyer's tax ID, used for business treatment
                    such as reverse charge and saved on the Stripe customer with
                    the subscription.
                  properties:
                    business:
                      type: boolean
                      description: Whether the buyer is a business.
                    type:
                      type: string
                      description: >-
                        Tax ID type, lowercase, from Stripe's list: `eu_vat`,
                        `gb_vat`, `us_ein`, `mx_rfc`, `br_cnpj`... Required with
                        `id`.
                    id:
                      type: string
                      description: >-
                        Tax ID number, up to 64 characters. Required with
                        `type`.
            example:
              account_id: <your_account_id>
              external_subscription:
                customer_id: cus_RplXYZ
                items:
                  - price: price_1QwAbc
                    quantity: 1
              address:
                country: US
                postal_code: '10001'
              tax_information:
                business: false
      responses:
        '200':
          description: Tax quote
          content:
            application/json:
              schema:
                type: object
                properties:
                  tax_quote_id:
                    type: string
                  status:
                    type: string
                    enum:
                      - TAX_APPLIED
                      - NO_TAX
                      - NOT_CALCULATED
                  no_tax_reason:
                    type: string
                    enum:
                      - REVERSE_CHARGE
                      - NOT_COLLECTING
                      - EXEMPT
                      - ZERO_RATED
                      - NOT_SUBJECT_TO_TAX
                      - OTHER
                  currency:
                    type: string
                  subtotal:
                    type: number
                  tax:
                    type: number
                  total:
                    type: number
                  lines:
                    type: array
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                        jurisdiction:
                          type: string
                        percentage:
                          type: number
                        taxable_amount:
                          type: number
                        value:
                          type: number
              example:
                tax_quote_id: txq_2a8a493dcc5c4230b4cf8d9359fd200a
                status: TAX_APPLIED
                currency: USD
                subtotal: 29
                tax: 2.57
                total: 31.57
                lines:
                  - type: sales_tax
                    jurisdiction: NY
                    percentage: 8.875
                    taxable_amount: 29
                    value: 2.57
        '400':
          description: Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  messages:
                    type: array
                    items:
                      type: string
              example:
                code: INVALID_REQUEST
                messages:
                  - address.postal_code is required for US.
        '403':
          description: The product is not enabled for your organization
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  messages:
                    type: array
                    items:
                      type: string
              example:
                code: PRODUCT_NOT_ENABLED
                messages:
                  - ...

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.