# Anrok

> Manage customers, tax calculations, transactions, exemption certificates, products and filings.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/anrok

## Actions

### Add product mapping

Add product mapping.

**Inputs**

- Integration ID (`integration_id`, text, required): Your unique integration ID.
- Source ID (`source_id`, text, required): Source product ID from billing system.
- Target ID (`target_id`, text, required): Target product ID on Anrok. This product must already exist in Anrok.
- Should overwrite (`should_overwrite`, true/false): Whether this request should override an existing `sourceId` mapping.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}
```

### Archive customer certificate

Archive customer certificate.

**Inputs**

- Certificate (`certificate_id`, text, required): ID of the certificate.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}
```

### Create customer

Create customer.

**Inputs**

- Id (`id`, text, required): 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.
- Name (`name`, text, required): The name of the customer. This is used for display purposes only.
- Email address (`email_address`, text): Optional email address of the customer.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}
```

### Create customer certificate

Create customer certificate.

**Inputs**

- Customer (`customer_id`, text, required): 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.
- Customer name (`customer_name`, text): The name of the customer. This is used for display purposes only.
- Effective date begin (`effective_date_begin`, date, required): Effective date of certificate
- Exemption number (`exemption_number`, text): Certificate exemption number. This is used for display purposes only.
- Notes (`notes`, text): Optional internal notes.
- Type (`type`, text): 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. One of: `agricultural`, `directPay`, `educational`, `energy`, `governmentFederal`, `governmentOther`, `governmentState`, `healthcare`, `manufacturing`, `nativeAmericanTribal`, and 5 more.
- Certificate file (`certificate_file`, object, required): Additional structured certificate file. Use the documented fields.
- Jurises (`jurises`, list, required): Jurisdictions for which certificate applies

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "id": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Create customer certificate request

Create customer certificate request.

**Inputs**

- Customer (`customer_id`, text, required): 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.
- Customer name (`customer_name`, text): The name of the customer. This is used for display purposes only.
- Email address (`email_address`, text, required): The email address of the customer contact to send the certificate request to.
- Send email (`send_email`, true/false): 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.
- Auto approve (`auto_approve`, true/false): Whether to automatically approve the certificate once the customer submits it, instead of leaving the submission pending review in the Anrok dashboard. If a submission cannot be approved automatically, it falls back to the standard review flow.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "requestId": "example",
    "requestLink": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Create ephemeral transaction

Create ephemeral transaction. Returns the full service response for the connected account.

**Inputs**

- Line items (`line_items`, list, required): The line items in the transaction.
- Currency code (`currency_code`, text, required): Three letter ISO currency code (case insensitive).
- Customer address (`customer_address`, object, required): Additional structured customer address. Use the documented fields.
- Customer name (`customer_name`, text): The name of the customer. This is used for display purposes only.
- Customer email address (`customer_email_address`, text): The email address of the customer. This is used for display purposes only.
- Customer tax IDs (`customer_tax_ids`, list): Tax IDs for the customer receiving the product
- Ship from address (`ship_from_address`, object): Additional structured ship from address. Use the documented fields.
- Accounting date (`accounting_date`, date): 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.
- Accounting time (`accounting_time`, time): 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.
- Accounting time zone (`accounting_time_zone`, text): 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. One of: `UTC`, `America/New_York`, `America/Chicago`, `America/Denver`, `America/Los_Angeles`, `America/Anchorage`, `Pacific/Honolulu`, `Australia/Perth`, `Australia/Adelaide`, `Australia/Darwin`, and 18 more.
- Tax date (`tax_date`, date): The date to use for tax calculations. If omitted, Anrok will use the accounting date.
- User friendly ID (`user_friendly_id`, text): Optional. A human-readable ID for the transaction. This is typically the invoice number displayed in your billing system.
- Tax amount added (`tax_amount_added`, number): Optional. The total amount of tax already on this invoice, in the smallest denomination of the currency (e.g. cents). Not used for tax calculation; Anrok compares this against the tax it calculates in order to track tax discrepancies. If omitted, Anrok does not calculate tax discrepancies.
- Customer (`customer_id`, text): 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.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "jurisSummaries": [],
    "lineItems": [],
    "preTaxAmount": "example",
    "taxAmountToCollect": 1,
    "taxComplianceMessage": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Create negation

Create negation.

**Inputs**

- Original transaction ID (`original_transaction_id`, text, required): The ID of the transaction you want to negate.
- New transaction ID (`new_transaction_id`, text, required): The ID for the new negated transaction.
- Original transaction expected version (`original_transaction_expected_version`, number): The expected transaction version. The refund will fail if this is not the latest version of the transaction.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}
```

### Create or update transaction

Create or update transaction.

**Inputs**

