0% found this document useful (0 votes)
50 views

Ebay Documentation

Uploaded by

Jaya Rai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Ebay Documentation

Uploaded by

Jaya Rai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

AMIVENTURE EBAY DOCUMENTATION

STEPS TO CREATE ORDER FETCHING TOKEN

Developer account credentials

Developer URL

Username Password
garcia_ava Jaguar@786786
noah_wilson_007 noah_wilson_007

STEP 1 : Login to the developer account

Note → 1 Developer account can be used for various seller central accounts.
STEP 2 : Get the credentials

1. Fetch Client ID and Client Secret.


2. Click on User Tokens present in the Client ID section.

STEP 3 : Generate Access key

1. Select Auth'n'Auth option and click on Sign in to Production

2. Login to the required Seller Central account


3. Click Agree

4. It will redirect to user tokens page and will display the generated token

v^1.1#i^1#r^1#I^3#f^0#p^3#t^Ul4xMF83OjBERkFCMzk1MzIwREQ4REQxNkNDNDc2Mk
Y1MzkzMENCXzBfMSNFXjI2MA==

Save the generated access key for further use.


STEP 4 : Generate Refresh Token

1. Select OAuth and Click on Test Sign In

2. It will lead to below page

3. Copy the code part from the url and save to generate refresh token,

code=v%5E1.1%23i%5E1%23r%5E1%23p%5E3%23I%5E3%23f%5E0%23t%5EUl41X
zY6MzgwOENBN0E5QTIxNDc2M0VCQkVDMDgyODQ1QjlGRkVfMl8xI0VeMjYw
|
|
v%5E1.1%23i%5E1%23r%5E1%23p%5E3%23I%5E3%23f%5E0%23t%5EUl41XzY6Mz
gwOENBN0E5QTIxNDc2M0VCQkVDMDgyODQ1QjlGRkVfMl8xI0VeMjYw
(remove “code=” and keep only the further content)
4. Use the the below code to generate refresh token

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);

$client_id = "AltafSha-garciaav-PRD-6ca7a963e-8c3c206d";
$client_secret = "PRD-ca7a963e9618-6a9f-4fa4-ad2f-05d2";
$ru_name = "Altaf_Shaikh-AltafSha-garcia-tknyz";

$encoded_oauth =
"v%5E1.1%23i%5E1%23I%5E3%23f%5E0%23r%5E1%23p%5E3%23t%5EUl41Xzg6QzdFNEU2RDcwNTk5MTZDRDY2N0UxRDM
wRDk2NUY3QURfMF8xI0VeMjYw";

ECHO "<PRE>";

$token = get_refresh_token($client_id , $client_secret , $ru_name, $encoded_oauth);


print_r($token);

function requestEbayOAuthToken($url, $postData, $headers) {


$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $postData,
CURLOPT_HTTPHEADER => $headers,
));
$response = curl_exec($curl);
curl_close($curl);
if($response){
return json_decode($response,true);
}
return false;
}

function get_refresh_token($client_id , $client_secret , $ru_name, $encoded_oauth){


$oauth = urldecode($encoded_oauth);
$basic_auth = base64_encode("{$client_id}:{$client_secret}");
echo PHP_EOL . "Basic_auth : $basic_auth";
echo PHP_EOL . "Oauth : $oauth";
$url = 'https://api.ebay.com/identity/v1/oauth2/token';
$scope = urlencode('https://api.ebay.com/oauth/api_scope
https://api.ebay.com/oauth/api_scope/sell.marketing.readonly ...');
$rscope = urlencode('https://api.ebay.com/oauth/api_scope
https://api.ebay.com/oauth/api_scope/sell.marketing.readonly ...');
$postData = 'scope=' . $scope .
'&rscope=' . $rscope .
'&code=' . $oauth .
'&grant_type=authorization_code' .
'&redirect_uri=' . $ru_name;
$headers = array(
'Authorization: Basic '.$basic_auth,
'Content-Type: application/x-www-form-urlencoded',
'Cookie: dp1=bu1p/QEBfX0BAX19AQA**689c3006^'
);
$response = requestEbayOAuthToken($url, $postData, $headers);
return $response;
}
?>

OUTPUT -
5. The field of refresh_token is the token required.

Update in auth_token column in add_country table

v^1.1#i^1#p^3#r^1#f^0#I^3#t^Ul4xMF8xMDo3MUQxRjBFQjUzN0U5RTY5MUJDODVGRkU0OD
A2NENBRV8wXzEjRV4yNjA=

6. Consider the below fields to update the credentials against country id (Sample query)

UPDATE `ergodeap_amazon_listing`.`add_country` SET `access_key` =


'v^1.1#i^1#r^1#I^3#f^0#p^3#t^Ul4xMF83OjBERkFCMzk1MzIwREQ4REQxNkNDNDc2MkY1Mzk
zMENCXzBfMSNFXjI2MA==', `s_access_key` = '7a5f0026-ee3c-4eae-8b45-c9fac49d316e',
`merchant_id` = 'AltafSha-garciaav-PRD-6ca7a963e-8c3c206d', `merchant_place_id` =
'PRD-ca7a963e9618-6a9f-4fa4-ad2f-05d2', `auth_token` =
'v^1.1#i^1#p^3#r^1#f^0#I^3#t^Ul4xMF8xMDo3MUQxRjBFQjUzN0U5RTY5MUJDODVGRkU0O
DA2NENBRV8wXzEjRV4yNjA=' WHERE (`id` = '31');

7. Hardcode the credentials in code and test once if the order insertion cron works

Ebay Order Fetching

NOTE → Refer lastpass for latest Ebay Seller Central Passwords


STEPS TO CREATE SFTP TOKEN

NOTE → Need to update token in “ebay_inventory” and “ergodeap_amazon_listing” DB

Ebay Books Cron (Creates PNQ file and upload on respective ebay server)
Ebay Non-Books Cron (Creates PNQ file and upload on respective ebay server)
Ebay Inventory Crons (Fetch File from ebay server and uploads on MIP)

STEPS :

1. Use hostname - mip.ebay.com and username, password same as sellercentral.


2. Home → My eBay → My Account → Merchant Integration Platform
3. Settings → FTP Setup
4. Generate Token
5. Save Token and Expiration Date

6. Update token in “ebay_inventory” database →


Map “account_id” column from add_country (`ergodeap_amazon_listing`)
to “full_account_id” column in ebay_token_settings (`ebay_inventory`) and update sftp
token against that account in “ebay_inventory”

You might also like