Answer the question
In order to leave comments, you need to log in
ebay api. How to get Buyer email?
Hello.
Does anyone know how to get buyer's email via ebay api? And is it possible in principle?
I am developing a web application that should receive data from Ebay.
I'm interested in the list of orders, I'm trying to get a list of users from it.
Using php-sdk:
https://github.com/davidtsadler/ebay-sdk-php
Using Trading Api, GetOrders method:
developer.ebay.com/devzone/xml/docs/Reference/ebay...
Sample code:
public function getOrders(){
$service = $this->getTradingService();
$args = array(
//"OrderStatus" => "Completed",
"OrderStatus" => "All",
"SortingOrder" => "Ascending",
"OrderRole" => "Seller",
//"CreateTimeFrom" => new \DateTime('2015-01-01'),
"CreateTimeFrom" => new \DateTime('2000-01-01'),
"CreateTimeTo" => new \DateTime(),
);
$request = new Types\GetOrdersRequestType($args);
$request->RequesterCredentials = new Types\CustomSecurityHeaderType();
$request->RequesterCredentials->eBayAuthToken = $this->userToken;
$request->IncludeFinalValueFee = true;
$request->Pagination = new Types\PaginationType();
$request->Pagination->EntriesPerPage = 100;
$pageNum = 1;
$orders = [];
do {
$request->Pagination->PageNumber = $pageNum;
$response = $service->getOrders($request);
if (isset($response->Errors)) {
$message = '';
foreach ($response->Errors as $error) {
$message .= $error->ShortMessage;
}
throw new Exception($message);
}
if ($response->Ack !== 'Failure' && isset($response->OrderArray)) {
foreach ($response->OrderArray->Order as $order) {
$orders[] = $order->toArray();
}
}
$pageNum += 1;
}
while(isset($response->OrderArray) && $pageNum <= $response->PaginationResult->TotalNumberOfPages);
return $orders;
}
$orders[0]['ShippingAddress']['ExternalAddressID']
$orders[0]['TransactionArray']['Transaction'][0]['Buyer']['Email']
Answer the question
In order to leave comments, you need to log in
GetUserContactDetails returns all available contact information except street address and email address. Sellers who wish to send an email to bidders should use AddMemberMessagesAAQToBidder.
although at one time
eBay® only stores the buyer email address in their system for 15 days. If you download shipments from their system that are older than 15 days, you will see "Invalid Request".
check on a recent order, if not the second - then the first
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question