Skip to content

Latest commit

 

History

History
215 lines (152 loc) · 15.2 KB

SalesTaxApi.md

File metadata and controls

215 lines (152 loc) · 15.2 KB

SapientPro\EbayAccountSDK\Api\SalesTaxApi

All URIs are relative to https://api.ebay.com/sell/account/v1

Method HTTP request Description
createOrReplaceSalesTax PUT /sales_tax/{countryCode}/{jurisdictionId}
deleteSalesTax DELETE /sales_tax/{countryCode}/{jurisdictionId}
getSalesTax GET /sales_tax/{countryCode}/{jurisdictionId}
getSalesTaxes GET /sales_tax

createOrReplaceSalesTax

createOrReplaceSalesTax(SalesTaxBase $body, CountryCodeEnum $countryCode, string $jurisdictionId)

This method creates or updates a sales tax table entry for a jurisdiction. Specify the tax table entry you want to configure using the two path parameters: countryCode and jurisdictionId.

A tax table entry for a jurisdiction is comprised of two fields: one for the jurisdiction's sales-tax rate and another that's a boolean value indicating whether or not shipping and handling are taxed in the jurisdiction.

You can set up tax tables for countries that support different tax jurisdictions. Currently, only Canada, India, and the US support separate tax jurisdictions. If you sell into any of these countries, you can set up tax tables for any of the country's jurisdictions. Retrieve valid jurisdiction IDs using getSalesTaxJurisdictions in the Metadata API.

For details on using this call, see <a href="/api-docs/sell/static/seller-accounts/tax-tables.html">Establishing sales-tax tables.

<span class="tablenote">Important! In the US, eBay now 'collects and remits' sales tax for every US state except for Missouri (and a few US territories), so sellers can no longer configure sales tax rates for any states except Missouri. With eBay 'collect and remit', eBay calculates the sales tax, collects the sales tax from the buyer, and remits the sales tax to the tax authorities at the buyer's location.

Example

<?php
use SapientPro\EbayAccountSDK\Configuration;
use SapientPro\EbayAccountSDK\Api\SalesTaxApiApi;
use SapientPro\EbayAccountSDK\Models\SalesTaxBase;
use SapientPro\EbayAccountSDK\Enums\CountryCodeEnum;

// Configure OAuth2 access token for authorization: api_auth
$config = Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new EBay\Account\Api\SalesTaxApi(
    config: $config
);
$body = SalesTaxBase::fromArray([
    'salesTaxPercentage' => 0.0,
    'shippingAndHandlingTaxed' => false,
]);
$jurisdictionId = "jurisdiction_id_example"; // string | This path parameter specifies the ID of the tax jurisdiction for the table entry you want to create. Retrieve valid jurisdiction IDs using <b>getSalesTaxJurisdictions</b> in the Metadata API.

