saps4hana.externaltaxcalculation.taxquote
Module saps4hana.externaltaxcalculation.taxquote
Definitions
ballerinax/saps4hana.externaltaxcalculation.taxquote Ballerina library
Overview
The SAP S/4HANA Integration with External Tax Calculation Engine API- Tax Determination and Calculation via Integration Flow API v1.0.0 connector(https://api.sap.com/api/taxquote/overview) OpenAPI specification.
Your external tax engine sends tax calculation results to the SAP S/4HANA Cloud system via communication scenario SAP_COM_0249. This API is consumed by the SAP S/4HANA Integration with External Tax Calculation Engines Integration Package endpoint.
Key Features
- Programmatic access to create and manage resources via REST API
- Send and publish data through the API
- Secure authentication with API key or OAuth support
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create and configure an OAuth2 client credentials by following this guide.
Clients
saps4hana.externaltaxcalculation.taxquote: Client
This is a generated connector for SAP S/4HANA Integration with External Tax Calculation Engine API- Tax Determination and Calculation via Integration Flow API v1.0.0 OpenAPI specification. Your external tax engine sends tax calculation results to the SAP S/4HANA Cloud system via communication scenario SAP_COM_0249. This API is consumed by the SAP S/4HANA Integration with External Tax Calculation Engines Integration Package endpoint.
Constructor
Gets invoked to initialize the connector.
The connector initialization requires setting the API credentials.
Create and configure an OAuth2 client credentials by following this guide.
init (ConnectionConfig config, string serviceUrl)- config ConnectionConfig - The configurations to be used when initializing the
connector
- serviceUrl string - URL of the target service
taxquote1
function taxquote1(ApiV0SchemaTaxrequest payload, string? xCorrelationid, string? xRoutingKey) returns ApiV0SchemaTaxresponse|errorDetermines and calculates indirect taxes.
Parameters
- payload ApiV0SchemaTaxrequest - The request payload as per the model schema provided.
- xCorrelationid string? (default ()) - An ID that uniquely identifies an HTTP request. The SAP Cloud Integration generates a new correlation ID when you do not send the X-CorrelationID parameter on the HTTP request header.
- xRoutingKey string? (default ()) - The tax engine that you want to use to calculate taxes in a certain transaction (if you have configured multiple engines).
Return Type
Records
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaAdditionaliteminformation
Fields
- 'type? string - Information about the operation, such as the material origin, own production usage, and whether the service is sold electronically.
- information? string - Information about the item type. The 'isServiceElectronicallySold' parameter can have the values 'Y' (yes) or 'N' (no). In the tax configuration application, you must maintain the product tax classification for all relevant tax countries where the product is sold electronically.
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaBusinesspartnerexemptiondetail
The exemption details of a business partner.
Fields
- locationType? string - The location at which the product has the specified exemption.
- exemptionreasoncode? string - The exemption code classification for the product.
- taxType? string - The identification of the tax rate type on which you apply the exemption.
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaCostinformation
Fields
- costType? string - The type of cost, such as freight, discount, shipping, or others.
- amount? string - The corresponding amount for the cost type.
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaErrorresponse
Invalid date in the request / Invalid country/region code in the request / Invalid type in the request / Any of the mandatory parameters is missing / Invalid currency in the request / Invalid GrossOrNet in the request / Invalid SaleOrPurchase in the request / Max length given in the schema / Location Type is missing/invalid / ExemptionCode is missing/invalid / More than 1 Ship_From in the exemptionDetils / More than 1 Ship_To in the exemptionDetails / More than 1 Ship_From in the Locations / More than 1 Ship_To in the Locations/ Invalid Zipcode in SHIP_TO Location for US / More than 1 shippingCost in items / Invalid shippingCost in items " / Invalid fromDate / Invalid toDate / Invalid Date Range / Missing value for toDate / Missing value for fromDate.
Fields
- status? int - The status code.
- 'type? string - The message type.
- message? string - The message content.
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaExemptiondetail
The list of details on the tax exemption.
Fields
- LocationType? string - The location at which the product has the specified exemption.
- exemptionCode? string - The Exemption Code classification for the product.
- tariffId? string - The classification code for a tax rate. The tax authorities of the country/region in which the the tax is applicable determine these rates.
- taxType? string - The identification of the tax rate type on which you apply the exemption.
- taxRateType? string - The identification of the tax rate type.
- region? string - The code of the region in which the product exemption is valid.
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaItem
If you include too many line items in the request, it can impact the performance. For more information, see SAP Note 2698505 on the SAP ONE Support Launchpad.
Fields
- id string - A unique identifier for each item in the transaction.
- itemCode? string - Pass the item code, for example, SKU of a product. Else pass the productid as maintained in the Tax configuration application. In the second case, the service considers the relevant tax classification as maintained in the application.
- quantity decimal - The quantity of the line item. This can include fractions expressed using decimal places.
- unitPrice decimal - The unit price of the line item.
- shippingCost? string - To determine tax on shipping costs, specify the tax as a separate item. To indicate that an item relates to shipping costs, you must enter 'Y' as the value of this parameter. For the United States of America, tax is calculated if shipping is taxable in the particular jurisdiction. If shipping is not taxable, the API returns zero tax for the item.
- itemType? string - The type of product - service or material. Enter 's' for service and 'm' for material.
- exemptionDetails? ApiV0SchemaExemptiondetail[] -
- certificateId? string - The ID of the exemption certificate, as maintained in the tax configuration application. The API considers the exemption only when the following conditions are met: 1. The certificate ID is valid on the date in the request payload. 2. The exemption details are maintained in the tax configuration application.
- itemClassifications? ApiV0SchemaItemclassification[] -
- additionalItemInformation? ApiV0SchemaAdditionaliteminformation[] -
- costInformation? ApiV0SchemaCostinformation[] -
- taxCategory? string - Determines if the taxes to be calculated are product taxes or withholding taxes. This parameter is valid only for direct calculation scenarios.
- taxCodeCountry? string - Determines the country/region for which the system calculates taxes. The system uses the 2-character country/region code described on ISO 3166-1 alpha-2. This parameter is valid only for direct calculation scenarios.
- taxCode? string - Determines which rule the system uses to calculate taxes. This parameter is valid only for direct calculation scenarios.
- taxCodeRegion? string - Determines the region for which the system calculates taxes. This parameter is optional and valid only for direct calculation scenarios.
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaItemclassification
Fields
- itemStandardClassificationSystemCode? string - The identifier of the item.
- itemStandardClassificationCode? string - The classification code for the system code.
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaLocation
List of Addresses.
Fields
- 'type string - The type of address.
- addressLine1? string - The first line of the address.
- addressLine2? string - The second line of the address.
- addressLine3? string - The third line of the address.
- zipCode? string - The ZIP or postal code.
- city? string - The name of the city.
- state? string - The code of the state or province; do not add the country/region as a prefix or suffix.
- county? string - The name of the county.
- addressId? string - The ID of the address, as maintained in the tax configuration application for the various location addresses. The 'addressID' parameter is relevant only when location addresses are maintained in the tax configuration application for a company, customer, or supplier. For sale transactions and the location type 'SHIP_FROM', the API checks for an address maintained for the company ID that is specified in the request payload. For sale transactions and the location type 'SHIP_TO', the API checks for an address maintained for the business partner ID that is specified in the request payload. For purchase transactions and the location type 'SHIP_TO', the API checks for an address maintained for the company ID that is specified in the request payload. For sale transactions and the location type 'SHIP_FROM', the API checks for an address maintained for the business partner ID that is specified in the request payload. Note: if you specify an address ID in the request, you must also specify a company ID and business partner ID.
- country string - The name of the country/region. Enter the 2-character country/region code according to the standards of ISO 3166-1 alpha-2.
- isCompanyTaxRegistered? string - Shows whether the company is registered with the tax authorities at this location. The application calling the API must identify whether a company has a VAT establishment for tax purposes in the selling country/region. If the company has a VAT establishment, the calling application must specify 'Y' as the value for this parameter "isCompanyTaxRegistered" for the selling location. If the company is not established for VAT purposes, the calling application must specify 'N' as the value for this parameter "isCompanyTaxRegistered" for the selling location.
- isBusinessPartnerTaxRegistered? string - Shows whether the business partner is registered for tax purposes. The tax service does not differentiate between business-to-business (B2B) and business-to-consumer (B2C) transactions. B2B transactions: the calling application must specify 'Y' as the value of this parameter. B2C transactions: the calling application must specify 'N' as the value of this parameter.
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaParty
Details about other parties.
Fields
- id? string - The identifier of each party in the business transaction. Use the party master data ID that the consuming application defines. For example, in SAP S/4HANA (Cloud and OP), the party ID is the business partner number.
- role? string - The role played by the party in the transaction.
- taxRegistration? ApiV0SchemaTaxregistration[] -
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaTaxattribute
Other tax attributes.
Fields
- attributeType? string - The type of the tax attribute.
- attributeValue? string - Corresponding value for the attributes.
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaTaxline
Fields
- id? string - The unique identifier for each item in the transaction.
- country? string - The taxable country/region. If the tax country/region for an item differs from the other items, then the tax service sends back the tax country/region for each item.
- totalTax? string - The total amount of tax for an item.
- taxcode? string - The tax code for an item in the operation.
- taxCodeDescription? string - The description of the tax code that is determined for the transaction.
- taxCodeLegalPhrase? string - The legal phrase associated with the tax code. Where applicable, this item relates to the tax act or article numbers.
- totalRate? string - The total tax rate.
- totalWithholdingTax? string - The total amount of withholding tax.
- totalWithholdingTaxRate? string - The total withholding tax rate.
- withholdingTaxCode? string - The withholding tax code.
- taxValues? ApiV0SchemaTaxvalue[] -
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaTaxregistration
The tax registration details.
Fields
- locationType? string - The type of location.
- taxNumber? string - The corresponding tax number for the tax number type code.
- taxNumberTypeCode? string - The code for the tax number type.
- isNaturalPerson - Determines if this party of the business transaction is a natural person. Note: The system uses the information from this parameter to determine what data privacy and protection policies to apply on this payload data. The system does not use the information from this parameter to determine and calculate taxes. 'y' when the party is a natural person, otherwise 'n'.
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaTaxrequest
The request payload as per the model schema provided.
Fields
- id string - A document ID that uniquely identifies the transaction, which is the request that is sent for tax calculation.
- companyId? string - The company ID, as maintained in the Tax Configuration application. If the company master data is maintained in the tax configuration application, include a value for this key in the request for the service to use the relevant tax classification available in the application to determine the tax amount.
- businessPartnerId? string - The ID of a supplier or customer, as maintained in the Tax Configuration application. Include a value for this parameter in the request only if the tax configuration data for suppliers or customers is maintained in the tax configuration application. In this case, the service considers the relevant tax classification available in the application to determine the tax amount.
- date string - The date of a transaction, such as the order date, invoice date, or return date. To determine the tax due, the service applies the relevant tax rules that apply on this date.
- currency string - Specifies the currency code according to ISO 4217 standards. All amounts in the response have the number digits after the decimal place in accordance with the currency in question.
- isTransactionWithinTaxReportingGroup? string - Indicates if the parties involved in the transaction belong to the same tax reporting group, as defined by law.
- cashDiscountPercent? string - The percentage discount that applies to the business transaction request sent. In accordance with country/region tax determination guidelines, the service determines whether a cash discount affects the base amount used for tax calculation.
- isCashDiscountPlanned? string - If the cash discount is planned for the transaction, enter 'y' or 'Y' as the value of this parameter. If the cash discount is already considered in the transaction, enter 'n' or 'N' as the value of this parameter.
- grossOrNet? string - Shows whether the transaction is gross or net. Use g for gross and n for net.
- saleorPurchase? string - Shows whether the transaction is a sale or purchase. Use s or S for a sale and p or P for a purchase.
- operationNatureCode? string - Identifies the nature of the operation.
- isCompanyDeferredTaxEnabled? string - Indicates if the company can defer the tax due until the date of the invoice payment. This applies only if the company has the required authorizations for tax deferral. If you enter 'y' as the value in this parameter, the service applies deferred tax rules and indicates tax deferral in the response.
- Items ApiV0SchemaItem[] - If you include too many line items in the request, it can impact the performance. For more information, see SAP Note 2698505 on the SAP ONE Support Launchpad.
- Locations? ApiV0SchemaLocation[] -
- BusinessPartnerExemptionDetails? ApiV0SchemaBusinesspartnerexemptiondetail[] -
- Party? ApiV0SchemaParty[] -
- isTraceRequired? string - Shows whether tracing of the tax determination process is enabled. To enable the trace, enter 'y' or 'Y' as the value of the parameter. To disable the trace, enter 'n' or 'N'. When enabled, the trace content is sent as part of the response payload.
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaTaxresponse
Fields
- date? string -
- total? string - The total amount to be paid or collected.
- inclusive? string - Shows whether tax was included in the gross amount: included (true) or not included (false).
- subTotal? string - The amount on which tax is applicable.
- totalTax? string - The total amount of tax for an item.
- totalWithholdingTax? string - The total amount of withholding tax.
- country? string - The taxable country/region. Note: the API returns the country/region only if all items have the same tax country/region.
- taxLines? ApiV0SchemaTaxline[] -
- warning? ApiV0SchemaWarning[] -
- traceLog? string[] - Includes the trace content for tax determination. Applies only when the value of the 'isTraceRequired' parameter is 'y' in the request payload.
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaTaxvalue
Fields
- level? string - Returns the tax level in the tax hierarchy for a tax on tax scenario. The highest level is 1. In the case of sales and use tax in US, level 1 indicates State tax, level 2 indicates county and so on.
- taxTypeCode? string - Tax type code.
- name? string - Name of tax type.
- rate? string - Tax rate.
- taxable? string - Returns the base amount used for tax calculations. In cases where a cash discount percentage is passed, country/region tax determination guidelines can affect the base amount.
- exemptedBasePercent? string - Percentage of base amount exempted.
- exemptedBaseAmount? string - Exempted base amount.
- otherBaseAmount? string - Other base amount.
- value? string - Tax amount including the non-deductible amount where applicable.
- nonDeductibleTaxRate? string - Non-deductible tax rate.
- nonDeductibleTaxAmount? string - Non-deductible tax amount.
- deductibleTaxAmount? string - Deductible tax amount.
- taxAttributes? ApiV0SchemaTaxattribute[] -
- jurisdiction? string - Jurisdiction name.
- jurisdictionCode? string - Returns the unique identifier of tax jurisdiction in the US.
- dueCategory? string - Returns "P" (payable) in cases of taxes due to the authorities, and "R" (receivable) for input taxes that can be claimed.
- isTaxDeferred? boolean - Is tax deferred or not.
- withholdingRelevant? boolean - Tax value is withholding relevant or not.
saps4hana.externaltaxcalculation.taxquote: ApiV0SchemaWarning
Return messages for scenarios where one or more input values are not taken into consideration for tax calculation. It is also relevant in cases in which the API overrides input values.
Fields
- code? string - The code of the warning.
- description? string - The description of the warning.
saps4hana.externaltaxcalculation.taxquote: ClientHttp1Settings
Provides settings related to HTTP/1.x protocol.
Fields
- keepAlive KeepAlive(default http:KEEPALIVE_AUTO) - Specifies whether to reuse a connection for multiple requests
- chunking Chunking(default http:CHUNKING_AUTO) - The chunking behaviour of the request
- proxy? ProxyConfig - Proxy server related options
saps4hana.externaltaxcalculation.taxquote: ConnectionConfig
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- auth OAuth2ClientCredentialsGrantConfig - Configurations related to client authentication
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings? ClientHttp1Settings - Configurations related to HTTP/1.x protocol
- http2Settings? ClientHttp2Settings - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded/x-forwardedheader
- poolConfig? PoolConfiguration - Configurations associated with request pooling
- cache? CacheConfig - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding) header
- circuitBreaker? CircuitBreakerConfig - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig? RetryConfig - Configurations associated with retrying
- responseLimits? ResponseLimitConfigs - Configurations associated with inbound response size limits
- secureSocket? ClientSecureSocket - SSL/TLS-related options
- proxy? ProxyConfig - Proxy server related options
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
saps4hana.externaltaxcalculation.taxquote: OAuth2ClientCredentialsGrantConfig
OAuth2 Client Credentials Grant Configs
Fields
- Fields Included from *OAuth2ClientCredentialsGrantConfig
- tokenUrl string(default "") - Token URL
saps4hana.externaltaxcalculation.taxquote: ProxyConfig
Proxy server configurations to be used with the HTTP client endpoint.
Fields
- host string(default "") - Host name of the proxy server
- port int(default 0) - Proxy server port
- userName string(default "") - Proxy server username
- password string(default "") - Proxy server password
Import
import ballerinax/saps4hana.externaltaxcalculation.taxquote;Metadata
Released date: 4 days ago
Version: 1.3.2
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.8.0
GraalVM compatible: Yes
Pull count
Total: 18
Current verison: 1
Weekly downloads
Keywords
Type/Connector
Vendor/SAP
Area/ERP & Business Operations
Business Management/ERP
Cost/Paid
Name/SAP S/4HANA External Tax Calculation - Tax Quote
Contributors
Dependencies