- Line items (`line_items`, list, required): The line items in the transaction.
- Currency code (`currency_code`, text, required): Three letter ISO currency code (case insensitive).
- Customer address (`customer_address`, object, required): Additional structured customer address. Use the documented fields.
- Customer name (`customer_name`, text): The name of the customer. This is used for display purposes only.
- Customer email address (`customer_email_address`, text): The email address of the customer. This is used for display purposes only.
- Customer tax IDs (`customer_tax_ids`, list): Tax IDs for the customer receiving the product
- Ship from address (`ship_from_address`, object): Additional structured ship from address. Use the documented fields.
- Accounting date (`accounting_date`, date): 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.
- Accounting time (`accounting_time`, time): 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.
- Accounting time zone (`accounting_time_zone`, text): 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. One of: `UTC`, `America/New_York`, `America/Chicago`, `America/Denver`, `America/Los_Angeles`, `America/Anchorage`, `Pacific/Honolulu`, `Australia/Perth`, `Australia/Adelaide`, `Australia/Darwin`, and 18 more.
- Tax date (`tax_date`, date): The date to use for tax calculations. If omitted, Anrok will use the accounting date.
- User friendly ID (`user_friendly_id`, text): Optional. A human-readable ID for the transaction. This is typically the invoice number displayed in your billing system.
- Tax amount added (`tax_amount_added`, number): Optional. The total amount of tax already on this invoice, in the smallest denomination of the currency (e.g. cents). Not used for tax calculation; Anrok compares this against the tax it calculates in order to track tax discrepancies. If omitted, Anrok does not calculate tax discrepancies.
- Customer (`customer_id`, text): 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.
- Id (`id`, text, required): 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.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "jurisSummaries": [],
    "lineItems": [],
    "preTaxAmount": "example",
    "taxAmountToCollect": 1,
    "taxComplianceMessage": "example",
    "version": 1
  },
  "has_more": false,
  "next_cursor": null
}
```

### Create product

Create product.

**Inputs**

- External ID (`external_id`, text, required): 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.
- Tax category ID (`tax_category_id`, object, required): Additional structured tax category id. Use the documented fields.
- Name (`name`, text, required): The product's display name.
- Description (`description`, text): Optional description of the product.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}
```

### Get customer

Get customer. Returns the full service response for the connected account.

**Inputs**

- Customer (`customer_id`, text, required): The customer ID. URL-encode the ID if it contains special characters such as `:` or `/`.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "emailAddress": "example",
    "id": "example",
    "name": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Get customer certificate

Get customer certificate. Returns the full service response for the connected account.

**Inputs**

- Certificate (`certificate_id`, text, required): ID of the certificate.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "createdTime": "example",
    "customerId": "example",
    "customerName": "example",
    "effectiveDateBegin": "example",
    "exemptionNumber": "example",
    "expiryDate": "example",
    "id": "example",
    "jurises": [],
    "notes": "example",
    "status": "active",
    "type": "agricultural"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Get product

Get product. Returns the full service response for the connected account.

**Inputs**

- External ID (`external_id`, text, required): The external ID of the product.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "description": "example",
    "externalId": "example",
    "name": "example",
    "taxCategoryId": {
      "id": "example",
      "type": "standard"
    }
  },
  "has_more": false,
  "next_cursor": null
}
```

### Get transaction

Get transaction. Returns the full service response for the connected account.

**Inputs**

- Transaction (`transaction_id`, text, required): ID of the transaction.

**Outputs**

- `data` (object): Normal transaction
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "anrokCreatedTime": "example",
    "anrokModifiedTime": "example",
    "body": {
      "accountingDate": "example",
      "addresses": [],
      "currencyCode": "example",
      "customer": {
        "id": "example",
        "name": "example"
      },
      "inputAmount": 1,
      "invoiceTotalAmountExpected": 1,
      "jurisSummaries": [],
      "lineItems": [],
      "preTaxAmount": "example",
      "taxAmountAdded": {
        "expected": 1,
        "seen": 1
      },
      "taxAmountDue": {
        "exclusive": "example",
        "inclusive": "example",
        "total": "example"
      },
      "taxDate": "example"
    },
    "id": "example",
    "sourceBillingSystem": {
      "integrationId": "example",
      "invoiceId": "example",
      "name": "example"
    },
    "type": "normal",
    "version": 1
  },
  "has_more": false,
  "next_cursor": null
}
```

### List customer certificates

List customer certificates. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Filter (`filter`, object): Additional structured filter. Use the documented fields.
- Limit (`limit`, number): The maximum number of certificates to return. From 1 to 100.
- Cursor (`cursor`, text): 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`.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "certificates": [],
    "hasMore": false,
    "nextCursor": null
  },
  "has_more": false,
  "next_cursor": null
}
```

### List customers

