Create Transactions

Create Transactions

NOTE: All the URL paths listed here are relative to https://{DevHub host}/ on Sandbox Environment and relative to https://{S1 host}/ on Production Environment.

NOTE: Users of the Sandbox Environment should remove the /api/basic-auth prefix for all URL paths listed below.

There are two requests for new transactions:

  • Evaluate: Issuing an Evaluate transaction call will calculate taxes on the transaction but will not maintain (persist) the request information or the response; no tax obligation is created. Examples of how this call can be used are shown in the e-commerce customer order workflows throughout this guide.
  • Commit: Issuing a Commit transaction call will automatically commit the new transaction to GTD. Once the transaction has been committed to GTD, it is available for reporting, filing, and remittance purposes.

HTTP Request

Evaluate

POST /api/basic-authsimple-connect-ar/v1/transactions?state=EVALUATE 

Commit

POST /api/basic-authsimple-connect-ar/v1/transactions?state=COMMIT 

Header Parameters

  • Content-Type: (Required) Acceptable values are application/xml or application/json.
  • x-request-date: (Required for the HMAC authentication schema) Current request date in ISO 8601 format (yyyy-MM-ddTHH:mm:ss.SSSZ). For more information, see Authentication.
  • Authorization: (Required) Standard Basic-based string (optionally could be the HMAC-based schema for Production environment). For more information, see Authentication.
  • x-request-id: (Optional) Client-generated request ID.
  • x-implementer-id: (Optional) External implementer ID.

Body Parameters

Header Fields

If a transaction is sent via XML, every field should be inside of a transaction tag.

FieldDescriptionData TypeRestrictions
invoiceNumberTransaction’s document numberStringMin: 3 characters,
Max: 40 characters
invoiceDateTransaction’s invoice date default value; current date in UTC.String – DateDate format:
yyyy-MM-dd
currencyCodeTransaction’s currency code; default value when null: USD.String
taxDirection1. FORWARD: Forward tax calculation.
2. REVERSE: Backward tax calculation.
Default value when null: FORWARD
String – Enum Accepted values:
FORWARD/REVERSE
customerCodeDefault value if line customerId value is null.StringMin: 3 characters,
Max: 40 characters
exemptionReasonCodeDefault value if line exemptionReasonCode value is null.StringMin: 3 characters,
Max: 40 characters
deliveryAmountTransaction’s header level delivery amount.BigDecimalMax 20 digits
Max 8 digits
billToDefault value if line billTo value is null.Object – Address
shipToDefault value if line shipTo value is null.Object – Address
shipFromDefault value if line shipFrom is null.Object – Address
discountXML discount element only (use discounts field for JSON); list of discounts applied to the entire transaction.List – DiscountXML only.
Limit of 5 discounts that can be applied to a transaction.
discountsJSON discount field only (use discount field for XML); list of discounts applied to the entire transaction.List – DiscountJSON only.
Limit of 5 discounts that can be applied to a transaction.
buyerRegistrationNumberXML registration number element only (use buyerRegistrationNumbers field in JSON); list of registration objects.
Default value if line registration number value is null.
List – RegistrationNumberXML only.
sellerRegistrationNumberXML registration number element only (use sellerRegistrationNumbers field in JSON); list of registration objects.
Default value if line registration number value is null.
List – RegistrationNumberXML only.
thirdPartyRegistrationNumberXML registration number element only (use thirdPartyRegistrationNumbers field in JSON); list of registration objects.
Default value if line registration number value is null.
List – RegistrationNumberXML only.
buyerRegistrationNumberJSON registration number field only (use buyerRegistrationNumber element in XML); list of registration objects.
Default value if line registration value is null.
List – RegistrationNumberJSON only.
sellerRegistrationNumbersJSON registration number field only (use sellerRegistrationNumber element in XML); list of registration objects.
Default value if line registration value is null.
List – RegistrationNumberJSON only.
thirdPartyRegistrationNumbersJSON registration number field only (use thirdPartyRegistrationNumber element in XML); list of registration objects.
Default value if line registration value is null.
List – RegistrationNumberJSON only.
lineItemXML line item element only (use lineItems field in JSON); list of line items associated with transaction.List – LineItemXML only.
Limit X number of line items.
lineItemsJSON line item field only (use lineItem element in XML); list of line items associated with transaction.List – LineItemJSON only.
Limit X number of line items.

Line Item Fields

