Skip to main content

REST API Creating an Invoice with Authorization Code Authentication

  • November 19, 2025
  • 2 replies
  • 22 views

Perhaps this information will help someone with a similar issue. 

The issue stemmed from an inability to create a sales invoice via the Acumatica REST API, resulting in the persistent error: "Taxes cannot be calculated via the external tax provider because the address is missing."

 

Initial Problem

 

The user was unable to create an AR Invoice using a single POST request, even with a minimal header-only payload that included the CustomerID, CustomerLocationID, and Hold: true.

  • Cause of the Error: The active Avalara (External Tax Provider) integration was configured to perform strict address validation on the initial POST request for new documents.

  • API Limitation: Acumatica's internal data-defaulting logic failed to populate the required Origin Address (from the Branch) and Destination Address (from the Customer) fast enough (or correctly) before the strict Avalara validation check ran, causing the API call to fail every time.

 

Eventual Resolution

 

The root cause was identified as a missing Branch context in the API session due to the user's Authorization Code authentication method, which prevented the server from correctly identifying the Origin Address required for Avalara validation.

The solution was to explicitly set the Branch context using a dedicated HTTP header:

  • Solution: Use the PX-CbApiBranch HTTP Header in the request, setting its value to the target Branch ID (e.g., WMS US).

  • Result: This header forced Acumatica to execute the request within the correct Branch context, providing the necessary Origin Address and allowing the document creation to pass the external tax validation check successfully in a single step.

2 replies

Forum|alt.badge.img+7
  • Captain II
  • November 19, 2025

Thank you for sharing that!


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • November 19, 2025

Thank you for sharing this tip with the community ​@Mikemedved21!