List customers. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Limit (`limit`, number): The maximum number of customers to return. From 1 to 100.
- Cursor (`cursor`, text): The cursor to use for pagination. This is the value of the `nextCursor` field returned from the previous page.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "customers": [],
    "hasMore": false,
    "nextCursor": null
  },
  "has_more": false,
  "next_cursor": null
}
```

### List filing transaction IDs

List filing transaction IDs. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Juris ID (`juris_id`, text, required): The ID of the jurisdiction of the filing.
- Juris filing ID (`juris_filing_id`, text, required): The ID of the filing. This is a unique identifier for the filing within the jurisdiction.
- Limit (`limit`, number): The maximum number of transaction IDs to return. From 1 to 2500.
- Cursor (`cursor`, text): The cursor to use for pagination. This is the value of the `nextCursor` field returned from the previous page.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "nextCursor": null,
    "transactionIds": []
  },
  "has_more": false,
  "next_cursor": null
}
```

### List filing transactions with conversion rates

List filing transactions with conversion rates. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Juris ID (`juris_id`, text, required): The ID of the jurisdiction of the filing.
- Juris filing ID (`juris_filing_id`, text, required): The ID of the filing. This is a unique identifier for the filing within the jurisdiction.
- Limit (`limit`, number): The maximum number of transactions with conversion rates to return. From 1 to 1000.
- Cursor (`cursor`, text): The cursor to use for pagination. This is the value of the `nextCursor` field returned from the previous page.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "nextCursor": null,
    "transactionsWithConversionRates": []
  },
  "has_more": false,
  "next_cursor": null
}
```

### List filings

List filings. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Filter (`filter`, object): Additional structured filter. Use the documented fields.
- Limit (`limit`, number): The maximum number of filings to return. From 1 to 100.
- Cursor (`cursor`, text): The cursor to use for pagination. This is the value of the `nextCursor` field returned from the previous page.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "filings": [],
    "hasMore": false,
    "nextCursor": ""
  },
  "has_more": false,
  "next_cursor": null
}
```

### List product mappings

List product mappings. Returns the full service response for the connected account.

**Inputs**

- Integration ID (`integration_id`, text, required): Your unique integration ID.

**Outputs**

- `data` (list): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "next_cursor": null
}
```

### List product tax categories

List product tax categories. Returns the full service response for the connected account.

**Inputs**: None.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "productTaxCategories": []
  },
  "has_more": false,
  "next_cursor": null
}
```

### List products

List products. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Limit (`limit`, number): The maximum number of products to return. From 1 to 1000.
- Cursor (`cursor`, text): The cursor to use for pagination. This is the value of the `nextCursor` field returned from the previous page.
- Include default products (`include_default_products`, true/false): Whether to include default products and default shipping products from any integrations in the response. When `false`, only regular products are returned.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "hasMore": false,
    "nextCursor": null,
    "products": []
  },
  "has_more": false,
  "next_cursor": null
}
```

### List transactions

List transactions. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Filter (`filter`, object): Additional structured filter. Use the documented fields.
- Limit (`limit`, number): The maximum number of transactions to return. From 1 to 20.
- Cursor (`cursor`, text): The cursor to use for pagination. This is the value of the `nextCursor` field returned from the previous page.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "hasMore": false,
    "nextCursor": "",
    "transactions": []
  },
  "has_more": false,
  "next_cursor": null
}
```

### Resolve an address

Resolve an address. Returns the full service response for the connected account.

**Inputs**

- Country (`country`, text): The country's full name or 2-letter ISO code
- Line1 (`line1`, text): The "delivery line" of the address
- City (`city`, text): City or town name
- Region (`region`, text): Other principal subdivision (i.e. province, state, county)
- Postal code (`postal_code`, text): Postal code

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "jurisdictions": [],
    "resolvedAddress": {
      "city": "example",
      "country": "example",
      "line1": "example",
      "postalCode": "example",
      "region": "example"
    }
  },
  "has_more": false,
  "next_cursor": null
}
```

### Validate tax IDs

Validate tax IDs. Returns the full service response for the connected account.

**Inputs**

- Customer address (`customer_address`, object, required): Additional structured customer address. Use the documented fields.
- Customer tax IDs (`customer_tax_ids`, list, required): The tax IDs to validate.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {
    "jurises": []
  },
  "has_more": false,
  "next_cursor": null
}
```

### Void transaction

Void transaction.

**Inputs**

- Transaction (`transaction_id`, text, required): ID of the transaction.
- Transaction expected version (`transaction_expected_version`, number): The expected transaction version. The void will fail if this is not the latest version of the transaction.

**Outputs**

- `data` (object): Data.
- `has_more` (true/false): Has more.
- `next_cursor` (text): Next cursor.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}
```
