arazzo: 1.0.1
info:
title: Avalara Void and Recreate a Transaction
summary: Look up an existing transaction, void it, then recreate a corrected version.
description: >-
Corrects a mistaken transaction by voiding it and issuing a fresh one. The
workflow first retrieves the existing transaction by code to confirm it
exists, voids it with a documented reason so it drops out of tax reporting,
and then creates a new corrected sales invoice in its place. Every step
spells out its request inline so the flow can be read and executed without
opening the underlying OpenAPI description.
version: 1.0.0
x-realizes-capability-ids:
- BC-220.20
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-220.20
capability_name: Indirect Tax Management
spec: avalara-transactions-api-openapi.yml
confidence: 0.75
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: transactionsApi
url: ../openapi/avalara-transactions-api-openapi.yml
type: openapi
workflows:
- workflowId: void-and-recreate-transaction
summary: Void an existing transaction and create a corrected replacement.
description: >-
Retrieves a transaction by code, voids it with a documented reason code,
then creates a corrected SalesInvoice transaction to replace it.
inputs:
type: object
required:
- companyCode
- transactionCode
- customerCode
- date
- line1
- city
- region
- postalCode
- country
- amount
properties:
companyCode:
type: string
description: Company code that owns the transaction.
transactionCode:
type: string
description: Code of the existing transaction to void.
voidReason:
type: string
description: Reason code for voiding (e.g. DocVoided, AdjustmentCancelled).
customerCode:
type: string
description: Unique code identifying the customer for the corrected transaction.
date:
type: string
description: Date of the corrected transaction (YYYY-MM-DD).
line1:
type: string
description: Ship-to street address line 1.
city:
type: string
description: Ship-to city.
region:
type: string
description: Ship-to state or province code.
postalCode:
type: string
description: Ship-to postal code.
country:
type: string
description: Ship-to two-character ISO 3166 country code.
amount:
type: number
description: Corrected total amount for the line item.
taxCode:
type: string
description: Avalara tax code for the line item.
steps:
- stepId: getOriginal
description: >-
Retrieve the existing transaction by code to confirm it exists before
voiding it.
operationId: getTransactionByCode
parameters:
- name: companyCode
in: path
value: $inputs.companyCode
- name: transactionCode
in: path
value: $inputs.transactionCode
successCriteria:
- condition: $statusCode == 200
outputs:
originalStatus: $response.body#/status
- stepId: voidOriginal
description: >-
Void the existing transaction with the supplied reason code so it is
removed from tax reporting.
operationId: voidTransaction
parameters:
- name: companyCode
in: path
value: $inputs.companyCode
- name: transactionCode
in: path
value: $inputs.transactionCode
requestBody:
contentType: application/json
payload:
code: $inputs.voidReason
successCriteria:
- condition: $statusCode == 200
outputs:
voidedStatus: $response.body#/status
- stepId: recreate
description: >-
Create a corrected SalesInvoice transaction to replace the voided one.
operationId: postTransactions
requestBody:
contentType: application/json
payload:
type: SalesInvoice
companyCode: $inputs.companyCode
date: $inputs.date
customerCode: $inputs.customerCode
commit: true
addresses:
shipTo:
line1: $inputs.line1
city: $inputs.city
region: $inputs.region
postalCode: $inputs.postalCode
country: $inputs.country
lines:
- amount: $inputs.amount
taxCode: $inputs.taxCode
successCriteria:
- condition: $statusCode == 200
outputs:
newTransactionCode: $response.body#/code
totalTax: $response.body#/totalTax
outputs:
voidedStatus: $steps.voidOriginal.outputs.voidedStatus
newTransactionCode: $steps.recreate.outputs.newTransactionCode
totalTax: $steps.recreate.outputs.totalTax
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.