openapi: 3.0.3 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. ' tags: - 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 Help Center article 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: 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 servers: - url: https://api.anrok.com paths: /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\"\ncertName=\"cert.png\"\ncertContentsBase64=$(base64\ \ -i \"$certName\")\n\ncurl -X POST https://api.anrok.com/v1/seller/certificates/create\ \ \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer\ \ $apiToken\" \\\n -d \"{\n \\\"customerId\\\": \\\"customer-id-0\\\"\ ,\n \\\"effectiveDateBegin\\\": \\\"2022-12-13\\\",\n \\\"exemptionNumber\\\ \": \\\"cert-100\\\",\n \\\"certificateFile\\\": {\n \\\"name\\\ \": \\\"$certName\\\",\n \\\"contentsBase64\\\": \\\"$certContentsBase64\\\ \"\n },\n \\\"jurises\\\": [{\n \\\"jurisId\\\": \\\"us-MA\\\ \"\n }]\n }\"" /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\"\ncertificateId=\"ctec6vx7gtrmxq\"\ \n\ncurl -X POST \"https://api.anrok.com/v1/seller/certificates/id:$certificateId/archive\"\ \ \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer\ \ $apiToken\" \\\n -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\"\ncertificateId=\"ctec6vx7gtrmxq\"\ \n\ncurl -X POST \"https://api.anrok.com/v1/seller/certificates/id:$certificateId/get\"\ \ \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer\ \ $apiToken\" \\\n -d \"{}\"\n" 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'\n\ncurl -X POST https://api.anrok.com/v1/seller/certificates/list\ \ \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer\ \ $apiToken\" \\\n -d '{\n \"filter\": {\n \"status\": \"active\"\ \n },\n \"limit\": 25\n }'\n" /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'\n\ncurl -X POST https://api.anrok.com/v1/seller/certificateRequests/create\ \ \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer\ \ $apiToken\" \\\n -d '{\n \"customerId\": \"v1:1292\",\n \"customerName\"\ : \"Acme Inc\",\n \"emailAddress\": \"contact@acme.com\"\n }'\n" /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'\n\ncurl -X POST https://api.anrok.com/v1/seller/transactions/createOrUpdate\ \ \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer\ \ $apiToken\" \\\n -d '{\n \"id\": \"stripe:in_1JSW342eZvKYlo2C\",\n\ \ \"currencyCode\": \"usd\",\n \"accountingTime\": \"2022-01-02T03:30:00Z\"\ ,\n \"accountingTimeZone\": \"UTC\",\n \"lineItems\": [{\n \"\ id\": \"item-1\",\n \"productExternalId\": \"saas-product-1\",\n \ \ \"amount\": 15000,\n \"isTaxIncludedInAmount\": false,\n \ \ \"quantity\": \"1\"\n },\n {\n \"id\": \"item-2\",\n \"\ productExternalId\": \"saas-product-2\",\n \"amount\": 31000,\n \ \ \"isTaxIncludedInAmount\": true,\n \"quantity\": \"12.3\"\n \ \ },\n {\n \"id\": \"item-3\",\n \"productExternalId\": \"\ not-taxable-3\",\n \"amount\": 24000\n }],\n \"customerAddress\"\ : {\n \"country\": \"us\",\n \"line1\": \"1450 Cherokee St\",\n\ \ \"city\": \"Denver\",\n \"region\": \"CO\",\n \"postalCode\"\ : \"80204\"\n },\n \"shipFromAddress\": {\n \"country\": \"us\"\ ,\n \"line1\": \"230 S LaSalle St\",\n \"city\": \"Chicago\",\n\ \ \"region\": \"IL\",\n \"postalCode\": \"60604\"\n }\n }'\n" /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'\n\ncurl -X POST https://api.anrok.com/v1/seller/transactions/createEphemeral\ \ \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer\ \ $apiToken\" \\\n -d '{\n \"currencyCode\": \"usd\",\n \"accountingTime\"\ : \"2022-01-02T03:30:00Z\",\n \"accountingTimeZone\": \"UTC\",\n \"\ lineItems\": [{\n \"id\": \"item-1\",\n \"productExternalId\"\ : \"saas-product-1\",\n \"amount\": 15000,\n \"isTaxIncludedInAmount\"\ : false,\n \"quantity\": \"1\"\n },\n {\n \"id\": \"item-2\"\ ,\n \"productExternalId\": \"saas-product-2\",\n \"amount\": 31000,\n\ \ \"isTaxIncludedInAmount\": true,\n \"quantity\": \"12.3\"\n\ \ },\n {\n \"id\": \"item-3\",\n \"productExternalId\":\ \ \"not-taxable-3\",\n \"amount\": 24000\n }],\n \"customerAddress\"\ : {\n \"country\": \"us\",\n \"line1\": \"1450 Cherokee St\",\n\ \ \"city\": \"Denver\",\n \"region\": \"CO\",\n \"postalCode\"\ : \"80204\"\n },\n \"shipFromAddress\": {\n \"country\": \"us\"\ ,\n \"line1\": \"230 S LaSalle St\",\n \"city\": \"Chicago\",\n\ \ \"region\": \"IL\",\n \"postalCode\": \"60604\"\n }\n }'\n" /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'\n\ncurl -X POST https://api.anrok.com/v1/seller/transactions/createRefund\ \ \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer\ \ $apiToken\" \\\n -d '{\n \"originalTransactionId\": \"stripe:in_1JSW342eZvKYlo2C\"\ ,\n \"newTransactionId\": \"stripe:in_1JSW342eZvKYlo2C_refund\"\n }'" /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'\n\ncurl -X POST https://api.anrok.com/v1/seller/transactions/id:stripe:in_1JSW342eZvKYlo2C/void\ \ \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer\ \ $apiToken\" \\\n -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'\n\ncurl -X POST https://api.anrok.com/v1/seller/transactions/list\ \ \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer\ \ $apiToken\" \\\n -d '{\n \"filter\": {\n \"type\": \"lastModifiedAfter\"\ ,\n \"value\": \"2025-08-08T16:00:00.000Z\"\n }\n }'\n" /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'\n\ncurl -X POST https://api.anrok.com/v1/seller/taxId/validate\ \ \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer\ \ $apiToken\" \\\n -d '{\n \"customerAddress\": {\n \"country\"\ : \"CA\",\n \"line1\": \"123 Main St\",\n \"city\": \"Quebec City\"\ ,\n \"region\": \"Quebec\",\n \"postalCode\": \"G1P 2J6\"\n \ \ },\n \"customerTaxIds\": [{\n \"value\": \"123456789\"\n }]\n\ \ }'" /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'\n\ncurl -X POST https://api.anrok.com/v1/seller/filings/list\ \ \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer\ \ $apiToken\" \\\n -d '{\n \"filter\": {\n \"jurisId\": \"us-MA\"\ ,\n \"periodEndDateRangeInclusive\": \"2025-01..2025-03\"\n }\n\ \ }'\n" /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/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: 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.\n- If customerId\ \ is provided without customerName, that customer object must\n already exist\ \ in Anrok.\n- If both customerId and customerName are provided, the customer\ \ object will\n be created if it is not already present.\n- Customer IDs\ \ are unique across the entire seller account.\n" type: string examples: - v1:1292 - stripe:cus_K39sWBu92Lo CustomerName: description: The name of the customer. This is used for display purposes only. type: string examples: - Acme Inc 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 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 nullable: true 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 nullable: true 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 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 - 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 nullable: true examples: - UK - United Kingdom line1: description: The "delivery line" of the address type: string nullable: true city: description: City or town name type: string nullable: true region: description: Other principal subdivision (i.e. province, state, county) type: string nullable: true postalCode: description: Postal code type: string nullable: true 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 nullable: true city: description: The standard USPS format type: string nullable: true state: description: The standard USPS format type: string nullable: true zipCode: description: The standard USPS format type: string nullable: true required: - country example: country: us line1: 123 Main St city: White Plains state: NY zipCode: '10601' 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' 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 nullable: true 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 nullable: true 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.\n- If customerId is provided without customerName, that\ \ customer object must\n already exist in Anrok.\n- Customer IDs are\ \ unique across the entire seller account.\n" type: string examples: - v1:1292 - stripe:cus_K39sWBu92Lo 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 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 nullable: true 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 nullable: true 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 nullable: true 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 nullable: true 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 nullable: true 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 enum: - 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 enum: - 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 nullable: true properties: id: description: The Anrok customer ID. type: string example: cus_1234567890 name: description: The name of the customer. type: string nullable: true 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 enum: - 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 enum: - void - $ref: '#/components/schemas/CommonTransactionProperties' 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 nullable: true 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 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 nullable: true examples: - Monthly subscription to the Pro plan. required: - externalId - taxCategoryId - name responses: 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 EmptyResponse: description: OK content: application/json: schema: type: object example: {} 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 nullable: true 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 parameters: 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 you want to void. required: true schema: type: string IntegrationId: name: integrationId in: path description: Your unique integration ID. required: true schema: type: string 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 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 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 security: - http: []