src/Sell/Account/V2/README.md
# brandon14/ebay-sell-account-v2
This API allows sellers to retrieve and manage their custom shipping rate tables.
## Installation & Usage
### Requirements
PHP 7.3 and later.
Should also work with PHP 8.0 but has not been tested.
### Composer
To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`:
```json
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/brandon14/ebay-sell-account-v2.git"
}
],
"require": {
"brandon14/ebay-sell-account-v2": "*@dev"
}
}
```
Then run `composer install`
### Manual Installation
Download the files and include `autoload.php`:
```php
<?php
require_once('/path/to/brandon14/ebay-sell-account-v2/vendor/autoload.php');
```
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: api_auth
$config = TNT\Ebay\Sell\Account\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new TNT\Ebay\Sell\Account\V2\Api\RateTableApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$rate_table_id = 'rate_table_id_example'; // string | The unique identifier for the shipping rate table. This identifier is generated by eBay when a shipping rate table is first created.<br/><br/><span class=\"tablenote\"><strong>Note:</strong> To retrieve a list of all <b>rateTableId</b> values, issue a <a href=\"/api-docs/sell/account/resources/rate_table/methods/getRateTables\" target=\"_blank\">getRateTables</a> call (part of <a href=\"/api-docs/sell/account/static/overview.html \" target=\"_blank\">Account API V1</a>,) with no <b>countryCode</b> query parameter specifed. This will return a list of all shipping rate tables defined for each marketplace and their corresponding <b>rateTableId</b> values.</span>
try {
$result = $apiInstance->getRateTable($rate_table_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling RateTableApi->getRateTable: ', $e->getMessage(), PHP_EOL;
}
```
## API Endpoints
All URIs are relative to *https://api.ebay.com/sell/account/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*RateTableApi* | [**getRateTable**](docs/Api/RateTableApi.md#getratetable) | **GET** /rate_table/{rate_table_id} |
*RateTableApi* | [**updateShippingCost**](docs/Api/RateTableApi.md#updateshippingcost) | **POST** /rate_table/{rate_table_id}/update_shipping_cost |
## Models
- [Amount](docs/Model/Amount.md)
- [Error](docs/Model/Error.md)
- [ErrorParameter](docs/Model/ErrorParameter.md)
- [Rate](docs/Model/Rate.md)
- [RateTableDetails](docs/Model/RateTableDetails.md)
- [RateTableUpdate](docs/Model/RateTableUpdate.md)
- [RateUpdate](docs/Model/RateUpdate.md)
## Authorization
### api_auth
- **Type**: `OAuth`
- **Flow**: `accessCode`
- **Authorization URL**: `https://auth.ebay.com/oauth2/authorize`
- **Scopes**:
- **https://api.ebay.com/oauth/api_scope/sell.account.readonly**: View your account settings
- **https://api.ebay.com/oauth/api_scope/sell.account**: View and manage your account settings
## Tests
To run the tests, use:
```bash
composer install
vendor/bin/phpunit
```
## Author
## About this package
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: `2.0.0`
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`