openapi: 3.1.0
info:
  title: Anrok API
  version: '1.1'
  termsOfService: https://www.anrok.com/privacy-terms
  contact:
    email: support@anrok.com
  license:
    name: All rights reserved
    url: https://www.anrok.com
  x-logo:
    url: https://global-uploads.webflow.com/632add85afcd1ac30aa74675/6357842d130e1f3e0e23d1fe_anrok_logo.svg
  description: |
    # API reference

    The Anrok API server is accessible at `https://api.anrok.com`.

    All requests are HTTP POSTs with JSON in the body.

    Authentication is via an HTTP header `Authorization: Bearer {apiKey}`.

    The default rate limit for a seller account is 10 API requests per second.
servers:
  - url: https://api.anrok.com
security:
  - http: []
tags:
  - name: Customers
    description: |
      The Anrok Customers API endpoints allow you to register customers on your seller
      account before their first transaction, and to retrieve the customers on your account. Normally a customer is created automatically when its
      first transaction is ingested; creating it ahead of time makes the customer searchable by name
      in Anrok - for example, when uploading a tax exemption certificate before the customer's first
      billing - without needing to push a placeholder transaction.
  - name: Customer certificates
    description: |
      A sales tax exemption certificate documents the exemption claimed by a purchaser
      to legally make a tax-free purchase.
      Certificates can be uploaded to Anrok via the Anrok UI as well as via the API.
      See our
      <a href="https://help-center.anrok.com/hc/en-us/articles/24861687025299-Upload-an-exemption-certificate">Help Center article</a>
      for more information.
  - name: Transactions
    description: |
      This documentation describes how to use Anrok's Transactions API to synchronize transactions between Anrok and your billing system, as well as calculate sales tax for new invoices. Use of this API is generally recommended for sellers with custom billing systems or workflows that prevent you from using one of our pre-built platform integrations. Sellers utilizing Stripe Subscriptions or Checkout may also use this API to calculate and add tax on initial invoices, while continuing to use Anrok's Stripe integration to manage tax for subsequent billing cycles.

      # Invoice lifecycle
      1. When an invoice is created: the billing system should call the `createEphemeral` endpoint to calculate the sales tax amount.
      1. When an invoice is updated: same as above.
      1. When an invoice is finalized and ready to send to the customer: the billing system should call the `createOrUpdate` endpoint so that the transaction is recorded in Anrok.
      1. When an invoice is paid: Anrok does not need to be notified. Sellers are required to remit sales tax to a state upon invoice, not receipt of payment.

      While the above covers a standard invoice lifecycle, the Transactions API also includes endpoints for exceptional states like voiding and negating invoices, which are described below.
  - name: Products
    description: |
      The Anrok Products API endpoints allow you to manage the products on your seller
      account. Each product is identified by an external ID and is assigned a product tax category
      (PTC) which determines the product's taxability in each jurisdiction.
      PTCs may be one of Anrok's standard PTCs or a custom PTC that has been created on your seller account.
  - name: Product mappings
    description: |
      The Anrok Product Mappings API endpoint allows you to dynamically map product IDs
      for [Anrok-built billing system integrations](https://help-center.anrok.com/hc/en-us/articles/41966628275219-Anrok-integration-types#:~:text=Anrok%20API%20integration-,Anrok%2Dbuilt%20integrations,-These%20integrations%20are).
      Note that this API endpoint is only used alongside an existing Anrok-built integration
      and is not used for standalone product mappings. When using an Anrok-built billing
      system integration, you can use this API endpoint to create many-to-1 mappings to
      associate various products in your billing system with equivalent products that have
      already been created in Anrok.
  - name: Tax ID validation
    description: "**The Anrok Tax ID Validation endpoint is a premium feature. Please contact hello@anrok.com for more information to enable this on your Anrok seller account.**\n\n\n1. Pass a customer address and an empty array of customerTaxIds:\n\t- Anrok verifies the customer address is valid for tax calculation.\n\t- Anrok responds with the list of customer tax IDs to collect.\n1. Collect the customer tax IDs and call the API endpoint again to validate them:\n\t- Anrok provides a list of valid tax IDs for each applicable jurisdiction.\n"
  - name: Address resolution
    description: |-
      The Anrok Address Resolution endpoint resolves a customer address to its normalized form, suitable for sales tax calculations, as well as taxable
      jurisdiction(s). It uses the same address resolution that tax calculation relies on, so a
      successful response means the address would process on an invoice.

      For addresses in the United States and Canada, Anrok returns the full resolved address. For all other countries, only the country is returned.

      **Resolving international addresses to street-level is a premium feature. Please contact hello@anrok.com for more information to enable this on your seller account.**
  - name: Filings
    description: |
      **The Filings endpoint is a premium feature. Please contact hello@anrok.com for more information to enable this on your seller account.**

      This endpoint can be used to fetch filings from Anrok.
externalDocs:
  description: API Tutorials
  url: https://apidocs.anrok.com/tutorials
paths:
  /v1/seller/customers/create:
    post:
      tags:
        - Customers
      summary: Create customer
      description: |
        Creates a new customer in Anrok, given a unique external Customer ID.
      operationId: customersCreate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomer'
            example:
              id: cus_K39sWBu92Lo
              name: Acme Inc
              emailAddress: billing@acme.com
        required: true
      responses:
        '200':
          $ref: '#/components/responses/EmptyResponse'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                type: string
              examples:
                missingRequiredProperty:
                  value: 'Request body: "id": Required.'
                  summary: Missing required property
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - idAlreadyInUse
                      - invalidEmailAddress
                required:
                  - type
              examples:
                idAlreadyInUse:
                  value:
                    type: idAlreadyInUse
                  summary: A customer with this ID already exists
                invalidEmailAddress:
                  value:
                    type: invalidEmailAddress
                  summary: Email address is not valid
        '429':
          $ref: '#/components/responses/RateLimit'
  /v1/seller/customers/id:{customerId}/get:
    post:
      tags:
        - Customers
      summary: Get customer
      description: Retrieves a customer by its ID.
      operationId: customersGet
      requestBody:
        $ref: '#/components/requestBodies/Empty'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponse'
              example:
                id: cus_K39sWBu92Lo
                name: Acme Inc
                emailAddress: billing@acme.com
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - customerIdNotFound
              example:
                type: customerIdNotFound
        '429':
          $ref: '#/components/responses/RateLimit'
    parameters:
      - $ref: '#/components/parameters/CustomerId'
  /v1/seller/customers/list:
    post:
      tags:
        - Customers
      summary: List customers
      description: |
        Lists the customers on your seller account, in ascending customer ID order.
      operationId: customersList
      requestBody:
        $ref: '#/components/requestBodies/ListCustomers'
      responses:
        '200':
          $ref: '#/components/responses/ListCustomersSuccess'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                type: string
              examples:
                invalidLimitProvided:
                  value: 'Request body: "limit": Number must be less than or equal to 100.'
                  summary: Invalid limit
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - invalidCursor
              example:
                type: invalidCursor
        '429':
          $ref: '#/components/responses/RateLimit'
  /v1/seller/certificates/create:
    post:
      tags:
        - Customer certificates
      summary: Create customer certificate
      description: This endpoint is used to create a new customer certificate in Anrok.
      operationId: certificatesCreate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerCertificate'
            example:
              customerId: cus_123
              customerName: Acme Inc
              effectiveDateBegin: '2022-01-01'
              exemptionNumber: cert-100
              certificateFile:
                name: cert.png
                contentsBase64: Y2VydC5wbmc=
              jurises:
                - jurisId: us-MA
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Certificate ID
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: string
              examples:
                missingRequiredProperty:
                  value: 'Request body: "customerId": Required.'
                  summary: Missing required property
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - duplicateJurisIds
                      - customerIdNotFound
                      - fileTypeNotSupported
                      - jurisNotFound
              example:
                type: duplicateJurisIds
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |-
            apiToken="sxxx/saxxx/secret.xxx"
            certName="cert.png"
            certContentsBase64=$(base64 -i "$certName")

            curl -X POST https://api.anrok.com/v1/seller/certificates/create \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d "{
                \"customerId\": \"customer-id-0\",
                \"effectiveDateBegin\": \"2022-12-13\",
                \"exemptionNumber\": \"cert-100\",
                \"certificateFile\": {
                    \"name\": \"$certName\",
                    \"contentsBase64\": \"$certContentsBase64\"
                },
                \"jurises\": [{
                    \"jurisId\": \"us-MA\"
                }]
              }"
  /v1/seller/certificates/id:{certificateId}/archive:
    post:
      tags:
        - Customer certificates
      summary: Archive customer certificate
      description: This endpoint is used to archive/invalidate a customer certificate.
      operationId: certificatesArchive
      requestBody:
        $ref: '#/components/requestBodies/Empty'
      responses:
        '200':
          $ref: '#/components/responses/EmptyResponse'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - certificateIdNotFound
              example:
                type: certificateIdNotFound
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |-
            apiToken="sxxx/saxxx/secret.xxx"
            certificateId="ctec6vx7gtrmxq"

            curl -X POST "https://api.anrok.com/v1/seller/certificates/id:$certificateId/archive" \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d "{}"
    parameters:
      - $ref: '#/components/parameters/CertificateId'
  /v1/seller/certificates/id:{certificateId}/get:
    post:
      tags:
        - Customer certificates
      summary: Get customer certificate
      description: Retrieves a customer certificate by its Anrok-assigned ID.
      operationId: certificatesGet
      requestBody:
        $ref: '#/components/requestBodies/Empty'
      responses:
        '200':
          $ref: '#/components/responses/GetCertificateSuccess'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - certificateIdNotFound
              example:
                type: certificateIdNotFound
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |
            apiToken="sxxx/saxxx/secret.xxx"
            certificateId="ctec6vx7gtrmxq"

            curl -X POST "https://api.anrok.com/v1/seller/certificates/id:$certificateId/get" \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d "{}"
    parameters:
      - $ref: '#/components/parameters/CertificateId'
  /v1/seller/certificates/list:
    post:
      tags:
        - Customer certificates
      summary: List customer certificates
      description: |
        Lists customer certificates in Anrok. Results can be filtered by customer ID or status, and are returned in pages using cursor-based pagination.
      operationId: certificatesList
      requestBody:
        $ref: '#/components/requestBodies/ListCertificates'
      responses:
        '200':
          $ref: '#/components/responses/ListCertificatesSuccess'
        '400':
          $ref: '#/components/responses/ListCertificatesBadRequest'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - invalidCursor
                      - customerIdNotFound
              examples:
                invalidCursor:
                  value:
                    type: invalidCursor
                  summary: Invalid cursor
                customerIdNotFound:
                  value:
                    type: customerIdNotFound
                  summary: Customer ID in filter does not exist
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |
            apiToken='sxxx/saxxx/secret.xxx'

            curl -X POST https://api.anrok.com/v1/seller/certificates/list \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d '{
                "filter": {
                    "status": "active"
                },
                "limit": 25
              }'
  /v1/seller/certificateRequests/create:
    post:
      tags:
        - Customer certificates
      summary: Create customer certificate request
      description: |
        Creates a customer certificate request and (by default) emails it to the customer contact. The recipient can upload their certificate via the returned `requestLink`.

        This endpoint is a premium feature. Please contact hello@anrok.com to enable the exemption certificate portal on your seller account.
      operationId: certificateRequestsCreate
      requestBody:
        $ref: '#/components/requestBodies/CreateCertificateRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  requestId:
                    description: The Anrok-assigned ID of the certificate request.
                    type: string
                    examples:
                      - cre_3xT8sLpz4q
                  requestLink:
                    description: The URL the customer can use to upload their certificate.
                    type: string
                    format: uri
                    examples:
                      - https://app.anrok.com/certificate-request/cre_3xT8sLpz4q
                required:
                  - requestId
                  - requestLink
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                type: string
              examples:
                missingRequiredProperty:
                  value: 'Request body: "customerId": Required.'
                  summary: Missing required property
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - customerIdNotFound
                      - featureNotEnabled
                      - invalidEmailAddress
              examples:
                customerIdNotFound:
                  value:
                    type: customerIdNotFound
                  summary: Customer ID does not exist
                featureNotEnabled:
                  value:
                    type: featureNotEnabled
                  summary: Exemption certificate portal not enabled for this seller
                invalidEmailAddress:
                  value:
                    type: invalidEmailAddress
                  summary: Email address is not valid
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |
            apiToken='sxxx/saxxx/secret.xxx'

            curl -X POST https://api.anrok.com/v1/seller/certificateRequests/create \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d '{
                "customerId": "v1:1292",
                "customerName": "Acme Inc",
                "emailAddress": "contact@acme.com"
              }'
  /v1/seller/transactions/createOrUpdate:
    post:
      tags:
        - Transactions
      summary: Create or update transaction
      description: Given the details of an invoice, calculate sales tax and save it as a transaction in Anrok. Saved transactions are used by Anrok to file sales tax returns and monitor sales thresholds.
      operationId: transactionsCreateOrUpdate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrUpdateTransaction'
            example:
              id: stripe:in_1JSW342eZvKYlo2C
              currencyCode: usd
              accountingTime: '2022-01-02T03:30:00Z'
              accountingTimeZone: UTC
              lineItems:
                - id: item-1
                  productExternalId: saas-product-1
                  amount: 15000
                  isTaxIncludedInAmount: false
                  quantity: '1'
                - id: item-2
                  productExternalId: saas-product-2
                  amount: 31000
                  isTaxIncludedInAmount: true
                  quantity: '12.3'
                - id: item-3
                  productExternalId: not-taxable-3
                  amount: 24000
              customerAddress:
                country: us
                line1: 1450 Cherokee St
                city: Denver
                region: CO
                postalCode: '80204'
              shipFromAddress:
                country: us
                line1: 230 S LaSalle St
                city: Chicago
                region: IL
                postalCode: '60604'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrUpdateTransactionSuccess'
              example:
                version: 1
                taxAmountToCollect: 722
                lineItems:
                  - id: item-1
                    taxAmountToCollect: 722
                    preTaxAmount: '15000'
                    jurises:
                      - name: Colorado
                        taxes: null
                        notTaxedReason:
                          type: productNotTaxed
                      - name: Denver (local)
                        taxes:
                          - taxName: Tax
                            taxableAmount: '15000'
                            taxAmount: '721.5'
                            taxRate: '0.0481'
                        notTaxedReason: null
                  - id: item-2
                    taxAmountToCollect: 0
                    preTaxAmount: '29577.3304'
                    jurises:
                      - name: Colorado
                        taxes: null
                        notTaxedReason:
                          type: productNotTaxed
                      - name: Denver (local)
                        taxes:
                          - taxName: Tax
                            taxableAmount: '29577.3304'
                            taxAmount: '1422.6696'
                            taxRate: '0.0481'
                        notTaxedReason: null
                  - id: item-3
                    taxAmountToCollect: 0
                    preTaxAmount: '24000'
                    jurises:
                      - name: Colorado
                        taxes: null
                        notTaxedReason:
                          type: productNotTaxed
                preTaxAmount: '68577.3304'
                jurisSummaries:
                  - name: Colorado
                    notTaxedReasons:
                      - type: productNotTaxed
                  - name: Denver (local)
                    notTaxedReasons: null
        '400':
          $ref: '#/components/responses/CreateTransactionBadRequest'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/CreateTransactionCannotComputeTaxAmount'
                  - $ref: '#/components/schemas/CreateTransactionCannotUpdate'
              examples:
                taxDateTooFarInFuture:
                  $ref: '#/components/examples/ConflictTaxDateTooFarInFuture'
                taxDateTooFarInPast:
                  $ref: '#/components/examples/ConflictTaxDateTooFarInPast'
                accoutingTimeZoneNotSetForSeller:
                  $ref: '#/components/examples/ConflictAccountingTimeZoneNotSetForSeller'
                productExternalIdUnknown:
                  $ref: '#/components/examples/ConflictProductExternalIdUnknown'
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |
            apiToken='sxxx/saxxx/secret.xxx'

            curl -X POST https://api.anrok.com/v1/seller/transactions/createOrUpdate \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d '{
                "id": "stripe:in_1JSW342eZvKYlo2C",
                "currencyCode": "usd",
                "accountingTime": "2022-01-02T03:30:00Z",
                "accountingTimeZone": "UTC",
                "lineItems": [{
                  "id": "item-1",
                  "productExternalId": "saas-product-1",
                  "amount": 15000,
                  "isTaxIncludedInAmount": false,
                  "quantity": "1"
                },
                {
                  "id": "item-2",
                  "productExternalId": "saas-product-2",
                  "amount": 31000,
                  "isTaxIncludedInAmount": true,
                  "quantity": "12.3"
                },
                {
                  "id": "item-3",
                  "productExternalId": "not-taxable-3",
                  "amount": 24000
                }],
                "customerAddress": {
                  "country": "us",
                  "line1": "1450 Cherokee St",
                  "city": "Denver",
                  "region": "CO",
                  "postalCode": "80204"
                },
                "shipFromAddress": {
                  "country": "us",
                  "line1": "230 S LaSalle St",
                  "city": "Chicago",
                  "region": "IL",
                  "postalCode": "60604"
                }
              }'
  /v1/seller/transactions/createEphemeral:
    post:
      tags:
        - Transactions
      summary: Create ephemeral transaction
      description: Given the details of an invoice, calculate sales tax without saving the transaction in Anrok. Ephemeral transactions are not used by Anrok to file sales tax returns or monitor sales thresholds.
      operationId: transactionsCreateEphemeral
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEphemeralTransaction'
            example:
              currencyCode: usd
              accountingTime: '2022-01-02T03:30:00Z'
              accountingTimeZone: UTC
              lineItems:
                - id: item-1
                  productExternalId: saas-product-1
                  amount: 15000
                  isTaxIncludedInAmount: false
                  quantity: '1'
                - id: item-2
                  productExternalId: saas-product-2
                  amount: 31000
                  isTaxIncludedInAmount: true
                  quantity: '12.3'
                - id: item-3
                  productExternalId: not-taxable-3
                  amount: 24000
              customerAddress:
                country: us
                line1: 1450 Cherokee St
                city: Denver
                region: CO
                postalCode: '80204'
              shipFromAddress:
                country: us
                line1: 230 S LaSalle St
                city: Chicago
                region: IL
                postalCode: '60604'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateEphemeralTransactionSuccess'
              example:
                taxAmountToCollect: 722
                lineItems:
                  - id: item-1
                    taxAmountToCollect: 722
                    preTaxAmount: '15000'
                    jurises:
                      - name: Colorado
                        taxes: null
                        notTaxedReason:
                          type: productNotTaxed
                      - name: Denver (local)
                        taxes:
                          - taxName: Tax
                            taxableAmount: '15000'
                            taxAmount: '721.5'
                            taxRate: '0.0481'
                        notTaxedReason: null
                  - id: item-2
                    taxAmountToCollect: 0
                    preTaxAmount: '29577.3304'
                    jurises:
                      - name: Colorado
                        taxes: null
                        notTaxedReason:
                          type: productNotTaxed
                      - name: Denver (local)
                        taxes:
                          - taxName: Tax
                            taxableAmount: '29577.3304'
                            taxAmount: '1422.6696'
                            taxRate: '0.0481'
                        notTaxedReason: null
                  - id: item-3
                    taxAmountToCollect: 0
                    preTaxAmount: '24000'
                    jurises:
                      - name: Colorado
                        taxes: null
                        notTaxedReason:
                          type: productNotTaxed
                preTaxAmount: '68577.3304'
                jurisSummaries:
                  - name: Colorado
                    notTaxedReasons:
                      - type: productNotTaxed
                  - name: Denver (local)
                    notTaxedReasons: null
        '400':
          $ref: '#/components/responses/CreateTransactionBadRequest'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTransactionCannotComputeTaxAmount'
              examples:
                taxDateTooFarInFuture:
                  $ref: '#/components/examples/ConflictTaxDateTooFarInFuture'
                taxDateTooFarInPast:
                  $ref: '#/components/examples/ConflictTaxDateTooFarInPast'
                accoutingTimeZoneNotSetForSeller:
                  $ref: '#/components/examples/ConflictAccountingTimeZoneNotSetForSeller'
                productExternalIdUnknown:
                  $ref: '#/components/examples/ConflictProductExternalIdUnknown'
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |
            apiToken='sxxx/saxxx/secret.xxx'

            curl -X POST https://api.anrok.com/v1/seller/transactions/createEphemeral \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d '{
                "currencyCode": "usd",
                "accountingTime": "2022-01-02T03:30:00Z",
                "accountingTimeZone": "UTC",
                "lineItems": [{
                  "id": "item-1",
                  "productExternalId": "saas-product-1",
                  "amount": 15000,
                  "isTaxIncludedInAmount": false,
                  "quantity": "1"
                },
                {
                  "id": "item-2",
                  "productExternalId": "saas-product-2",
                  "amount": 31000,
                  "isTaxIncludedInAmount": true,
                  "quantity": "12.3"
                },
                {
                  "id": "item-3",
                  "productExternalId": "not-taxable-3",
                  "amount": 24000
                }],
                "customerAddress": {
                  "country": "us",
                  "line1": "1450 Cherokee St",
                  "city": "Denver",
                  "region": "CO",
                  "postalCode": "80204"
                },
                "shipFromAddress": {
                  "country": "us",
                  "line1": "230 S LaSalle St",
                  "city": "Chicago",
                  "region": "IL",
                  "postalCode": "60604"
                }
              }'
  /v1/seller/transactions/createNegation:
    post:
      tags:
        - Transactions
      summary: Create negation
      description: Creates a new transaction that is the exact inverse of the given transaction. The sale prices and tax amounts will add up to zero.
      operationId: transactionsCreateNegation
      requestBody:
        $ref: '#/components/requestBodies/CreateNegation'
      responses:
        '200':
          $ref: '#/components/responses/EmptyResponse'
        '400':
          $ref: '#/components/responses/CreateNegationBadRequest'
        '409':
          $ref: '#/components/responses/CreateNegationConflict'
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |-
            apiToken='sxxx/saxxx/secret.xxx'

            curl -X POST https://api.anrok.com/v1/seller/transactions/createRefund \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d '{
                "originalTransactionId": "stripe:in_1JSW342eZvKYlo2C",
                "newTransactionId": "stripe:in_1JSW342eZvKYlo2C_refund"
              }'
  /v1/seller/transactions/id:{transactionId}/get:
    post:
      tags:
        - Transactions
      summary: Get transaction
      description: |
        Retrieves the latest version of a single transaction by its ID. The response includes
        a `version` field identifying the latest version. Voided transactions do not include
        the body field.
      operationId: transactionsGet
      requestBody:
        $ref: '#/components/requestBodies/Empty'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      version:
                        description: The version of the transaction. Incremented each time the transaction is updated.
                        type: integer
                        format: int32
                    required:
                      - version
                  - oneOf:
                      - $ref: '#/components/schemas/NormalTransactionResponse'
                      - $ref: '#/components/schemas/VoidedTransactionResponse'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - transactionIdNotFound
                required:
                  - type
              example:
                type: transactionIdNotFound
        '429':
          $ref: '#/components/responses/RateLimit'
    parameters:
      - $ref: '#/components/parameters/TransactionId'
  /v1/seller/transactions/id:{transactionId}/void:
    post:
      tags:
        - Transactions
      summary: Void transaction
      description: Mark a previously-created transaction as void. It will no longer be included in returns or sales totals.
      operationId: transactionsVoid
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                transactionExpectedVersion:
                  description: The expected transaction version. The void will fail if this is not the latest version of the transaction.
                  type: integer
                  format: int32
            examples:
              emptyExample:
                value: {}
                summary: Empty request body
              expectVersion:
                value:
                  transactionExpectedVersion: 1
                summary: Expected transaction version
        required: true
      responses:
        '200':
          $ref: '#/components/responses/EmptyResponse'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - transactionIdNotFound
                      - transactionExpectedVersionMismatch
                      - transactionFrozenForFiling
              example:
                type: transactionIdNotFound
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |-
            apiToken='sxxx/saxxx/secret.xxx'

            curl -X POST https://api.anrok.com/v1/seller/transactions/id:stripe:in_1JSW342eZvKYlo2C/void \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d '{}'
    parameters:
      - $ref: '#/components/parameters/TransactionId'
  /v1/seller/transactions/list:
    post:
      tags:
        - Transactions
      summary: List transactions
      description: |
        Lists transactions in Anrok. These can be filtered by the time they were last modified or by the filing they are associated with.
        This endpoint is a premium feature. Please contact hello@anrok.com for more information to enable this on your seller account.
      operationId: transactionsList
      requestBody:
        $ref: '#/components/requestBodies/ListTransactions'
      responses:
        '200':
          $ref: '#/components/responses/ListTransactionsSuccess'
        '400':
          $ref: '#/components/responses/ListTransactionsBadRequest'
        '409':
          $ref: '#/components/responses/ListTransactionsConflict'
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |
            apiToken='sxxx/saxxx/secret.xxx'

            curl -X POST https://api.anrok.com/v1/seller/transactions/list \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d '{
                "filter": {
                    "type": "lastModifiedAfter",
                    "value": "2025-08-08T16:00:00.000Z"
                }
              }'
  /v1/seller/integrations/id:{integrationId}/productIdMapping/list:
    post:
      tags:
        - Product mappings
      summary: List product mappings
      description: Lists all Product ID mappings for this integration.
      operationId: productIdMappingsList
      requestBody:
        $ref: '#/components/requestBodies/Empty'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties:
                    type: string
              example:
                - billing_system_id_1: anrok_id_1
                - billing_system_id_2: anrok_id_2
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - integrationIdNotFound
              example:
                type: integrationIdNotFound
        '429':
          $ref: '#/components/responses/RateLimit'
    parameters:
      - $ref: '#/components/parameters/IntegrationId'
  /v1/seller/integrations/id:{integrationId}/productIdMapping/add:
    post:
      tags:
        - Product mappings
      summary: Add product mapping
      description: Adds a product ID mapping for this integration.
      operationId: productIdMappingsAdd
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                sourceId:
                  description: Source product ID from billing system.
                  type: string
                targetId:
                  description: Target product ID on Anrok. This product must already exist in Anrok.
                  type: string
                shouldOverwrite:
                  description: Whether this request should override an existing `sourceId` mapping.
                  type: boolean
                  default: false
              required:
                - sourceId
                - targetId
            example:
              sourceId: billing system ID
              targetId: anrok ID
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
              example: {}
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - integrationIdNotFound
                      - sourceIdAlreadyMapped
                      - targetIdNotFound
              example:
                type: targetIdNotFound
        '429':
          $ref: '#/components/responses/RateLimit'
    parameters:
      - $ref: '#/components/parameters/IntegrationId'
  /v1/seller/taxId/validate:
    post:
      tags:
        - Tax ID validation
      summary: Validate tax IDs
      description: This endpoint is used to assist in the collection and validation of customer tax IDs.
      operationId: taxIdsValidate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateTaxId'
            example:
              customerAddress:
                country: CA
                line1: 123 Main St
                city: Quebec City
                region: Quebec
                postalCode: G1P 2J6
              customerTaxIds:
                - value: '123456789'
                - value: '987654321'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateTaxIdSuccess'
              example:
                jurises:
                  - name: Canada (federal)
                    taxIdNames:
                      name: GST/HST account number
                      abbreviation: null
                    validTaxIds:
                      - value: '123456789'
                  - name: Quebec
                    taxIdNames:
                      name: QST registration number
                      abbreviation: null
                    validTaxIds:
                      - value: '987654321'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: string
              examples:
                missingRequiredProperty:
                  value: 'Request body: "customerAddress": Required.'
                  summary: Missing required property
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - customerAddressCouldNotResolve
                      - externalServiceError
                      - validationNotEnabled
                      - validationNotSupportedForCountry
              example:
                type: customerAddressCouldNotResolve
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |-
            apiToken='sxxx/saxxx/secret.xxx'

            curl -X POST https://api.anrok.com/v1/seller/taxId/validate \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d '{
                "customerAddress": {
                  "country": "CA",
                  "line1": "123 Main St",
                  "city": "Quebec City",
                  "region": "Quebec",
                  "postalCode": "G1P 2J6"
                },
                "customerTaxIds": [{
                  "value": "123456789"
                }]
              }'
  /v1/seller/address/resolve:
    post:
      tags:
        - Address resolution
      summary: Resolve an address
      description: Resolve a customer address to its normalized form for sales tax calculation, and compute its taxable jurisdiction(s). The address fields are provided at the top level of the request body. This endpoint uses the same address resolution that tax calculation relies on, so a successful response means the address would process on an invoice. Resolving international addresses to street-level is a premium feature. Please contact hello@anrok.com for more information to enable this on your seller account.
      operationId: addressResolve
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerAddress'
            examples:
              usAddress:
                summary: US address
                value:
                  country: US
                  line1: 100 Fake St
                  city: San Francisco
                  region: CA
                  postalCode: '94111'
              nonUsAddress:
                summary: Address outside the US and Canada
                value:
                  country: France
                  line1: 55 Rue du Faubourg Saint-Honoré
                  city: Paris
                  postalCode: '75008'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResolveAddressSuccess'
              examples:
                usAddress:
                  summary: Full address returned for US/Canada
                  value:
                    resolvedAddress:
                      country: United States
                      line1: 100 Fake St
                      city: San Francisco
                      region: CA
                      postalCode: '94111'
                    jurisdictions:
                      - id: us-CA
                        name: California
                nonUsAddress:
                  summary: Country-only resolution outside the US and Canada
                  value:
                    resolvedAddress:
                      country: France
                      line1: null
                      city: null
                      region: null
                      postalCode: null
                    jurisdictions:
                      - id: eu-oss
                        name: EU OSS
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: string
              examples:
                unrecognizedField:
                  value: 'Request body: Unrecognized key(s) in object: ''line2'''
                  summary: An unrecognized property was provided
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - addressCouldNotResolve
                      - jurisNotFound
                      - externalServiceError
                  message:
                    description: A human-readable description, present for addressCouldNotResolve and jurisNotFound.
                    type: string
                required:
                  - type
              examples:
                addressCouldNotResolve:
                  summary: The address could not be resolved to a taxable jurisdiction
                  value:
                    type: addressCouldNotResolve
                jurisNotFound:
                  summary: The address resolved but no matching jurisdiction was found
                  value:
                    type: jurisNotFound
                    message: No jurisdiction found for the resolved address.
                externalServiceError:
                  summary: An upstream address resolution service error occurred
                  value:
                    type: externalServiceError
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |
            apiToken='sxxx/saxxx/secret.xxx'

            curl -X POST https://api.anrok.com/v1/seller/address/resolve \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d '{
                "country": "US",
                "line1": "100 Fake St",
                "city": "San Francisco",
                "region": "CA",
                "postalCode": "94111"
              }'
  /v1/seller/filings/list:
    post:
      tags:
        - Filings
      summary: List filings
      description: |
        Lists filings in Anrok. These can be filtered by the jurisdiction ID and the filing period end date.
        This endpoint is a premium feature. Please contact hello@anrok.com for more information to enable this on your seller account.
      operationId: filingsList
      requestBody:
        $ref: '#/components/requestBodies/ListFilings'
      responses:
        '200':
          $ref: '#/components/responses/ListFilingsSuccess'
        '400':
          $ref: '#/components/responses/ListFilingsBadRequest'
        '409':
          $ref: '#/components/responses/ListFilingsConflict'
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |
            apiToken='sxxx/saxxx/secret.xxx'

            curl -X POST https://api.anrok.com/v1/seller/filings/list \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d '{
                "filter": {
                    "jurisId": "us-MA",
                    "periodEndDateRangeInclusive": "2025-01..2025-03"
                }
              }'
  /v1/seller/filings/id:{jurisId}/id:{jurisFilingId}/listTransactionIds:
    post:
      tags:
        - Filings
      summary: List filing transaction IDs
      description: |
        Lists the IDs of the transactions included in a filing, ordered by the transaction's accounting date.
        This endpoint is a premium feature. Please contact hello@anrok.com for more information to enable this on your seller account.
      operationId: filingsListTransactionIds
      requestBody:
        $ref: '#/components/requestBodies/ListFilingTransactionIds'
      responses:
        '200':
          $ref: '#/components/responses/ListFilingTransactionIdsSuccess'
        '400':
          $ref: '#/components/responses/ListFilingTransactionIdsBadRequest'
        '409':
          $ref: '#/components/responses/ListFilingTransactionIdsConflict'
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |
            apiToken="sxxx/saxxx/secret.xxx"
            jurisId="us-MA"
            jurisFilingId="2025-01"

            curl -X POST "https://api.anrok.com/v1/seller/filings/id:$jurisId/id:$jurisFilingId/listTransactionIds" \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d "{}"
    parameters:
      - $ref: '#/components/parameters/JurisId'
      - $ref: '#/components/parameters/JurisFilingId'
  /v1/seller/filings/id:{jurisId}/id:{jurisFilingId}/listTransactionsWithConversionRates:
    post:
      tags:
        - Filings
      summary: List filing transactions with conversion rates
      description: |
        Lists the transactions included in a filing, each with the conversion rate from the transaction currency to the filing currency.
        Rates may change until the filing has been finalized, so it's recommended to only use this endpoint after finalization.
        This endpoint is a premium feature. Please contact hello@anrok.com for more information to enable this on your seller account.
      operationId: filingsListTransactionsWithConversionRates
      requestBody:
        $ref: '#/components/requestBodies/ListFilingTransactionsWithConversionRates'
      responses:
        '200':
          $ref: '#/components/responses/ListFilingTransactionsWithConversionRatesSuccess'
        '400':
          $ref: '#/components/responses/ListFilingTransactionsWithConversionRatesBadRequest'
        '409':
          $ref: '#/components/responses/ListFilingTransactionsWithConversionRatesConflict'
        '429':
          $ref: '#/components/responses/RateLimit'
      x-codeSamples:
        - lang: cURL
          source: |
            apiToken="sxxx/saxxx/secret.xxx"
            jurisId="us-MA"
            jurisFilingId="2025-01"

            curl -X POST "https://api.anrok.com/v1/seller/filings/id:$jurisId/id:$jurisFilingId/listTransactionsWithConversionRates" \
              -H 'Content-Type: application/json' \
              -H "Authorization: Bearer $apiToken" \
              -d "{}"
    parameters:
      - $ref: '#/components/parameters/JurisId'
      - $ref: '#/components/parameters/JurisFilingId'
  /v1/seller/filings/id:{jurisId}/id:{jurisFilingId}/removeTransactions:
    post:
      tags:
        - Filings
      summary: Remove transactions from a filing
      description: |
        Removes the given transactions from a filing, identified by its jurisdiction ID and filing ID.

        Idempotent: transaction IDs that aren't currently associated with this filing (already removed,
        unknown, or associated with a different filing) are reported with a `notFound` error rather than
        failing the request, so retrying the same request is safe.

        A maximum of 100 transaction IDs may be removed per request. To remove more, make multiple requests.
      operationId: filingsRemoveTransactions
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                transactionIds:
                  description: IDs of the transactions to remove from the filing. Must contain between 1 and 100 IDs.
                  type: array
                  items:
                    type: string
                  minItems: 1
                  maxItems: 100
              required:
                - transactionIds
            example:
              transactionIds:
                - txn_K39sWBu92Lo
                - txn_L48tXCv03Mp
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  transactions:
                    description: One entry per requested transaction ID, in request order.
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          description: The transaction ID.
                          type: string
                        status:
                          description: |
                            `removed` if the transaction was removed from the filing; `error` if it
                            could not be removed.
                          type: string
                          enum:
                            - removed
                            - error
                        reason:
                          description: |
                            Present only when `status` is `error`. `notFound` means the transaction was
                            not in this filing (unknown, already removed, or in a different filing).
                          type: string
                          enum:
                            - notFound
                      required:
                        - id
                        - status
                required:
                  - transactions
              example:
                transactions:
                  - id: txn_K39sWBu92Lo
                    status: removed
                  - id: txn_L48tXCv03Mp
                    status: error
                    reason: notFound
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: string
              examples:
                emptyTransactionIds:
                  value: 'Request body: "transactionIds": Array must contain at least 1 element(s).'
                  summary: Empty transactionIds list
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - invalidJurisId
                      - filingNotFound
                      - filingNotEditable
                      - filingIsBeingDeleted
                      - filingHasBackgroundOperation
                required:
                  - type
              example:
                type: filingNotEditable
        '429':
          $ref: '#/components/responses/RateLimit'
    parameters:
      - $ref: '#/components/parameters/JurisId'
      - $ref: '#/components/parameters/JurisFilingId'
  /v1/seller/products/create:
    post:
      tags:
        - Products
      summary: Create product
      description: Creates a new product in Anrok, given a unique external ID and a product tax category (PTC) which determines the product's taxability in each jurisdiction.
      operationId: productsCreate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProduct'
            example:
              externalId: sku-1001
              taxCategoryId:
                type: standard
                id: saasBusiness
              name: Pro plan
              description: Monthly subscription to the Pro plan.
        required: true
      responses:
        '200':
          $ref: '#/components/responses/EmptyResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: string
              examples:
                missingRequiredProperty:
                  value: 'Request body: "externalId": Required.'
                  summary: Missing required property
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - externalIdAlreadyExists
                      - externalIdInvalid
                      - taxCategoryIdNotFound
                  message:
                    description: When `type` is `externalIdInvalid`, a human-readable message describing why the external ID is invalid.
                    type: string
                required:
                  - type
              example:
                type: externalIdAlreadyExists
        '429':
          $ref: '#/components/responses/RateLimit'
  /v1/seller/products/externalId:{externalId}/get:
    post:
      tags:
        - Products
      summary: Get product
      description: Looks up a product in Anrok by its external ID. Returns the product's external ID, tax category, name, and description.
      operationId: productsGet
      requestBody:
        $ref: '#/components/requestBodies/Empty'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  externalId:
                    description: The product's external ID.
                    type: string
                    examples:
                      - sku-1001
                  taxCategoryId:
                    description: The identifier for the product's product tax category (PTC).
                    $ref: '#/components/schemas/ProductTaxCategoryId'
                  name:
                    description: The product's display name.
                    type: string
                    examples:
                      - Pro plan
                  description:
                    description: The product's description. Empty string if no description has been set.
                    type: string
                    examples:
                      - Monthly subscription to the Pro plan.
                required:
                  - externalId
                  - taxCategoryId
                  - name
                  - description
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - productExternalIdNotFound
              example:
                type: productExternalIdNotFound
        '429':
          $ref: '#/components/responses/RateLimit'
    parameters:
      - $ref: '#/components/parameters/ProductExternalId'
  /v1/seller/products/list:
    post:
      tags:
        - Products
      summary: List products
      description: |
        Lists the products on your seller account, in descending order of creation time.
      operationId: productsList
      requestBody:
        $ref: '#/components/requestBodies/ListProducts'
      responses:
        '200':
          $ref: '#/components/responses/ListProductsSuccess'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                type: string
              examples:
                invalidLimitProvided:
                  value: 'Request body: "limit": Number must be less than or equal to 1000.'
                  summary: Invalid limit
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - invalidCursor
              example:
                type: invalidCursor
        '429':
          $ref: '#/components/responses/RateLimit'
  /v1/seller/productTaxCategories/list:
    post:
      tags:
        - Products
      summary: List product tax categories
      description: Lists all product tax categories (PTCs) that are available on the seller account. This includes the standard PTCs that Anrok has enabled for the seller as well as any custom PTCs that have been created on the seller account. The returned IDs may be used as the `taxCategoryId` when creating a product.
      operationId: productTaxCategoriesList
      requestBody:
        $ref: '#/components/requestBodies/Empty'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  productTaxCategories:
                    description: The list of all available product tax categories.
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          $ref: '#/components/schemas/ProductTaxCategoryId'
                        name:
                          description: The display name of the product tax category.
                          type: string
                          examples:
                            - SaaS - General, B2B
                      required:
                        - id
                        - name
                required:
                  - productTaxCategories
              example:
                productTaxCategories:
                  - id:
                      type: standard
                      id: saasBusiness
                    name: SaaS - General, B2B
                  - id:
                      type: custom
                      id: sptc95hf85bdcd
                    name: Custom Professional Services
        '429':
          $ref: '#/components/responses/RateLimit'
