zvps/ebay-sell-negotiation-php-client

The Negotiations API gives sellers the ability to proactively send discount offers to buyers who have shown an "interest" in their listings. By sending buyers discount offers on listings where they have shown an interest, sellers can increase the velocity of their sales. There are various

dev-main 2021-07-30 16:33 UTC

This package is auto-updated.

Last update: 2024-04-29 04:28:19 UTC


README

The Negotiations API gives sellers the ability to proactively send discount offers to buyers who have shown an "interest" in their listings. By sending buyers discount offers on listings where they have shown an interest, sellers can increase the velocity of their sales. There are various ways for a buyer to show interest in a listing. For example, if a buyer adds the listing to their Watch list, or if they add the listing to their shopping cart and later abandon the cart, they are deemed to have shown an interest in the listing. In the offers that sellers send, they can discount their listings by either a percentage off the listing price, or they can set a new discounted price that is lower than the original listing price. For details about how seller offers work, see Sending offers to buyers.

Installation & Usage

Requirements

PHP 7.2 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github/zvps/ebay-sell-negotiation-php-client.git"
    }
  ],
  "require": {
    "zvps/ebay-sell-negotiation-php-client": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure OAuth2 access token for authorization: Authorization Code
$config = Ebay\Sell\Negotiation\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Ebay\Sell\Negotiation\Api\OfferApi(
    // 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
);
$x_ebay_c_marketplace_id = 'x_ebay_c_marketplace_id_example'; // string | The eBay marketplace on which you want to search for eligible listings. For a complete list of supported marketplaces, see Negotiation API requirements and restrictions.
$limit = 56; // int | This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1 &nbsp; &nbsp;Maximum: 200 Default: 10
$offset = 56; // int | This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0

try {
    $result = $apiInstance->findEligibleItems($x_ebay_c_marketplace_id, $limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OfferApi->findEligibleItems: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

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

Class Method HTTP request Description
OfferApi findEligibleItems GET /find_eligible_items
OfferApi sendOfferToInterestedBuyers POST /send_offer_to_interested_buyers

Models

Authorization

Authorization Code

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: v1.1.0
    • Package version: 5.0.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen