PHP Class Yandex\Market\Partner\PartnerClient

Author: Alexander Khaylo ([email protected])
Inheritance: extends Yandex\Common\AbstractServiceClient
Show file Open project: nixsolutions/yandex-php-library Class Usage Examples

Protected Properties

Property Type Description
$campaignId string Campaign Id
$clientId string Application id
$login string User login
$serviceDomain string API domain

Public Methods

Method Description
__construct ( string $token = '' )
getAccessToken ( ) : string Get OAuth data for header request
getCampaignId ( ) : string
getCampaigns ( ) : Yandex\Market\Partner\Models\Campaigns Get User Campaigns
getClientId ( ) : string
getLogin ( ) : string
getOrder ( integer $orderId ) : Yandex\Market\Partner\Models\Order Get order info
getOrders ( array $params = [] ) : null | Yandex\Market\Partner\Models\Orders Get only orders data without pagination
getOrdersResponse ( array $params = [] ) : Yandex\Market\Partner\Models\GetOrdersResponse Get information about orders by campaign id
getServiceUrl ( string $resource = '' ) : string Get url to service resource with parameters
setCampaignId ( string $campaignId )
setClientId ( string $clientId )
setLogin ( string $login )
setOrderStatus ( integer $orderId, string $status, null | string $subStatus = null ) : Yandex\Market\Partner\Models\Order Send changed status to Yandex.Market
updateDelivery ( integer $orderId, Yandex\Market\Partner\Models\Delivery $delivery ) : Yandex\Market\Partner\Models\Order Update changed delivery parameters

Protected Methods

Method Description
sendRequest ( string $method, string | Psr\Http\Message\UriInterface $uri, array $options = [] ) : Response Sends a request

Method Details

__construct() public method

public __construct ( string $token = '' )
$token string access token

getAccessToken() public method

Get OAuth data for header request
See also: http://api.yandex.ru/market/partner/doc/dg/concepts/authorization.xml
public getAccessToken ( ) : string
return string

getCampaignId() public method

public getCampaignId ( ) : string
return string

getCampaigns() public method

Returns the user to the list of campaigns Yandex.market. The list coincides with the list of campaigns that are displayed in the partner interface Yandex.Market on page "My shops."
See also: http://api.yandex.ru/market/partner/doc/dg/reference/get-campaigns.xml
public getCampaigns ( ) : Yandex\Market\Partner\Models\Campaigns
return Yandex\Market\Partner\Models\Campaigns

getClientId() public method

public getClientId ( ) : string
return string

getLogin() public method

public getLogin ( ) : string
return string

getOrder() public method

Get order info
public getOrder ( integer $orderId ) : Yandex\Market\Partner\Models\Order
$orderId integer
return Yandex\Market\Partner\Models\Order

getOrders() public method

Get only orders data without pagination
public getOrders ( array $params = [] ) : null | Yandex\Market\Partner\Models\Orders
$params array
return null | Yandex\Market\Partner\Models\Orders

getOrdersResponse() public method

Get information about orders by campaign id
See also: http://api.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-orders.xml
public getOrdersResponse ( array $params = [] ) : Yandex\Market\Partner\Models\GetOrdersResponse
$params array Returns information on the requested orders. Available filtering by date ordering and order status. The maximum range of dates in a single request for a resource - 30 days.
return Yandex\Market\Partner\Models\GetOrdersResponse

getServiceUrl() public method

Get url to service resource with parameters
See also: http://api.yandex.ru/market/partner/doc/dg/concepts/method-call.xml
public getServiceUrl ( string $resource = '' ) : string
$resource string
return string

sendRequest() protected method

Sends a request
protected sendRequest ( string $method, string | Psr\Http\Message\UriInterface $uri, array $options = [] ) : Response
$method string HTTP method
$uri string | Psr\Http\Message\UriInterface URI object or string.
$options array Request options to apply.
return GuzzleHttp\Psr7\Response

setCampaignId() public method

public setCampaignId ( string $campaignId )
$campaignId string

setClientId() public method

public setClientId ( string $clientId )
$clientId string

setLogin() public method

public setLogin ( string $login )
$login string

setOrderStatus() public method

Send changed status to Yandex.Market
public setOrderStatus ( integer $orderId, string $status, null | string $subStatus = null ) : Yandex\Market\Partner\Models\Order
$orderId integer
$status string
$subStatus null | string
return Yandex\Market\Partner\Models\Order

updateDelivery() public method

Update changed delivery parameters
public updateDelivery ( integer $orderId, Yandex\Market\Partner\Models\Delivery $delivery ) : Yandex\Market\Partner\Models\Order
$orderId integer
$delivery Yandex\Market\Partner\Models\Delivery
return Yandex\Market\Partner\Models\Order Example: PUT /v2/campaigns/10003/order/12345/delivery.json HTTP/1.1

Property Details

$campaignId protected property

Campaign Id
protected string $campaignId
return string

$clientId protected property

Application id
protected string $clientId
return string

$login protected property

User login
protected string $login
return string

$serviceDomain protected property

API domain
protected string $serviceDomain
return string