components:
  securitySchemes:
    http:
      type: http
      description: |
        The Anrok API uses API keys to authenticate requests. You can view and manage your API keys in [Anrok](https://app.anrok.com/-/api-keys). Use an Authorization header in the format `Bearer {apiKey}` to authenticate Anrok API requests.
      scheme: Bearer
  schemas:
    CustomerName:
      description: The name of the customer. This is used for display purposes only.
      type: string
      examples:
        - Acme Inc
    CreateCustomer:
      type: object
      properties:
        id:
          description: |
            Your unique identifier for this customer. 
            This must exactly match the customer ID that your billing system or integration  will send on transactions, so that the customer's transactions and exemption certificates link up. For Anrok-native billing integrations, customer IDs are prefixed with the integration type (for example `stripe:cus_K39sWBu92Lo`).  Customer IDs are unique across the entire seller account.
          type: string
          examples:
            - cus_K39sWBu92Lo
        name:
          $ref: '#/components/schemas/CustomerName'
        emailAddress:
          description: Optional email address of the customer.
          type:
            - string
            - 'null'
          format: email
          examples:
            - john.doe@example.com
      required:
        - id
        - name
    CustomerResponse:
      type: object
      properties:
        id:
          description: Your unique identifier for this customer.
          type: string
          examples:
            - cus_K39sWBu92Lo
        name:
          $ref: '#/components/schemas/CustomerName'
        emailAddress:
          description: The email address of the customer, if one has been provided.
          type:
            - string
            - 'null'
          format: email
          examples:
            - john.doe@example.com
      required:
        - id
        - name
        - emailAddress
    CustomerId:
      description: |
        The Anrok customer ID used to link transactions for the same customer and to look up tax exemption certificates for a customer. This is typically the billing system's customer ID with a prefix to disambiguate.
        - If customerId is provided without customerName, that customer object must
          already exist in Anrok.
        - If both customerId and customerName are provided, the customer object will
          be created if it is not already present.
        - Customer IDs are unique across the entire seller account.
      type: string
      examples:
        - v1:1292
        - stripe:cus_K39sWBu92Lo
    CustomerCertificateFile:
      type: object
      properties:
        name:
          description: File name
          type: string
          examples:
            - cert.png
        contentsBase64:
          description: Base64 encoded certificate image contents
          type: string
          examples:
            - Y2VydC5wbmc=
      required:
        - name
        - contentsBase64
    CustomerCertificateJuris:
      type: object
      properties:
        jurisId:
          description: Jurisdiction ID for which this exemption should apply (US only).
          type: string
          enum:
            - us-AK
            - us-AL
            - us-AR
            - us-AS
            - us-AZ
            - us-CA
            - us-CO
            - us-CT
            - us-DC
            - us-DE
            - us-FL
            - us-GA
            - us-GU
            - us-HI
            - us-IA
            - us-ID
            - us-IL
            - us-IN
            - us-KS
            - us-KY
            - us-LA
            - us-MA
            - us-MD
            - us-ME
            - us-MI
            - us-MN
            - us-MO
            - us-MP
            - us-MS
            - us-MT
            - us-NC
            - us-ND
            - us-NE
            - us-NH
            - us-NJ
            - us-NM
            - us-NV
            - us-NY
            - us-OH
            - us-OK
            - us-OR
            - us-PA
            - us-PR
            - us-RI
            - us-SC
            - us-SD
            - us-TN
            - us-TX
            - us-UT
            - us-VA
            - us-VI
            - us-VT
            - us-WA
            - us-WI
            - us-WV
            - us-WY
          examples:
            - us-MA
        registrationId:
          description: Registration ID for jurisdiction. This is used for display purposes only.
          type: string
          examples:
            - reg-1234
        effectiveDateEndi:
          description: Expiration date of certificate in this jurisdiction
          type: string
          format: date
          examples:
            - '2023-01-01'
        notes:
          description: Optional internal notes. This is used for display purposes only.
          type: string
          examples:
            - Optional internal notes
      required:
        - jurisId
    CustomerCertificate:
      type: object
      properties:
        customerId:
          $ref: '#/components/schemas/CustomerId'
        customerName:
          $ref: '#/components/schemas/CustomerName'
        effectiveDateBegin:
          description: Effective date of certificate
          type: string
          format: date
          examples:
            - '2022-01-01'
        exemptionNumber:
          description: Certificate exemption number. This is used for display purposes only.
          type: string
          examples:
            - cert-105
        notes:
          description: Optional internal notes.
          type: string
          examples:
            - customer notes
        type:
          description: |
            The type of exemption the certificate represents. If omitted or null, no type is recorded.

            - `agricultural`: agricultural use.
            - `directPay`: direct pay permit.
            - `educational`: educational institution.
            - `energy`: energy-related exemption.
            - `governmentFederal`: federal government entity.
            - `governmentOther`: other government entity.
            - `governmentState`: state government entity.
            - `healthcare`: healthcare organization.
            - `manufacturing`: used in manufacturing.
            - `nativeAmericanTribal`: Native American tribal entity.
            - `nonprofit`: nonprofit organization.
            - `other`: other exemption type.
            - `religious`: religious organization.
            - `resale`: purchased for resale.
            - `researchDevelopment`: research and development use.
          type:
            - string
            - 'null'
          enum:
            - agricultural
            - directPay
            - educational
            - energy
            - governmentFederal
            - governmentOther
            - governmentState
            - healthcare
            - manufacturing
            - nativeAmericanTribal
            - nonprofit
            - other
            - religious
            - resale
            - researchDevelopment
            - null
          examples:
            - resale
        certificateFile:
          $ref: '#/components/schemas/CustomerCertificateFile'
        jurises:
          description: Jurisdictions for which certificate applies
          type: array
          items:
            $ref: '#/components/schemas/CustomerCertificateJuris'
      required:
        - customerId
        - effectiveDateBegin
        - certificateFile
        - jurises
    CustomerCertificateJurisResponse:
      type: object
      properties:
        jurisId:
          description: Jurisdiction ID for which this exemption applies.
          type: string
          examples:
            - us-MA
        registrationId:
          description: Registration ID for the jurisdiction. This is used for display purposes only.
          type: string
          examples:
            - reg-1234
        effectiveDateEndi:
          description: Expiration date of the certificate in this jurisdiction. Null if the certificate has no expiration date in this jurisdiction.
          type:
            - string
            - 'null'
          format: date
          examples:
            - '2023-01-01'
        notes:
          description: Optional internal notes. This is used for display purposes only.
          type: string
          examples:
            - Optional internal notes
      required:
        - jurisId
        - registrationId
        - effectiveDateEndi
        - notes
    CustomerCertificateResponse:
      type: object
      properties:
        id:
          description: The Anrok-assigned ID of the certificate.
          type: string
          examples:
            - ctec6vx7gtrmxq
        status:
          description: |
            The current status of the certificate.

            - `active`: the certificate is valid.
            - `expiringSoon`: the certificate is valid but expires within 60 days in at least one jurisdiction.
            - `expired`: the certificate has expired in every jurisdiction it covers.
            - `archived`: the certificate has been archived.
          type: string
          enum:
            - active
            - expiringSoon
            - expired
            - archived
          examples:
            - active
        customerId:
          description: The Anrok customer ID of the customer the certificate belongs to.
          type: string
          examples:
            - v1:1292
            - stripe:cus_K39sWBu92Lo
        customerName:
          description: The name of the customer.
          type: string
          examples:
            - Acme Inc
        createdTime:
          description: The time at which the certificate was created in Anrok.
          type: string
          format: date-time
          examples:
            - '2025-01-15T18:23:45.000Z'
        effectiveDateBegin:
          description: Effective date of the certificate.
          type: string
          format: date
          examples:
            - '2022-01-01'
        expiryDate:
          description: The earliest expiration date across all jurisdictions covered by the certificate. Null if no jurisdiction has an expiration date set.
          type:
            - string
            - 'null'
          format: date
          examples:
            - '2023-01-01'
        exemptionNumber:
          description: Certificate exemption number.
          type: string
          examples:
            - cert-105
        notes:
          description: Optional internal notes.
          type: string
          examples:
            - customer notes
        type:
          description: |
            The type of exemption the certificate represents. Null if no type has been recorded.

            - `agricultural`: agricultural use.
            - `directPay`: direct pay permit.
            - `educational`: educational institution.
            - `energy`: energy-related exemption.
            - `governmentFederal`: federal government entity.
            - `governmentOther`: other government entity.
            - `governmentState`: state government entity.
            - `healthcare`: healthcare organization.
            - `manufacturing`: used in manufacturing.
            - `nativeAmericanTribal`: Native American tribal entity.
            - `nonprofit`: nonprofit organization.
            - `other`: other exemption type.
            - `religious`: religious organization.
            - `resale`: purchased for resale.
            - `researchDevelopment`: research and development use.
          type:
            - string
            - 'null'
          enum:
            - agricultural
            - directPay
            - educational
            - energy
            - governmentFederal
            - governmentOther
            - governmentState
            - healthcare
            - manufacturing
            - nativeAmericanTribal
            - nonprofit
            - other
            - religious
            - resale
            - researchDevelopment
            - null
          examples:
            - resale
        jurises:
          description: The jurisdictions to which the certificate applies.
          type: array
          items:
            $ref: '#/components/schemas/CustomerCertificateJurisResponse'
      required:
        - id
        - status
        - customerId
        - customerName
        - createdTime
        - effectiveDateBegin
        - expiryDate
        - exemptionNumber
        - notes
        - type
        - jurises
    TransactionLineItem:
      type: object
      properties:
        id:
          description: Optional identifier for the line item. This is saved by Anrok and returned in the response, but not used for anything by Anrok.
          type: string
        productExternalId:
          description: A product ID that has already been defined in the Anrok UI (under "Product IDs"). This is used to determine whether the line item is taxable.
          type: string
        amount:
          description: The sale price in the smallest denomination of the currency (e.g. cents or pennies).
          type: integer
          minimum: -100000000000
          maximum: 100000000000
        isTaxIncludedInAmount:
          description: Whether the line item already includes tax in the amount.
          type: boolean
        quantity:
          description: The quantity of the line item, as a string (e.g. `3` or `0.5`).
          type: string
      required:
        - productExternalId
        - amount
    CustomerAddress:
      type: object
      title: Address
      properties:
        country:
          description: The country's full name or 2-letter ISO code
          type:
            - string
            - 'null'
          examples:
            - UK
            - United Kingdom
        line1:
          description: The "delivery line" of the address
          type:
            - string
            - 'null'
        city:
          description: City or town name
          type:
            - string
            - 'null'
        region:
          description: Other principal subdivision (i.e. province, state, county)
          type:
            - string
            - 'null'
        postalCode:
          description: Postal code
          type:
            - string
            - 'null'
      required: []
      examples:
        - country: ENGLAND
          line1: 2045 ROYAL ROAD
          city: LONDON
          postalCode: WIP 6HQ
        - country: AU
          line1: 71 Gaggin Street
          city: Heddon Greta
          region: New South Wales
          postalCode: '2321'
    CustomerLegacyUsOnlyAddress:
      type: object
      title: Legacy US only address
      deprecated: true
      properties:
        country:
          type: string
          enum:
            - us
        line1:
          description: The "delivery line" of the address
          type:
            - string
            - 'null'
        city:
          description: The standard USPS format
          type:
            - string
            - 'null'
        state:
          description: The standard USPS format
          type:
            - string
            - 'null'
        zipCode:
          description: The standard USPS format
          type:
            - string
            - 'null'
      required:
        - country
      example:
        country: us
        line1: 123 Main St
        city: White Plains
        state: NY
        zipCode: '10601'
    CustomerEmailAddress:
      description: The email address of the customer. This is used for display purposes only.
      type: string
      format: email
      examples:
        - john.doe@example.com
    CustomerTaxId:
      type: object
      description: The customer VAT registration number for a non-US country
      properties:
        type:
          type: string
          enum:
            - genericVatNumber
            - euVrn
          description: This setting is purely metadata and does not affect tax calculation.
        value:
          description: The customer VAT registration number for a non-US country
          type: string
      required:
        - type
        - value
    Transaction:
      type: object
      properties:
        lineItems:
          description: The line items in the transaction.
          type: array
          items:
            $ref: '#/components/schemas/TransactionLineItem'
        currencyCode:
          description: Three letter ISO currency code (case insensitive).
          type: string
          minLength: 3
          maxLength: 3
          examples:
            - USD
            - GBP
            - EUR
        customerAddress:
          description: 'The address where the product will be delivered or used. This address determines the taxing jurisdictions and rates for destination-based sourcing. For SaaS companies, this is typically the billing address. All address fields are optional: fields can be omitted or have null value, but empty strings are not allowed. Anrok will return an error if the address does not have enough information to determine the top-level taxing jurisdiction with high confidence.'
          anyOf:
            - $ref: '#/components/schemas/CustomerAddress'
            - $ref: '#/components/schemas/CustomerLegacyUsOnlyAddress'
        customerName:
          $ref: '#/components/schemas/CustomerName'
        customerEmailAddress:
          $ref: '#/components/schemas/CustomerEmailAddress'
        customerTaxIds:
          description: Tax IDs for the customer receiving the product
          type: array
          items:
            $ref: '#/components/schemas/CustomerTaxId'
        shipFromAddress:
          description: Optional. The address where the product will be shipped from. Some jurisdictions calculate taxes based on the ship-from address. Defaults to your Anrok business address if omitted.
          anyOf:
            - $ref: '#/components/schemas/CustomerAddress'
            - $ref: '#/components/schemas/CustomerLegacyUsOnlyAddress'
        accountingDate:
          description: The date that this transaction occurred, for accounting purposes. Accounting date will typically correspond to the invoice date. This is used to determine which tax return the transaction belongs to.
          type: string
          format: date
          example: '2017-07-21'
        accountingTime:
          description: The time that this transaction occurred, for accounting purposes. If `accountingDate` is not provided, `accountingTime` is required to compute an accounting date for the transaction.
          type: string
          format: date-time
          example: '2017-07-21T17:32:28Z'
        accountingTimeZone:
          description: A “tz database” string used to compute an accounting date from the request's `accountingTime`. The request cannot provide both an `accountingDate` and an `accountingTimeZone`. If `accountingTime` is provided without specifying an `accountingTimeZone`, the time zone configured on the seller account will be used.
          type: string
          enum:
            - UTC
            - America/New_York
            - America/Chicago
            - America/Denver
            - America/Los_Angeles
            - America/Anchorage
            - Pacific/Honolulu
            - Australia/Perth
            - Australia/Adelaide
            - Australia/Darwin
            - Australia/Brisbane
            - Australia/Sydney
            - America/Halifax
            - America/Toronto
            - America/Winnipeg
            - America/Regina
            - America/Edmonton
            - America/Vancouver
            - Europe/Berlin
            - Europe/Brussels
            - Europe/Dublin
            - Europe/Helsinki
            - Europe/London
            - Europe/Paris
            - Europe/Rome
            - Europe/Stockholm
            - Asia/Tokyo
            - Asia/Singapore
        taxDate:
          description: The date to use for tax calculations. If omitted, Anrok will use the accounting date.
          type: string
          format: date
          example: '2017-07-21'
      required:
        - lineItems
        - currencyCode
        - customerAddress
    CreateOrUpdateTransaction:
      allOf:
        - $ref: '#/components/schemas/Transaction'
        - type: object
          properties:
            customerId:
              $ref: '#/components/schemas/CustomerId'
            id:
              description: The ID of the new transaction. This must be unique across the entire seller account. This is typically the billing system's invoice ID with some prefix to disambiguate different systems.
              type: string
              examples:
                - v1:2706174
                - stripe:in_1JSW342eZvKYlo2C
          required:
            - id
    NotTaxedReason:
      type: object
      properties:
        type:
          description: The reason a line item is not taxed.
          type: string
          enum:
            - exempt
            - jurisHasNoTax
            - notCollecting
            - productNotTaxed
        reason:
          description: The detailed reason for an exemption. Only set when the type is 'exempt'.
          type: object
          properties:
            type:
              enum:
                - reverseCharge
                - customerExempt
                - transactionExempt
    CreateEphemeralTransactionSuccess:
      type: object
      properties:
        taxAmountToCollect:
          description: The total tax amount to collect from the customer, in the smallest denomination of the currency (e.g. cents or pennies).
          type: integer
          format: int64
        lineItems:
          description: The tax amount to collect, pre-tax amount, and taxes by jurisdiction for each line item. Line items are returned in the same order they are received.
          type: array
          items:
            type: object
            properties:
              id:
                description: Identifier for the line item that was provided in the request. If no identifier was provided, this is null.
                type:
                  - string
                  - 'null'
              taxAmountToCollect:
                description: The tax amount to collect for the line item, in the smallest denomination of the currency (e.g. cents or pennies).
                type: integer
                format: int64
              preTaxAmount:
                description: The pre-tax amount for the line item, in the smallest denomination of the currency (e.g. cents or pennies).
                type: string
                format: Decimal
              jurises:
                description: For each jurisdiction, either a list of taxes for the line item, or a reason that the line item is not taxed.
                type: array
                items:
                  type: object
                  properties:
                    name:
                      description: The name of the jurisdiction.
                      type: string
                    notTaxedReason:
                      description: A reason that the line item is not taxed, or null if it is taxed.
                      oneOf:
                        - $ref: '#/components/schemas/NotTaxedReason'
                        - type: 'null'
                    taxes:
                      description: A list of taxes for the line item in the jurisdiction, or null if it is not taxed.
                      type:
                        - array
                        - 'null'
                      items:
                        type: object
                        properties:
                          taxName:
                            description: The name or abbreviation of the tax type (e.g. "VAT" or "Tax").
                            type: string
                          taxableAmount:
                            description: The amount on which tax is calculated, in the smallest denomination of the currency (e.g. cents or pennies).
                            type: string
                            format: Decimal
                          taxAmount:
                            description: The amount of tax, in the smallest denomination of the currency (e.g. cents or pennies).
                            type: string
                            format: Decimal
                          taxRate:
                            description: The tax rate, between 0 and 1. Make sure to include the taxableAmount in your tax rate calculations.
                            type: string
                            format: Decimal
        preTaxAmount:
          description: The total pre-tax amount for the transaction, in the smallest denomination of the currency (e.g. cents or pennies).
          type: string
          format: Decimal
        jurisSummaries:
          description: For each jurisdiction, a summary of the reasons that the line items are not taxed, or null if some items are taxed.
          type: array
          items:
            type: object
            properties:
              name:
                description: The name of the jurisdiction.
                type: string
              notTaxedReasons:
                description: A list of the distinct reasons that the line items are not taxed, or null if some items are taxed.
                oneOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/NotTaxedReason'
                  - type: 'null'
    CreateOrUpdateTransactionSuccess:
      allOf:
        - type: object
          properties:
            version:
              description: The transaction version
              type: integer
              format: int32
        - $ref: '#/components/schemas/CreateEphemeralTransactionSuccess'
    CreateTransactionCannotComputeTaxAmount:
      type: object
      description: Error computing tax amount to be collected
      properties:
        type:
          type: string
          enum:
            - accountingTimeZoneNotSetForSeller
            - accountingTimeZoneNotSupported
            - currencyCodeNotSupported
            - customerAddressCouldNotResolve
            - customerIdNotFound
            - externalServiceError
            - jurisNotFound
            - productExternalIdUnknown
            - productTaxCategoryNotSupportedForJuris
            - taxDateTooFarInFuture
            - taxDateTooFarInPast
        productExternalId:
          description: The product external ID that was not configured in Anrok. Only set if type is 'productExternalIdUnknown'.
          type: string
    CreateTransactionCannotUpdate:
      type: object
      description: Error updating transaction
      properties:
        type:
          type: string
          enum:
            - transactionFrozenForFiling
    CreateEphemeralTransaction:
      allOf:
        - $ref: '#/components/schemas/Transaction'
        - type: object
          properties:
            customerId:
              description: |
                The Anrok customer ID used to link transactions for the same customer and to look up tax exemption certificates for a customer. This is typically the billing system's customer ID with a prefix to disambiguate.
                - If customerId is provided without customerName, that customer object must
                  already exist in Anrok.
                - Customer IDs are unique across the entire seller account.
              type: string
              examples:
                - v1:1292
                - stripe:cus_K39sWBu92Lo
    CommonTransactionProperties:
      type: object
      properties:
        id:
          description: The ID of the transaction.
          type: string
          example: stripe:in_1JSW342eZvKYlo2C
        anrokCreatedTime:
          description: The timestamp when the transaction was created in Anrok.
          type: string
          format: date-time
          example: '2025-01-01T00:00:00Z'
        anrokModifiedTime:
          description: The timesstamp when the transaction was last modified in Anrok.
          type: string
          format: date-time
          example: '2025-01-02T18:00:00Z'
        sourceBillingSystem:
          description: The billing system that the transaction originated from, if any.
          type:
            - object
            - 'null'
          properties:
            name:
              type: string
              examples:
                - stripe
                - netsuite
                - quickbooks
            integrationId:
              type: string
              example: si5kec86tpyt
            invoiceId:
              type: string
              example: in_1JSW342eZvKYlo2C
    TaxAmountDue:
      description: The tax amount due in the smallest denomination of the currency (e.g. cents or pennies).
      type: object
      properties:
        inclusive:
          description: The inclusive tax amount in the smallest denomination of the currency (e.g. cents or pennies).
          type: string
          format: Decimal
          example: '100.00'
        exclusive:
          description: The exclusive tax amount in the smallest denomination of the currency (e.g. cents or pennies).
          type: string
          format: Decimal
          example: '10.00'
        total:
          description: The total tax amount in the smallest denomination of the currency (e.g. cents or pennies).
          type: string
          format: Decimal
          example: '110.00'
    JurisSummary:
      description: Summary of the tax amount due and tax ID validation for a jurisdiction.
      type: object
      properties:
        id:
          description: The ID of the jurisdiction.
          type: string
          example: us-TX
        name:
          description: The name of the jurisdiction.
          type: string
          example: Texas
        preTaxAmount:
          description: The pre-tax amount in the smallest denomination of the currency (e.g. cents or pennies).
          type: string
          format: Decimal
          example: '100.00'
        taxAmountDue:
          $ref: '#/components/schemas/TaxAmountDue'
        taxIdValidation:
          type: object
          properties:
            processedTaxIds:
              description: The tax IDs that were processed.
              type: array
              items:
                type: object
                properties:
                  taxId:
                    description: The tax ID.
                    type: string
                    example: '1234567890'
                  isValid:
                    description: Whether the tax ID is valid.
                    type: boolean
    LineItemJurisTax:
      description: Taxes for a line item for a jurisdiction or region.
      type: object
      properties:
        id:
          description: The ID of the jurisdiction or region.
          type: string
          example: '4109000'
        name:
          description: The name of the jurisdiction or region.
          type: string
          example: Hill County
        nonTaxableAmount:
          description: The non-taxable amount of the line item in the smallest denomination of the currency (e.g. cents or pennies).
          type: string
          format: Decimal
          example: '100.00'
        exemptions:
          type: array
          items:
            type: object
            properties:
              reason:
                description: The reason for the exemption.
                type: string
                enum:
                  - reverseCharge
                  - customerExempt
                  - transactionExempt
              amount:
                description: The amount of the exemption in the smallest denomination of the currency (e.g. cents or pennies).
                type: string
                format: Decimal
                example: '100.00'
        taxableAmount:
          description: The taxable amount of the line item in the smallest denomination of the currency (e.g. cents or pennies).
          type: string
          format: Decimal
          example: '100.00'
        rate:
          description: The tax rate.
          type:
            - string
            - 'null'
          format: Decimal
          example: '0.05'
        taxAmount:
          description: The tax amount of the line item in the smallest denomination of the currency (e.g. cents or pennies).
          type: object
          properties:
            inclusive:
              description: The inclusive tax amount in the smallest denomination of the currency (e.g. cents or pennies).
              type: string
              format: Decimal
              example: '100.00'
            exclusive:
              description: The exclusive tax amount in the smallest denomination of the currency (e.g. cents or pennies).
              type: string
              format: Decimal
              example: '10.00'
    LineItem:
      description: Line item details
      type: object
      properties:
        id:
          description: The ID of the line item in the source billing system, if available.
          type:
            - string
            - 'null'
          example: li_1234567890
        product:
          type: object
          properties:
            internalId:
              description: The internal ID of the product.
              type: string
              example: saas-product-1
            externalId:
              description: The external ID of the product.
              type: string
              example: product-1234567890
            name:
              description: The name of the product.
              type: string
              example: Product 1
            productTaxCategory:
              description: The tax category of the product.
              type: object
              properties:
                type:
                  description: The type of the product tax category.
                  type: string
                  enum:
                    - standard
                    - custom
                id:
                  description: The ID of the product tax category.
                  type: string
                  example: saasBusiness
                name:
                  description: The name of the product tax category.
                  type: string
                  example: SaaS - General, B2B
        quantity:
          description: The quantity of the line item.
          type:
            - string
            - 'null'
          format: Decimal
          example: '1'
        unitPrice:
          description: The unit price of the line item in the smallest denomination of the currency (e.g. cents or pennies).
          type:
            - string
            - 'null'
          format: Decimal
          example: '100.00'
        inputAmount:
          description: The input amount of the line item in the smallest denomination of the currency (e.g. cents or pennies).
          type: integer
          format: int64
          example: 10000
        preTaxAmount:
          description: The pre-tax amount of the line item in the smallest denomination of the currency (e.g. cents or pennies).
          type: string
          format: Decimal
          example: '100.00'
        taxAmountDue:
          $ref: '#/components/schemas/TaxAmountDue'
        jurises:
          type: array
          items:
            type: object
            properties:
              name:
                description: The name of the jurisdiction.
                type: string
                example: Texas
              id:
                description: The ID of the jurisdiction.
                type: string
                example: us-TX
              calc:
                oneOf:
                  - title: TaxCalcRemitting
                    type: object
                    properties:
                      isRemitting:
                        description: Whether the seller is remitting tax to the jurisdiction.
                        type: boolean
                        const: true
                      taxes:
                        description: The taxes for each line item for the jurisdiction.
                        type: array
                        items:
                          $ref: '#/components/schemas/LineItemJurisTax'
                  - title: TaxCalcIfWereRemitting
                    type: object
                    properties:
                      isRemitting:
                        description: Whether the seller is remitting tax to the jurisdiction.
                        type: boolean
                        const: false
                      taxesIfWereRemitting:
                        description: The taxes for each line item for the jurisdiction if the seller were remitting tax.
                        type: array
                        items:
                          $ref: '#/components/schemas/LineItemJurisTax'
    NormalTransactionBody:
      type: object
      properties:
        accountingDate:
          description: The date that this transaction occurred, for accounting purposes.
          type: string
          format: date
          example: '2025-01-01'
        taxDate:
          description: The date to use for tax calculations.
          type: string
          format: date
          example: '2025-01-01'
        currencyCode:
          description: Three letter ISO currency code (case insensitive).
          type: string
          minLength: 3
          maxLength: 3
          examples:
            - USD
            - GBP
            - EUR
        customer:
          type:
            - object
            - 'null'
          properties:
            id:
              description: The Anrok customer ID.
              type: string
              example: cus_1234567890
            name:
              description: The name of the customer.
              type:
                - string
                - 'null'
              example: John Doe
        addresses:
          type: array
          items:
            type: object
            properties:
              address:
                $ref: '#/components/schemas/CustomerAddress'
            example:
              address:
                city: null
                line1: null
                region: TX
                country: US
                postalCode: '10101'
        inputAmount:
          type: integer
          format: int64
          description: The input amount in the smallest denomination of the currency (e.g. cents or pennies).
          example: 39800
        preTaxAmount:
          type: string
          format: Decimal
          description: The pre-tax amount in the smallest denomination of the currency (e.g. cents or pennies).
          example: '39800'
        taxAmountDue:
          allOf:
            - $ref: '#/components/schemas/TaxAmountDue'
            - example:
                inclusive: '0'
                exclusive: '2467.6'
                total: '2467.6'
        taxAmountAdded:
          type: object
          properties:
            expected:
              type: integer
              format: int64
              description: The expected tax amount to add in the smallest denomination of the currency (e.g. cents or pennies).
              example: 2468
            seen:
              type: integer
              format: int64
              description: The tax amount that Anrok saw was added in the smallest denomination of the currency (e.g. cents or pennies).
              example: 2468
        invoiceTotalAmountExpected:
          type: integer
          format: int64
          description: The expected total amount of the invoice in the smallest denomination of the currency (e.g. cents or pennies).
          example: 42268
        jurisSummaries:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/JurisSummary'
              - example:
                  id: us-TX
                  name: Texas
                  preTaxAmount: '39800'
                  taxAmountDue:
                    inclusive: '0'
                    exclusive: '2467.6'
                    total: '2467.6'
                  taxIdValidation:
                    processedTaxIds:
                      - taxId: '1234567890'
                        isValid: true
        lineItems:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/LineItem'
              - example:
                  id: li_1234567890
                  product:
                    internalId: sp3hgz76gve3
                    externalId: PLU1
                    name: Product 1
                    productTaxCategory:
                      type: standard
                      id: saasBusiness
                      name: SaaS - General, B2B
                  quantity: null
                  unitPrice: null
                  inputAmount: 39800
                  preTaxAmount: '39800'
                  taxAmountDue:
                    inclusive: '0'
                    exclusive: '2467.6'
                    total: '2467.6'
                  jurises:
                    - id: us-TX
                      name: Texas
                      calc:
                        isRemitting: true
                        taxes:
                          - id: ''
                            name: Texas
                            nonTaxableAmount: '7960'
                            exemptions: []
                            taxableAmount: '31840'
                            rate: '0.0625'
                            taxAmount:
                              inclusive: '0'
                              exclusive: '1990'
                          - id: '4109000'
                            name: Hill County
                            nonTaxableAmount: '7960'
                            exemptions: []
                            taxableAmount: '31840'
                            rate: '0.005'
                            taxAmount:
                              inclusive: '0'
                              exclusive: '159.2'
                          - id: '2109108'
                            name: Aquilla
                            nonTaxableAmount: '7960'
                            exemptions: []
                            taxableAmount: '31840'
                            rate: '0.01'
                            taxAmount:
                              inclusive: '0'
                              exclusive: '318.4'
    NormalTransactionResponse:
      description: Normal transaction
      type: object
      allOf:
        - type: object
          properties:
            type:
              type: string
              const: normal
        - $ref: '#/components/schemas/CommonTransactionProperties'
        - type: object
          properties:
            body:
              $ref: '#/components/schemas/NormalTransactionBody'
    VoidedTransactionResponse:
      description: Voided transaction
      type: object
      allOf:
        - type: object
          properties:
            type:
              type: string
              const: void
        - $ref: '#/components/schemas/CommonTransactionProperties'
    LastModifiedAfterFilter:
      type: object
      properties:
        type:
          type: string
          enum:
            - lastModifiedAfter
        value:
          type: string
          format: date-time
          description: Only return transactions that were last modified after this time in Anrok. Must be an ISO 8601 date-time in UTC.
          example: '2025-01-01T00:00:00Z'
    FilingInfoFilter:
      type: object
      properties:
        type:
          type: string
          enum:
            - filingInfo
        value:
          type: object
          description: Only return transactions that are associated with the specified filing.
          properties:
            filingAssociationStatus:
              type: string
              enum:
                - associated
            jurisId:
              type: string
              examples:
                - us-MA
            jurisFilingId:
              type: string
              examples:
                - 2025-01
    ValidateTaxId:
      type: object
      properties:
        customerAddress:
          description: The customer address. This address determines the applicable taxable jurisdictions for the customer. If the provided address cannot be resolved to a taxable jurisdiction with high confidence Anrok will return customerAddressCouldNotResolve.
          $ref: '#/components/schemas/CustomerAddress'
        customerTaxIds:
          description: The tax IDs to validate.
          type: array
          items:
            type: object
            properties:
              value:
                description: The tax ID to validate.
                type: string
            required:
              - value
      required:
        - customerAddress
        - customerTaxIds
    ValidateTaxIdSuccess:
      type: object
      properties:
        jurises:
          description: List of applicable taxable jurisdictions that require tax ID collection/validation based on the customer address.
          type: array
          items:
            type: object
            properties:
              name:
                description: A user-friendly name for the jurisdiction.
                type: string
              taxIdNames:
                description: List of applicable tax IDs to collect/validate for the jurisdiction.
                type: object
                properties:
                  name:
                    description: A user-friendly tax ID name.
                    type: string
                  abbreviation:
                    description: The tax ID abbreviation (if any).
                    type:
                      - string
                      - 'null'
              validTaxIds:
                description: A list of tax IDs from the API request that are valid in the jurisdiction.
                type: array
                items:
                  type: object
                  properties:
                    value:
                      description: The valid tax ID(s) from the request.
                      type: string
    ResolveAddressSuccess:
      type: object
      properties:
        resolvedAddress:
          description: The resolved customer address. For addresses in the United States and Canada the full address is returned; for all other countries only the country is populated.
          $ref: '#/components/schemas/CustomerAddress'
        jurisdictions:
          description: The taxable jurisdiction(s) the address resolves to.
          type: array
          items:
            type: object
            properties:
              id:
                description: The jurisdiction's unique identifier.
                type: string
              name:
                description: A user-friendly name for the jurisdiction.
                type: string
            required:
              - id
              - name
      required:
        - resolvedAddress
        - jurisdictions
    ProductTaxCategoryId:
      description: Identifier for a product tax category (PTC), consisting of a `type` and `id`. A PTC may be one of the standard PTCs that Anrok provides or a custom PTC that has been created on your seller account.
      type: object
      properties:
        type:
          description: Whether this PTC is one of Anrok's standard PTCs or a custom PTC defined on your seller account.
          type: string
          enum:
            - standard
            - custom
        id:
          description: The ID of the PTC. For a standard PTC, this is an Anrok internal identifier (for example, `saasBusiness`). For a custom PTC, this is the ID assigned when the PTC was created on the seller account.
          type: string
          examples:
            - saasBusiness
            - sptc95hf85bdcd
      required:
        - type
        - id
    CreateProduct:
      type: object
      properties:
        externalId:
          description: Your unique identifier for this product. The external ID may contain only alphanumeric characters, spaces, and `.-_:`. It must not contain leading or trailing spaces or consecutive spaces.
          type: string
          examples:
            - sku-1001
        taxCategoryId:
          description: Identifier for the product tax category (PTC), consisting of a `type` and `id`, to assign to this product. A PTC may be one of the standard PTCs that Anrok provides or a custom PTC that has been created on your seller account. Use the [List product tax categories endpoint](#tag/Products/operation/productTaxCategoriesList) to list the PTCs that are available on your seller account.
          $ref: '#/components/schemas/ProductTaxCategoryId'
        name:
          description: The product's display name.
          type: string
          examples:
            - Pro plan
        description:
          description: Optional description of the product.
          type:
            - string
            - 'null'
          examples:
            - Monthly subscription to the Pro plan.
      required:
        - externalId
        - taxCategoryId
        - name
    ProductBase:
      type: object
      properties:
        name:
          description: The product's display name.
          type: string
          examples:
            - Acme Enterprise
        description:
          description: The product's description. Empty string if no description has been set.
          type: string
          examples:
            - Premium Acme offering for enterprise customers
        taxCategoryId:
          description: The identifier for the product's product tax category (PTC).
          $ref: '#/components/schemas/ProductTaxCategoryId'
        taxCategoryName:
          description: The display name of the product's product tax category (PTC).
          type: string
          examples:
            - SaaS - General, B2B
        createdTime:
          description: The time at which the product was created in Anrok.
          type: string
          format: date-time
          examples:
            - '2026-06-04T00:00:00.000Z'
        productType:
          description: The type of product. A `regular` product corresponds to a product from your billing system with an external ID. A `default` product is assigned to transactions from an integration with line items whose external ID is not configured in Anrok.
          type: string
          enum:
            - regular
            - default
      required:
        - name
        - description
        - taxCategoryId
        - taxCategoryName
        - createdTime
        - productType
    RegularProduct:
      description: A regular product, created in your Anrok account and identified by an external ID.
      allOf:
        - $ref: '#/components/schemas/ProductBase'
        - type: object
          properties:
            productType:
              type: string
              const: regular
            externalId:
              description: Your unique external ID for the product.
              type: string
              examples:
                - ENT1
          required:
            - externalId
    DefaultProduct:
      description: A default product is assigned to transactions from an integration with line items whose external ID is not configured in Anrok. Default products are only returned when `includeDefaultProducts` is `true` in the request.
      allOf:
        - $ref: '#/components/schemas/ProductBase'
        - type: object
          properties:
            productType:
              type: string
              const: default
            defaultForSellerIntegrationId:
              description: The ID of the integration that this default product belongs to.
              type: string
              examples:
                - si445fn945z5
            defaultForLineItemType:
              description: The line item type that this default product applies to (either `product` or `shipping`).
              type: string
              enum:
                - product
                - shipping
              examples:
                - product
          required:
            - defaultForSellerIntegrationId
            - defaultForLineItemType
    ProductResponse:
      description: A product in your Anrok account. The shape depends on `productType`. `regular` products include an `externalId`; `default` products include `defaultForSellerIntegrationId` and `defaultForLineItemType`.
      oneOf:
        - $ref: '#/components/schemas/RegularProduct'
        - $ref: '#/components/schemas/DefaultProduct'
      discriminator:
        propertyName: productType
        mapping:
          regular: '#/components/schemas/RegularProduct'
          default: '#/components/schemas/DefaultProduct'
  responses:
    EmptyResponse:
      description: OK
      content:
        application/json:
          schema:
            type: object
          example: {}
    RateLimit:
      description: Too Many Requests
      headers:
        Retry-After:
          description: Number of seconds to wait for rate limit to reset.
          schema:
            type: integer
      content:
        text/plain:
          schema:
            type: string
          example: You've exceeded your API limit of 10 per second
    ListCustomersSuccess:
      description: OK
      content:
        application/json:
          schema:
            type: object
            properties:
              customers:
                description: The list of customers, in ascending customer ID order.
                type: array
                items:
                  $ref: '#/components/schemas/CustomerResponse'
              nextCursor:
                description: The cursor to use to fetch the next page of results. Null if there are no more pages.
                type:
                  - string
                  - 'null'
                examples:
                  - eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
              hasMore:
                description: Whether there are more customers available beyond this page.
                type: boolean
            required:
              - customers
              - nextCursor
              - hasMore
    GetCertificateSuccess:
      description: OK
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CustomerCertificateResponse'
    ListCertificatesSuccess:
      description: OK
      content:
        application/json:
          schema:
            type: object
            properties:
              certificates:
                description: The list of certificates.
                type: array
                items:
                  $ref: '#/components/schemas/CustomerCertificateResponse'
              nextCursor:
                description: The cursor to use to fetch the next page of results. Null if there are no more pages.
                type:
                  - string
                  - 'null'
                examples:
                  - eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
              hasMore:
                description: Whether there are more certificates available beyond this page.
                type: boolean
            required:
              - certificates
              - nextCursor
              - hasMore
    ListCertificatesBadRequest:
      description: Bad Request
      content:
        text/plain:
          schema:
            type: string
          examples:
            invalidStatusProvided:
              value: 'Request body: "filter": "status": Invalid enum value.'
              summary: Invalid status filter value
            invalidLimitProvided:
              value: 'Request body: "limit": Number must be less than or equal to 100.'
              summary: Invalid limit
            cursorAndFilterBothProvided:
              value: 'Request body: cursor and filter cannot both be provided.'
              summary: Cursor and filter cannot both be provided
    CreateTransactionBadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            type: string
          examples:
            missingRequiredProperty:
              value: 'Request body: "lineItems": Required.'
              summary: Missing required property
            missingCustomerAddress:
              value: 'Request body: "customerAddress": Invalid input.'
              summary: Missing "customerAddress"
            usAddressMissingCountry:
              value: 'Request body: "customerAddress": Unrecognized key(s) in object: ''state'', ''zipCode''.'
              summary: A US customer address must include the "country" property.
            redundantTimeZoneProvided:
              value: 'Request body: Cannot specify both accountingDate and accountingTimeZone.'
              summary: If accountingDate is provided then accountingTimeZone must be omitted.
            missingAccountingDate:
              value: 'Request body: Must specify either accountingDate or accountingTimeZone.'
              summary: Not enough info to determine accounting date
    CreateNegationBadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            type: string
          examples:
            missingRequestProperty:
              summary: Required property missing
              value: 'Request body: "newTransactionId": Required.'
    CreateNegationConflict:
      description: Conflict
      content:
        application/json:
          schema:
            type: object
            properties:
              type:
                type: string
                enum:
                  - transactionIdNotFound
                  - transactionExpectedVersionMismatch
                  - transactionIsAlreadyANegation
                  - duplicateTransactionId
          example:
            type: transactionExpectedVersionMismatch
    ListTransactionsSuccess:
      description: OK
      content:
        application/json:
          schema:
            type: object
            properties:
              transactions:
                description: The list of transactions.
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/NormalTransactionResponse'
                    - $ref: '#/components/schemas/VoidedTransactionResponse'
              nextCursor:
                description: The cursor to use for pagination.
                type: string
                examples:
                  - eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
              hasMore:
                description: Whether there are more transactions to fetch.
                type: boolean
    ListTransactionsBadRequest:
      description: Bad Request
      content:
        text/plain:
          schema:
            type: string
          examples:
            invalidFilterProvided:
              value: 'Request body: "filter": Invalid input.'
              summary: Invalid filter
            invalidLastModifiedAfterFilterValueProvided:
              value: 'Request body: "filter": "value": Invalid format; expecting "YYYY-MM-DDTHH:mm:ss.dddZ".'
              summary: Invalid lastModifiedAfter filter value
            invalidFilingInfoFilterValueProvided:
              value: 'Request body: "filter": "value": "jurisId": Invalid juris ID: "invalid-juris-id".'
              summary: Invalid filingInfo filter value
            invalidLimitProvided:
              value: 'Request body: "limit": Number must be less than or equal to 20.'
              summary: Invalid limit
            cursorAndFilterBothProvided:
              value: 'Request body: cursor and filter cannot both be provided.'
              summary: Cursor and filter cannot both be provided
    ListTransactionsConflict:
      description: Conflict
      content:
        application/json:
          schema:
            type: object
            properties:
              type:
                type: string
                enum:
                  - invalidCursor
                  - listTransactionsApiNotEnabled
          examples:
            invalidCursor:
              value:
                type: invalidCursor
              summary: Invalid cursor
            listTransactionsApiNotEnabled:
              value:
                type: listTransactionsApiNotEnabled
              summary: List transactions API not enabled
    ListFilingsSuccess:
      description: OK
      content:
        application/json:
          schema:
            type: object
            properties:
              filings:
                description: The list of filings.
                type: array
                items:
                  type: object
                  properties:
                    jurisId:
                      description: The ID of the jurisdiction.
                      type: string
                      examples:
                        - eu-oss
                        - us-MA
                    jurisFilingId:
                      description: The ID of the filing. This is a unique identifier for the filing within the jurisdiction.
                      type: string
                      examples:
                        - 2025-01
                    name:
                      description: The name of the filing.
                      type: string
                      examples:
                        - January 2025
                    isAutomaticallyUpdatedForTransactionChanges:
                      description: Whether the filing is automatically updated based on transaction changes. This is determined based on the status of the filing. For example, a transaction may be automatically added to or removed from a filing if the transaction's accounting date changes while the filing is "open". However, the filing is not automatically updated if the filing is locked for seller review. The filing may still be updated manually if this field is true.
                      type: boolean
                      examples:
                        - true
                    isFiled:
                      description: Whether the filing has been filed.
                      type: boolean
                      examples:
                        - false
                    period:
                      description: The period of the filing.
                      type: object
                      properties:
                        begin:
                          description: The beginning date of the filing period.
                          type: string
                          format: date
                          examples:
                            - '2025-01-01'
                        endInclusive:
                          description: The end date of the filing period (inclusive).
                          type: string
                          format: date
                          examples:
                            - '2025-01-31'
              nextCursor:
                description: The cursor to use for pagination.
                type: string
                examples:
                  - eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
              hasMore:
                description: Whether there are more filings to fetch.
                type: boolean
    ListFilingsBadRequest:
      description: Bad Request
      content:
        text/plain:
          schema:
            type: string
          examples:
            invalidJurisIdProvided:
              value: 'Request body: "filter": "jurisId": Invalid juris ID: "fake-juris-id"'
              summary: Invalid juris ID
            invalidPeriodEndDateRangeInclusiveProvided:
              value: 'Request body: "filter": "periodEndDateRangeInclusive": Invalid period end date range: begin date comes after end date.'
              summary: Invalid period end date range
            invalidLimitProvided:
              value: 'Request body: "limit": Number must be less than or equal to 100.'
              summary: Invalid limit
            cursorAndFilterBothProvided:
              value: 'Request body: cursor and filter cannot both be provided.'
              summary: Cursor and filter cannot both be provided
    ListFilingsConflict:
      description: Conflict
      content:
        application/json:
          schema:
            type: object
            properties:
              type:
                type: string
                enum:
                  - invalidCursor
                  - listFilingsApiNotEnabled
          examples:
            invalidCursor:
              value:
                type: invalidCursor
              summary: Invalid cursor
            listFilingsApiNotEnabled:
              value:
                type: listFilingsApiNotEnabled
              summary: List filings API not enabled
    ListFilingTransactionIdsSuccess:
      description: OK
      content:
        application/json:
          schema:
            type: object
            properties:
              transactionIds:
                description: The IDs of the transactions included in the filing, ordered by the transaction's accounting date.
                type: array
                items:
                  type: string
                examples:
                  - - stripe:in_1JSW342eZvKYlo2C
                    - stripe:in_1JSW342eZvKYlo2D
              nextCursor:
                description: The cursor to use to fetch the next page of transaction IDs. This is null when there are no more transaction IDs to fetch.
                type:
                  - string
                  - 'null'
                examples:
                  - eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
    ListFilingTransactionIdsBadRequest:
      description: Bad Request
      content:
        text/plain:
          schema:
            type: string
          examples:
            invalidCursorProvided:
              value: 'Request body: "cursor": Invalid cursor'
              summary: Invalid cursor
            invalidLimitProvided:
              value: 'Request body: "limit": Number must be less than or equal to 2500.'
              summary: Invalid limit
    ListFilingTransactionIdsConflict:
      description: Conflict
      content:
        application/json:
          schema:
            type: object
            properties:
              type:
                type: string
                enum:
                  - jurisIdNotFound
                  - filingListTransactionIdsApiNotEnabled
          examples:
            jurisIdNotFound:
              value:
                type: jurisIdNotFound
              summary: Juris ID not found
            filingListTransactionIdsApiNotEnabled:
              value:
                type: filingListTransactionIdsApiNotEnabled
              summary: List filing transaction IDs API not enabled
    ListFilingTransactionsWithConversionRatesSuccess:
      description: OK
      content:
        application/json:
          schema:
            type: object
            properties:
              transactionsWithConversionRates:
                description: The transactions included in the filing, each with the currency conversion rate used, ordered by the transaction's accounting date.
                type: array
                items:
                  type: object
                  properties:
                    id:
                      description: The ID of the transaction.
                      type: string
                      example: stripe:in_1JSW342eZvKYlo2C
                    fromCurrency:
                      description: The three letter ISO currency code of the transaction.
                      type: string
                      minLength: 3
                      maxLength: 3
                      examples:
                        - EUR
                        - GBP
                        - USD
                    toCurrency:
                      description: The three letter ISO currency code of the filing.
                      type: string
                      minLength: 3
                      maxLength: 3
                      examples:
                        - USD
                        - GBP
                        - EUR
                    rate:
                      description: The conversion rate used to convert amounts from the transaction currency to the filing currency, as a decimal number formatted as a string. This is null when the transaction currency is the same as the filing currency and no conversion was applied.
                      type:
                        - string
                        - 'null'
                      examples:
                        - '1.08423'
                examples:
                  - - id: stripe:in_1JSW342eZvKYlo2C
                      fromCurrency: EUR
                      toCurrency: USD
                      rate: '1.08423'
                    - id: stripe:in_1JSW342eZvKYlo2D
                      fromCurrency: USD
                      toCurrency: USD
                      rate: null
              nextCursor:
                description: The cursor to use to fetch the next page of transactions with conversion rates. This is null when there are no more transactions to fetch.
                type:
                  - string
                  - 'null'
                examples:
                  - eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
    ListFilingTransactionsWithConversionRatesBadRequest:
      description: Bad Request
      content:
        text/plain:
          schema:
            type: string
          examples:
            invalidLimitProvided:
              value: 'Request body: "limit": Number must be less than or equal to 1000.'
              summary: Invalid limit
    ListFilingTransactionsWithConversionRatesConflict:
      description: Conflict
      content:
        application/json:
          schema:
            type: object
            properties:
              type:
                type: string
                enum:
                  - invalidCursor
                  - jurisIdNotFound
                  - filingListTransactionsWithConversionRatesApiNotEnabled
          examples:
            invalidCursor:
              value:
                type: invalidCursor
              summary: Invalid cursor
            jurisIdNotFound:
              value:
                type: jurisIdNotFound
              summary: Juris ID not found
            filingListTransactionsWithConversionRatesApiNotEnabled:
              value:
                type: filingListTransactionsWithConversionRatesApiNotEnabled
              summary: List filing transactions with conversion rates API not enabled
    ListProductsSuccess:
      description: OK
      content:
        application/json:
          schema:
            type: object
            properties:
              products:
                description: The list of products, in descending order of creation time (`createdTime`).
                type: array
                items:
                  $ref: '#/components/schemas/ProductResponse'
              nextCursor:
                description: The cursor to use to fetch the next page of results. Null if there are no more pages.
                type:
                  - string
                  - 'null'
                examples:
                  - eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
              hasMore:
                description: Whether there are more products available beyond this page.
                type: boolean
            required:
              - products
              - nextCursor
              - hasMore
          example:
            products:
              - name: Default (Stripe)
                description: ''
                taxCategoryId:
                  type: standard
                  id: digitalGoodsPermanentBusiness
                taxCategoryName: Digital goods, Permanent use, B2B
                createdTime: '2026-06-24T23:36:07.122Z'
                productType: default
                defaultForSellerIntegrationId: si445fn945z5
                defaultForLineItemType: product
              - name: Acme Enterprise
                description: Premium Acme offering for enterprise customers
                taxCategoryId:
                  type: standard
                  id: saasBusiness
                taxCategoryName: SaaS - General, B2B
                createdTime: '2026-06-04T00:00:00.000Z'
                productType: regular
                externalId: ENT1
            nextCursor: null
            hasMore: false
  parameters:
    CustomerId:
      name: customerId
      in: path
      description: |
        The customer ID. URL-encode the ID if it contains special characters such as `:` or `/`.
      required: true
      schema:
        type: string
    CertificateId:
      name: certificateId
      in: path
      description: ID of the certificate.
      required: true
      schema:
        type: string
    TransactionId:
      name: transactionId
      in: path
      description: ID of the transaction.
      required: true
      schema:
        type: string
    IntegrationId:
      name: integrationId
      in: path
      description: Your unique integration ID.
      required: true
      schema:
        type: string
    JurisId:
      name: jurisId
      in: path
      description: The ID of the jurisdiction of the filing.
      required: true
      schema:
        type: string
        examples:
          - eu-oss
          - us-MA
    JurisFilingId:
      name: jurisFilingId
      in: path
      description: The ID of the filing. This is a unique identifier for the filing within the jurisdiction.
      required: true
      schema:
        type: string
        examples:
          - 2025-01
    ProductExternalId:
      name: externalId
      in: path
      description: The external ID of the product.
      required: true
      schema:
        type: string
  requestBodies:
    Empty:
      content:
        application/json:
          schema:
            type: object
          examples:
            emptyExample:
              value: {}
              summary: Empty request body
      required: true
    ListCustomers:
      content:
        application/json:
          schema:
            type: object
            properties:
              limit:
                description: The maximum number of customers to return.
                type: integer
                format: int32
                minimum: 1
                maximum: 100
                default: 25
              cursor:
                description: The cursor to use for pagination. This is the value of the `nextCursor` field returned from the previous page.
                type: string
                example: eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
          examples:
            firstPage:
              summary: List customers from the beginning
              value: {}
            cursor:
              summary: Cursor-based pagination
              value:
                cursor: eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
                limit: 5
      required: true
    ListCertificates:
      content:
        application/json:
          schema:
            type: object
            properties:
              filter:
                description: The filter to apply to the returned certificates. Cannot be provided together with `cursor`.
                type: object
                properties:
                  customerId:
                    description: Only return certificates belonging to this customer.
                    type: string
                    examples:
                      - v1:1292
                  status:
                    description: |
                      Only return certificates with this status. If omitted, certificates of all statuses are returned.
                    type: string
                    enum:
                      - active
                      - expiringSoon
                      - expired
                      - archived
                    examples:
                      - active
              limit:
                description: The maximum number of certificates to return.
                type: integer
                format: int32
                minimum: 1
                maximum: 100
                default: 25
              cursor:
                description: The cursor to use for pagination. This is the value of the `nextCursor` field returned from the previous page. Cannot be provided together with `filter`.
                type: string
                example: eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
          examples:
            noFilter:
              summary: List all certificates
              value: {}
            customerIdFilter:
              summary: Filter certificates by customer ID
              value:
                filter:
                  customerId: v1:1292
            statusFilter:
              summary: Filter certificates by status
              value:
                filter:
                  status: expiringSoon
            cursor:
              summary: Cursor-based pagination
              value:
                cursor: eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
                limit: 5
      required: true
    CreateCertificateRequest:
      content:
        application/json:
          schema:
            type: object
            properties:
              customerId:
                $ref: '#/components/schemas/CustomerId'
              customerName:
                $ref: '#/components/schemas/CustomerName'
              emailAddress:
                description: The email address of the customer contact to send the certificate request to.
                type: string
                format: email
                examples:
                  - contact@acme.com
              sendEmail:
                description: Whether to email the certificate request to the recipient. If `false`, the request is created but no email is sent — you can share the resulting `requestLink` directly.
                type: boolean
                default: true
            required:
              - customerId
              - emailAddress
          example:
            customerId: v1:1292
            customerName: Acme Inc
            emailAddress: contact@acme.com
      required: true
    CreateNegation:
      content:
        application/json:
          schema:
            type: object
            properties:
              originalTransactionId:
                description: The ID of the transaction you want to negate.
                type: string
              newTransactionId:
                description: The ID for the new negated transaction.
                type: string
              originalTransactionExpectedVersion:
                description: The expected transaction version. The refund will fail if this is not the latest version of the transaction.
                type: integer
                format: int32
            required:
              - originalTransactionId
              - newTransactionId
          example:
            originalTransactionId: stripe:in_1JSW342eZvKYlo2C
            newTransactionId: stripe:in_1JSW342eZvKYlo2C_refund
      required: true
    ListTransactions:
      content:
        application/json:
          schema:
            type: object
            properties:
              filter:
                description: The filter to apply to the returned transactions.
                oneOf:
                  - $ref: '#/components/schemas/LastModifiedAfterFilter'
                  - $ref: '#/components/schemas/FilingInfoFilter'
              limit:
                description: The maximum number of transactions to return.
                type: integer
                format: int32
                minimum: 1
                maximum: 20
                default: 10
              cursor:
                description: The cursor to use for pagination. This is the value of the `nextCursor` field returned from the previous page.
                type: string
                example: eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
          examples:
            lastModifiedAfter:
              summary: Filter transactions by last modified after
              value:
                type: lastModifiedAfter
                value: '2025-01-01T00:00:00Z'
            filingInfo:
              summary: Filter transactions by filing info
              value:
                type: filingInfo
                value:
                  filingAssociationStatus: associated
                  jurisId: us-MA
                  jurisFilingId: 2025-01
            cursor:
              summary: Cursor-based pagination
              value:
                cursor: eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
                limit: 5
      required: true
    ListFilings:
      content:
        application/json:
          schema:
            type: object
            properties:
              filter:
                description: The filter to apply to the returned filings.
                type: object
                properties:
                  jurisId:
                    description: The jurisdiction to filter by.
                    type: string
                    examples:
                      - eu-oss
                      - us-MA
                  periodEndDateRangeInclusive:
                    description: The filing period end date range to filter by.
                    type: string
                    examples:
                      - '2025'
                      - 2025-01
                      - 2025-01..2025-03
                      - 2025-01-01..2025-03-31
              limit:
                description: The maximum number of filings to return.
                type: integer
                format: int32
                minimum: 1
                maximum: 100
                default: 10
              cursor:
                description: The cursor to use for pagination. This is the value of the `nextCursor` field returned from the previous page.
                type: string
          examples:
            jurisIdFilter:
              summary: Filter filings by juris
              value:
                jurisId: us-MA
            periodEndDateRangeInclusiveFilter:
              summary: Filter filings by filing period end date range
              value:
                periodEndDateRangeInclusive: 2025-01..2025-03
            jurisIdAndPeriodEndDateRangeInclusiveFilter:
              summary: Filter filings by jurisdiction ID and filing period end date range
              value:
                jurisId: us-MA
                periodEndDateRangeInclusive: 2025-01..2025-03
            cursor:
              summary: Cursor-based pagination
              value:
                cursor: eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
                limit: 5
      required: true
    ListFilingTransactionIds:
      content:
        application/json:
          schema:
            type: object
            properties:
              limit:
                description: The maximum number of transaction IDs to return.
                type: integer
                format: int32
                minimum: 1
                maximum: 2500
                default: 100
              cursor:
                description: The cursor to use for pagination. This is the value of the `nextCursor` field returned from the previous page.
                type: string
          examples:
            firstPage:
              summary: Fetch the first page of transaction IDs
              value: {}
            cursor:
              summary: Cursor-based pagination
              value:
                cursor: eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
                limit: 500
      required: true
    ListFilingTransactionsWithConversionRates:
      content:
        application/json:
          schema:
            type: object
            properties:
              limit:
                description: The maximum number of transactions with conversion rates to return.
                type: integer
                format: int32
                minimum: 1
                maximum: 1000
                default: 100
              cursor:
                description: The cursor to use for pagination. This is the value of the `nextCursor` field returned from the previous page.
                type: string
          examples:
            firstPage:
              summary: Fetch the first page of transactions with conversion rates
              value: {}
            cursor:
              summary: Cursor-based pagination
              value:
                cursor: eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
                limit: 250
      required: true
    ListProducts:
      content:
        application/json:
          schema:
            type: object
            properties:
              limit:
                description: The maximum number of products to return.
                type: integer
                format: int32
                minimum: 1
                maximum: 1000
                default: 100
              cursor:
                description: The cursor to use for pagination. This is the value of the `nextCursor` field returned from the previous page.
                type: string
                example: eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
              includeDefaultProducts:
                description: Whether to include default products and default shipping products from any integrations in the response. When `false`, only regular products are returned.
                type: boolean
                default: false
          examples:
            firstPage:
              summary: List products from the beginning
              value: {}
            cursor:
              summary: Cursor-based pagination
              value:
                cursor: eyJleGFtcGxlIjoidGhpcyBpcyBhbiBleGFtcGxlIGN1cnNvciJ9
                limit: 5
            includeDefaultProducts:
              summary: Include default products from integrations
              value:
                includeDefaultProducts: true
      required: true
  examples:
    ConflictTaxDateTooFarInFuture:
      value:
        type: taxDateTooFarInFuture
      summary: Anrok accepts dates up to 31 days in the future.
    ConflictTaxDateTooFarInPast:
      value:
        type: taxDateTooFarInPast
      summary: Anrok only accepts dates on or after Jan 1, 1999.
    ConflictAccountingTimeZoneNotSetForSeller:
      value:
        type: accountingTimeZoneNotSetForSeller
      summary: Cannot determine accounting date from accountingTime without time zone
    ConflictProductExternalIdUnknown:
      value:
        type: productExternalIdUnknown
        productExternalId: my-new-product-id
      summary: Product IDs must have already been configured in Anrok
