All URIs are relative to https://api.ebay.com/sell/account/v1
Method | HTTP request | Description |
---|---|---|
createFulfillmentPolicy | POST /fulfillment_policy/ | |
deleteFulfillmentPolicy | DELETE /fulfillment_policy/{fulfillmentPolicyId} | |
getFulfillmentPolicies | GET /fulfillment_policy | |
getFulfillmentPolicy | GET /fulfillment_policy/{fulfillmentPolicyId} | |
getFulfillmentPolicyByName | GET /fulfillment_policy/get_by_policy_name | |
updateFulfillmentPolicy | PUT /fulfillment_policy/{fulfillmentPolicyId} |
createFulfillmentPolicy(FulfillmentPolicyRequest $body): SetFulfillmentPolicyResponse
This method creates a new fulfillment policy where the policy encapsulates seller's terms for fulfilling item purchases. Fulfillment policies include the shipment options that the seller offers to buyers.
Each policy targets a specific eBay marketplace and a category group type, and you can create multiple policies for each combination.
A successful request returns the getFulfillmentPolicy URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. <p class="tablenote">Tip: For details on creating and using the business policies supported by the Account API, see <a href="/api-docs/sell/static/seller-accounts/business-policies.html">eBay business policies.
Using the eBay standard envelope service (eSE)
The eBay standard envelope service (eSE) is a domestic envelope service with tracking through eBay. This service applies to specific Trading Cards categories (not all categories are supported), and to Coins & Paper Money, Postcards, and Stamps. See <a href="/api-docs/sell/static/seller-accounts/using-the-ebay-standard-envelope-service.html" target="_blank">Using the eBay standard envelope (eSE) service.
<?php
use SapientPro\EbayAccountSDK\Configuration;
use SapientPro\EbayAccountSDK\Api\FulfillmentPolicyApi;
use SapientPro\EbayAccountSDK\Models\FulfillmentPolicyRequest;
// Configure OAuth2 access token for authorization: api_auth
$config =Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new FulfillmentPolicyApi(
config: $config
);
$body = FulfillmentPolicyRequest::fromArray([
'categoryTypes' => [
CategoryType::fromArray([
'name' => CategoryTypeEnum::MOTORS_VEHICLES
])
],
'name' => 'testName',
'marketplaceId' => MarketplaceIdEnum::EBAY_US
]);
try {
$result = $apiInstance->createFulfillmentPolicy($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FulfillmentPolicyApi->createFulfillmentPolicy: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
body | \SapientPro\EbayAccountSDK\Models\FulfillmentPolicyRequest | Request to create a seller account fulfillment policy. |
\SapientPro\EbayAccountSDK\Models\SetFulfillmentPolicyResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteFulfillmentPolicy(string $fulfillmentPolicyId): void
This method deletes a fulfillment policy. Supply the ID of the policy you want to delete in the fulfillmentPolicyId path parameter.
<?php
use SapientPro\EbayAccountSDK\Configuration;
use SapientPro\EbayAccountSDK\Api\FulfillmentPolicyApi;
// Configure OAuth2 access token for authorization: api_auth
$config = Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new FulfillmentPolicyApi(
config: $config
);
$fulfillmentPolicyId = "fulfillment_policy_id_example"; // string | This path parameter specifies the ID of the fulfillment policy to delete.
try {
$apiInstance->deleteFulfillmentPolicy($fulfillment_policy_id);
} catch (Exception $e) {
echo 'Exception when calling FulfillmentPolicyApi->deleteFulfillmentPolicy: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
fulfillmentPolicyId | string | This path parameter specifies the ID of the fulfillment policy to delete. |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getFulfillmentPolicies(MarketplaceIdEnum $marketplaceId): FulfillmentPolicyResponse
This method retrieves all the fulfillment policies configured for the marketplace you specify using the marketplace_id
query parameter.
Marketplaces and locales
Get the correct policies for a marketplace that supports multiple locales using the Content-Language
request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA
for the Content-Language
header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: nl-BE
. For details on header values, see <a href="/api-docs/static/rest-request-components.html#HTTP" target="_blank">HTTP request headers.
<?php
use SapientPro\EbayAccountSDK\Configuration;
use SapientPro\EbayAccountSDK\Api\FulfillmentPolicyApi;
use SapientPro\EbayAccountSDK\Enums\MarketplaceIdEnum;
// Configure OAuth2 access token for authorization: api_auth
$config = Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new FulfillmentPolicyApi(
config: $config
);
try {
$result = $apiInstance->getFulfillmentPolicies(MarketplaceIdEnum::EBAY_US);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FulfillmentPolicyApi->getFulfillmentPolicies: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
marketplaceId | \SapientPro\EbayAccountSDK\Enums\MarketplaceIdEnum | This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/sell/account/types/ba:MarketplaceIdEnum |
\SapientPro\EbayAccountSDK\Models\FulfillmentPolicyResponse
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getFulfillmentPolicy(string $fulfillmentPolicyId): FulfillmentPolicy
This method retrieves the complete details of a fulfillment policy. Supply the ID of the policy you want to retrieve using the fulfillmentPolicyId path parameter.
<?php
use SapientPro\EbayAccountSDK\Configuration;
use SapientPro\EbayAccountSDK\Api\FulfillmentPolicyApi;
// Configure OAuth2 access token for authorization: api_auth
$config = Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new FulfillmentPolicyApi(
config: $config
);
$fulfillment_policy_id = "fulfillment_policy_id_example"; // string | This path parameter specifies the ID of the fulfillment policy you want to retrieve.
try {
$result = $apiInstance->getFulfillmentPolicy($fulfillment_policy_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FulfillmentPolicyApi->getFulfillmentPolicy: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
fulfillmentPolicyId | string | This path parameter specifies the ID of the fulfillment policy you want to retrieve. |
\SapientPro\EbayAccountSDK\Models\FulfillmentPolicy
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getFulfillmentPolicyByName(MarketplaceIdEnum$marketplaceId, string $name): FulfillmentPolicy
This method retrieves the details for a specific fulfillment policy. In the request, supply both the policy name
and its associated marketplace_id
as query parameters.
Marketplaces and locales
Get the correct policy for a marketplace that supports multiple locales using the Content-Language
request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA
for the Content-Language
header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: nl-BE
. For details on header values, see <a href="/api-docs/static/rest-request-components.html#HTTP">HTTP request headers.
<?php
use SapientPro\EbayAccountSDK\Configuration;
use SapientPro\EbayAccountSDK\Api\FulfillmentPolicyApi;
use SapientPro\EbayAccountSDK\Enums\MarketplaceIdEnum;
// Configure OAuth2 access token for authorization: api_auth
$config = Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new FulfillmentPolicyApi(
config: $config
);
$name = "name_example"; // string | This query parameter specifies the seller-defined name of the fulfillment policy you want to retrieve.
try {
$result = $apiInstance->getFulfillmentPolicyByName(MarketplaceIdEnum::EBAY_US, $name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FulfillmentPolicyApi->getFulfillmentPolicyByName: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
marketplaceId | \SapientPro\EbayAccountSDK\Enums\MarketplaceIdEnum | This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/sell/account/types/ba:MarketplaceIdEnum | |
name | string | This query parameter specifies the seller-defined name of the fulfillment policy you want to retrieve. |
\SapientPro\EbayAccountSDK\Models\FulfillmentPolicy
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateFulfillmentPolicy(FulfillmentPolicyRequest $body, string $fulfillmentPolicyId): SetFulfillmentPolicyResponse
This method updates an existing fulfillment policy. Specify the policy you want to update using the fulfillment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload.
<?php
use SapientPro\EbayAccountSDK\Configuration;
use SapientPro\EbayAccountSDK\Api\FulfillmentPolicyApi;
use SapientPro\EbayAccountSDK\Models\FulfillmentPolicyRequest;
// Configure OAuth2 access token for authorization: api_auth
$config = Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new FulfillmentPolicyApi(
config: $config
);
$body = FulfillmentPolicyRequest::fromArray([
'categoryTypes' => [
CategoryType::fromArray([
'name' => CategoryTypeEnum::MOTORS_VEHICLES
])
],
'name' => 'testName',
'marketplaceId' => MarketplaceIdEnum::EBAY_US
]); // \SapientPro\EbayAccountSDK\ModelsFulfillmentPolicyRequest | Fulfillment policy request
$fulfillmentPolicyId = "fulfillment_policy_id_example"; // string | This path parameter specifies the ID of the fulfillment policy you want to update.
try {
$result = $apiInstance->updateFulfillmentPolicy($body, $fulfillmentPolicyId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FulfillmentPolicyApi->updateFulfillmentPolicy: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
body | \SapientPro\EbayAccountSDK\Models\FulfillmentPolicyRequest | Fulfillment policy request | |
fulfillmentPolicyId | string | This path parameter specifies the ID of the fulfillment policy you want to update. |
\SapientPro\EbayAccountSDK\Models\SetFulfillmentPolicyResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]