All URIs are relative to https://api.ebay.com/sell/account/v1.
Method | HTTP request | Description |
---|---|---|
getOptedInPrograms() | GET /program/get_opted_in_programs | |
optInToProgram() | POST /program/opt_in | |
optOutOfProgram() | POST /program/opt_out |
getOptedInPrograms(): \Ebay\Sell\Account\Model\Programs
This method gets a list of the seller programs that the seller has opted-in to.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: Authorization Code
$config = Ebay\Sell\Account\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Ebay\Sell\Account\Api\ProgramApi(
// 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
);
try {
$result = $apiInstance->getOptedInPrograms();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ProgramApi->getOptedInPrograms: ', $e->getMessage(), PHP_EOL;
}
This endpoint does not need any parameter.
\Ebay\Sell\Account\Model\Programs
[Authorization Code](../../README.md#Authorization Code)
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
optInToProgram($body): object
This method opts the seller in to an eBay seller program. Refer to the Account API overview for information about available eBay seller programs. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after the processing period has passed.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: Authorization Code
$config = Ebay\Sell\Account\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Ebay\Sell\Account\Api\ProgramApi(
// 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
);
$body = new \Ebay\Sell\Account\Model\Program(); // \Ebay\Sell\Account\Model\Program | Program being opted-in to.
try {
$result = $apiInstance->optInToProgram($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ProgramApi->optInToProgram: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
body | \Ebay\Sell\Account\Model\Program | Program being opted-in to. |
object
[Authorization Code](../../README.md#Authorization Code)
- Content-Type:
application/json
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to README]
optOutOfProgram($body): object
This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: Authorization Code
$config = Ebay\Sell\Account\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Ebay\Sell\Account\Api\ProgramApi(
// 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
);
$body = new \Ebay\Sell\Account\Model\Program(); // \Ebay\Sell\Account\Model\Program | Program being opted-out of.
try {
$result = $apiInstance->optOutOfProgram($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ProgramApi->optOutOfProgram: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
body | \Ebay\Sell\Account\Model\Program | Program being opted-out of. |
object
[Authorization Code](../../README.md#Authorization Code)
- Content-Type:
application/json
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to README]