FieldDescriptionData TypeRestrictions
identifierLine item identifier.StringMin: 1 character,
Max: 40 characters
goodServiceCodeLine item product code.StringMin: 3 characters,
Max: 40 characters
descriptionLine item product description.StringMin: 3 characters,
Max: 1,000 characters
grossAmountLine item gross amount.BigDecimalMax 20 digits
Max 8 digits
customerCodeLine item sold to customer.StringMin: 3 characters,
Max: 40 characters
exemptionReasonCodeLine item customer exemption reason code.StringMin: 3 characters,
Max: 40 characters
deliveryAmountLine item delivery amount.BigDecimalMax 20 digits
Max 8 digits
deliveryDateDate the item will be delivered.String – DateDate format:
yyyy-MM-dd
quantityQuantity of item purchased.BigDecimalMax 20 digits
Max 8 digits
billToAddress to which the purchase will be billed.Object – Address
shipToAddress to which the item will be shipped.Object – Address
shipFromAddress from which the item will be shipped.Object – Address
discountXML discount element only (use discounts field in JSON); list of discounts applied to entire transaction.List – DiscountXML only.
Limit of 5 discounts that can be applied to a transaction.
discountsJSON discount field only (use discount element in XML); list of discounts applied to entire transaction.List – DiscountJSON only.
Limit of 5 discounts that can be applied to a transaction.
buyerRegistrationNumberXML registration number element only (use buyerRegistrationNumbers field in JSON); list of registration objects.List – RegistrationNumberXML only.
sellerRegistrationNumberXML registration number element only (use sellerRegistrationNumbers field in JSON); list of registration objects.List – RegistrationNumberXML only.
thirdPartyRegistrationNumberXML registration number element only (use thirdPartyRegistrationNumbers field in JSON); list of registration objects.List – RegistrationNumberXML only.
buyerRegistrationNumbersJSON registration number field only (use buyerRegistrationNumber element in XML; list of registration objects.List – RegistrationNumberJSON only.
sellerRegistrationNumbersJSON registration number field only (use sellerRegistrationNumbers element in XML); list of registration objects.List – RegistrationNumberJSON only.
thirdPartyRegistrationNumbersJSON registration number field only (use thirdPartyRegistrationNumbers element in XML); list of registration objects.List – RegistrationNumberJSON only.
creditDebitIndicatorDepending on the integer value, the line will be either debit or credit.Integer1 (Debit),
2 (Credit)
taxAmountValue for the amount of taxes already collected. Must be used ONLY when the tax direction in the header is REVERSE.BigDecimalMax 20 digits
Max 8 digits
exemptAmountValue for the exempt amount of the gross amount already corrected. Must be used ONLY when the tax direction in the header is REVERSE.BigDecimalMax 20 digits
Max 8 digits

Discount Fields

FieldDescriptionData TypeRestrictions
amountAmount of discount to be applied will default to standard discount and adjust gross amount.BigDecimalMax 20 digits
Max 8 digits
typeType of discount to be applied will default to standard discount and adjust
gross amount.
StringMin 3 characters
Max 1,000 characters

Registration Number Fields

FieldDescriptionData TypeRestrictions
countryRegistration countryString
statusStatus of the registration. Acceptable values:
IDENTIFIED
ESTABLISHED (default value)
DISTANCE_SALES
SPECIAL_SCHEME (digital goods)
VOLUNTARY_USE_TAX
ESTABLISHED_UNION_SCHEME (EU Only)
String – Enum
jurisdictionTypeType of jurisdiction for the given registration. Acceptable values:
COUNTRY (default value)
STATE
COUNTY
CITY
DISTRICT
DISTRICT 2
String – Enum
numberRegistration numberString

Address Fields

Field DescriptionData TypeRestrictions
addressStreet addressStringMax: 40 characters
cityMunicipalityCityStringMax: 40 characters
countyCountyStringMax: 40 characters
Required
stateProvinceState or ProvinceStringMax: 40 characters
zipPostalCodeBase postal codeStringMax: 5 characters
zipPostalCodeExtensionPostal code extensionStringMax: 4 characters
countryCountryStringMax: 40 characters

Response Fields

Header Fields

The following fields will be inside of a response tag.

FieldDescriptionData TypeRestrictions
statusHTTP status code.Integer
messageGeneral response message.String
dataMain calculation response data.Object – Invoice

Invoice Fields

FieldDescriptionData TypeRestrictions
transactionIdTransaction ID; used for altering transactional state.String
invoiceNumberTransaction invoice number.String
currencyCodeTransaction currency code.String
invoiceDateTransaction invoice date.String – Date Date format: yyyy-MM-dd
customerCodeTransaction customer ID.String
totalTaxAmountTransaction order total tax amount.BigDecimal
billToCleansed transaction request address (if enabled).Object – Address
shipToCleansed transaction request address (if enabled).Object – Address
shipFromCleansed transaction request address (if enabled).Object – Address
lineItemsLine item responses.List – LineItem

Line Item Fields

FieldDescriptionData TypeRestrictions
identifierLine item identifier.String
billToCleansed transaction request address (if enabled).Object – Address
shipToCleansed transaction request address (if enabled).Object – Address
shipFromCleansed transaction request address (if enabled).Object – Address
totalTaxAmountLine item total tax amount.BigDecimal
taxInfoTax information associated with the line item.List – TaxInfo

Tax Information Fields

FieldDescriptionData TypeRestrictions
typeType of tax for the passed transaction; possible values:
SALES_TAX
SELLERS_USE_TAX
. . .
OUTPUT_HARMONIZED_SALES_TAX
String – Enum
jurisdictionTypeType of jurisdiction for the passed transaction; possible values:
COUNTRY
STATE
COUNTY
CITY
DISTRICT
DISTRICT 2
String – Enum
authorityNameTaxing jurisdiction authority name.String
cityOrCountyOrDistrictCity/County/District associated with taxing jurisdiction.String
stateOrProvinceState or Province associated with taxing jurisdiction.String
countryCountry associated with taxing jurisdiction.String
taxAmountTax amount for the specified jurisdiction.BigDecimal
taxRateTax rate for the specified jurisdiction.BigDecimal
exemptAmountExemption amount for the specified jurisdiction.BigDecimal
taxableAmountTaxable amount for the specified jurisdiction.BigDecimal
messagesMessages sent by the taxing jurisdiction authority.String – List