try {
    $apiInstance->createOrReplaceSalesTax($body, CountryCodeEnum::BG, $jurisdictionId);
} catch (Exception $e) {
    echo 'Exception when calling SalesTaxApi->createOrReplaceSalesTax: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \SapientPro\EbayAccountSDK\Models\SalesTaxBase A container that describes the how the sales tax is calculated.
countryCode \SapientPro\EbayAccountSDK\Enums\CountryCodeEnum This path parameter specifies the two-letter <a href=&quot;https://www.iso.org/iso-3166-country-codes.html\" title=&quot;https://www.iso.org\" target=&quot;_blank&quot;>ISO 3166</a> code for the country for which you want to create a sales tax table entry.
jurisdictionId string This path parameter specifies the ID of the tax jurisdiction for the table entry you want to create. Retrieve valid jurisdiction IDs using <b>getSalesTaxJurisdictions</b> in the Metadata API.

Return type

void (empty response body)

Authorization

api_auth

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteSalesTax

deleteSalesTax(CountryCodeEnum $countryCode, string $jurisdictionId): void

This call deletes a sales tax table entry for a jurisdiction. Specify the jurisdiction to delete using the countryCode and jurisdictionId path parameters.

Example

<?php
use SapientPro\EbayAccountSDK\Configuration;
use SapientPro\EbayAccountSDK\Api\SalesTaxApiApi;

// Configure OAuth2 access token for authorization: api_auth
$config = Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = SalesTaxApi(
    config: $config
);
$jurisdiction_id = "jurisdiction_id_example"; // string | This path parameter specifies the ID of the sales tax jurisdiction whose table entry you want to delete. Retrieve valid jurisdiction IDs using <b>getSalesTaxJurisdictions</b> in the Metadata API.

try {
    $apiInstance->deleteSalesTax(CountryCodeEnum::BG, $jurisdictionId);
} catch (Exception $e) {
    echo 'Exception when calling SalesTaxApi->deleteSalesTax: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
countryCode \SapientPro\EbayAccountSDK\Enums\CountryCodeEnum This path parameter specifies the two-letter <a href=&quot;https://www.iso.org/iso-3166-country-codes.html\" title=&quot;https://www.iso.org\" target=&quot;_blank&quot;>ISO 3166</a> code for the country for which you want to create a sales tax table entry.
jurisdictionId string This path parameter specifies the ID of the tax jurisdiction for the table entry you want to create. Retrieve valid jurisdiction IDs using <b>getSalesTaxJurisdictions</b> in the Metadata API.

Return type

void (empty response body)

Authorization

api_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getSalesTax

getSalesTax(CountryCodeEnum $countryCode, string $jurisdictionId): SalesTax

This call gets the current sales tax table entry for a specific tax jurisdiction. Specify the jurisdiction to retrieve using the countryCode and jurisdictionId path parameters. All four response fields will be returned if a sales tax entry exists for the tax jurisdiction. Otherwise, the response will be returned as empty.

<span class="tablenote">Important! In most US states and territories, eBay now 'collects and remits' sales tax, so sellers can no longer configure sales tax rates for these states/territories.

Example

<?php
use SapientPro\EbayAccountSDK\Configuration;
use SapientPro\EbayAccountSDK\Api\SalesTaxApiApi;

// Configure OAuth2 access token for authorization: api_auth
$config = Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new EBay\Account\Api\SalesTaxApi(
    config: $config
);
$jurisdictionId = "jurisdiction_id_example"; // string | This path parameter specifies the ID of the sales tax jurisdiction for the tax table entry you want to retrieve. Retrieve valid jurisdiction IDs using <b>getSalesTaxJurisdictions</b> in the Metadata API.

try {
    $result = $apiInstance->getSalesTax(CountryCodeEnum::BG, $jurisdictionId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SalesTaxApi->getSalesTax: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
countryCode \SapientPro\EbayAccountSDK\Enums\CountryCodeEnum This path parameter specifies the two-letter <a href=&quot;https://www.iso.org/iso-3166-country-codes.html\" title=&quot;https://www.iso.org\" target=&quot;_blank&quot;>ISO 3166</a> code for the country for which you want to create a sales tax table entry.
jurisdictionId string This path parameter specifies the ID of the tax jurisdiction for the table entry you want to create. Retrieve valid jurisdiction IDs using <b>getSalesTaxJurisdictions</b> in the Metadata API.

Return type

\SapientPro\EbayAccountSDK\Models\SalesTax

Authorization

api_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getSalesTaxes

getSalesTaxes(CountryCodeEnum $countryCode): SalesTaxes

Use this call to retrieve all sales tax table entries that the seller has defined for a specific country. All four response fields will be returned for each tax jurisdiction that matches the search criteria.

<span class="tablenote">Important! In most US states and territories, eBay now 'collects and remits' sales tax, so sellers can no longer configure sales tax rates for these states/territories.

Example

<?php
use SapientPro\EbayAccountSDK\Configuration;
use SapientPro\EbayAccountSDK\Api\SalesTaxApiApi;
use \SapientPro\EbayAccountSDK\Enums\CountryCodeEnum;

// Configure OAuth2 access token for authorization: api_auth
$config = Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new EBay\Account\Api\SalesTaxApi(
    config: $config
);

try {
    $result = $apiInstance->getSalesTaxes(CountryCodeEnum::BG);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SalesTaxApi->getSalesTaxes: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
countryCode \SapientPro\EbayAccountSDK\Enums\CountryCodeEnum This path parameter specifies the two-letter <a href=&quot;https://www.iso.org/iso-3166-country-codes.html\" title=&quot;https://www.iso.org\" target=&quot;_blank&quot;>ISO 3166</a> code for the country whose tax table you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/sell/account/types/ba:CountryCodeEnum

Return type

\SapientPro\EbayAccountSDK\Models\SalesTaxes

Authorization

api_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]