API Reference




Examples

Overview

The Wish Merchant API will be using oAuth to authenticate in order to offer better security for its users

  • Learn about oAuth here.
  • If you are a merchant and want to create an application for yourself, learn about how to create a private app here
  • If you are a ERP and create applications that'll be used by multiple merchants, learn about how to create a public app here. You will need to apply to be a verified public application
  • Learn how to invoke the APIs after obtaining the access token here

Introduction

The Wish merchant platform is an ecommerce platform. It allows merchants to upload and manage inventory for sale on Wish. The platform is intended to be full-featured so merchants can manage their inventory, fulfill orders and handle customer issues.

This API is intended to be a fully programmable alternative to the GUI version of this platform. However, it is a work in progress and is constantly being updated with new features.

The best way to get started using this API is to read through this section and then visit the User Guide section. If you're too excited and need to start now please visit the Quick Start Guide.

Please note that all dates and times in our API are always in UTC unless otherwise mentioned.

API Base Url

  • https://merchant.wish.com/api/v2/

API Base Url For China

  • https://china-merchant.wish.com/api/v2/

List of Endpoints

  • /auth_test
  • /product
  • /product/multi-get
  • /product/update
  • /product/enable
  • /product/disable
  • /product/add
  • /product/create-download-job
  • /product/get-download-job-status
  • /product/cancel-download-job
  • /variant
  • /variant/multi-get
  • /variant/update
  • /variant/enable
  • /variant/disable
  • /variant/update-inventory
  • /variant/add
  • /order
  • /order/multi-get
  • /order/get-fulfill
  • /order/fulfill-one
  • /order/modify-tracking
  • /order/create-download-job
  • /order/get-download-job-status
  • /order/cancel-download-job
  • /order/get-confirmed-delivery-countries
  • /order/get-confirmed-delivery-shipping-carriers-for-country

Authentication

Wish uses the OAuth 2.0 specification to authenticate your requests. For a detailed guide on how to authenticate, click here.

Every request will need to be authenticated with an access token. When making requests, provide the access token as a GET or POST request parameter:

ParameterTypeExample
access_tokenString1qaz2wsx3edc4rfv5tgb

Alternatively, the access token can be included in the header in this format: 'Authorization: Bearer {access_token}'

Requests must be made over HTTPS. Any call made over HTTP will be rejected.

Response Scheme

Every response returned from the Wish API will have the same schema. This schema is intended to give you a predictable manner to check the status of your request and know where to get the data. Each response will have the following top level attributes: code, data, message, and sometimes paging.

Attributes
CodeContains the status code for the request, 0 means success and any other number implies a failure.
DataThis attribute will store the response data that was requested.
MessageSometimes will store a human readable status message to aid in debugging. It is generally used only for errors.
PagingIf the number of results exceeds the limit for the request, this parameter will aid the client in paging to collect all the results.

Response Formats

This API can return results in either JSON or XML. To specify the format you would like your response in, include the 'format' parameter in your GET or POST request. This parameter is optional and defaults to JSON.

ParameterTypeExampleRequired
formatString'xml' or 'json', default is 'json'No

API Errors

The Wish API returns specific error data back to the client in the event of an error. Each error will contain the following data: 'code', 'message', 'data', and 'type'. Please see table below for descriptions of each attribute.

Attributes
CodeA unique number which represents the error that has occurred, example: 4001.
TypeA unique human readable representation of the error, example: not_found
MessageA message describing the error that happened, example: "We could not find a product for id: 'aaa'"
DataFor most errors this will be empty.

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/order/fulfill-one -d "tracking_provider=USPSSSSSSSSSSSSSSSSSSSSSSSSS&tracking_number=12345679&id=098765432112345678901234&access_token=an_example_access_token"

Example Response

{
    "message":"Tracking provider is not one of the accepted providers on Wish",
    "code":1000,
    "data":2003
}

HTTP Status Codes

As well as using specific error codes in the event of an error, this API tries to conform to conventional HTTP response codes to indicate success or failure. Any response code of the form 2xx is generally considered successful. A status code of 4xx means that there was an error with the inputs. Any code in the 5xx range means that the server experienced an unexpected error and means we screwed up!

The HTTP status code should be used as a quick reference, but to get specific details please refer to the error code provided in the response.

Locale

You can optionally specify locale in order to translate error messages into your language. If none is provided, your default locale will be used.

Supported locales: 'en', 'zh', 'fr', 'de'

Parameters
localeoptional The language you want the error message to be translated in. If none is provided, your default locale will be used. Supported locales: 'en', 'zh', 'fr', 'de'.

Example

Assume your access token is "an_example_access_token" . If you update a product with a invalid main_image url and you want error message to be translated in English('en'), your parameters would be:

  • id = 123456789009876543211234
  • access_token = an_example_access_token
  • main_image = xxx
  • locale = en

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/update -d "id=123456789009876543211234&access_token=an_example_access_token&main_image=xxx&locale=en"
<?php

$access_token = urlencode('an_example_access_token');

$id = urlencode('123456789009876543211234')
$main_image = urlencode('xxx');
$locale = urlencode('en');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/update?access_token=%s&id=%s&main_image=%s&locale=%s",
    $access_token, $id, $main_image, $locale);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 1000,
    'data': 13,
    'message': 'Cannot get image from URL xxx'
}

Pagination

For performance reasons it is necessary for this API to limit the number of results returned in each request. This limit varies per request, but there is always an upper bound on the number of items returned in any response. In the case that the number of results is too large, you may page through all the results with multiple requests.

If the results must be paginated the 'paging' attribute will exist in the response. This attribute will contain 'next' and 'prev' which are URLs for fetching the next (or previous) page of data.

Example

Note: access token and format have been removed from the URLs for brevity.
{
    code: 0,
    data : [/* results will be here */],
    message: '',
    paging : {
        next:https://sandbox.merchant.wish.com/api/v2/product/multi-get?start=20&limit=10,
prev:https://sandbox.merchant.wish.com/api/v2/product/multi-get?start=10&limit=10
}
}

Rate-Limiting

Rate-limiting will be performed on a per-merchant basis for each app. It is your responsibility to ensure you are not making frequent unnecessary calls to the API.

If the rate limits cannot satisfy your need, we highly recommend integrating webhooks for your app. With webhooks, instead of pulling resources periodically, your app will receive real-time notifications for particular events that occur to a merchant’s store. Learn more

Normal Usage

To help you track the rate-limiter status, the following response header(s) will be provided with each response:

  • Wish-Rate-Limit-Remaining: The number of calls remaining in the current rate-limiting window.
    • Example: Wish-Rate-Limit-Remaining:2

Rate-Limit Exceeded

After you exceed the number of allowed calls in the current rate-limiting window, you will receive a 429 Too Many Requests error response and the following additional header(s):

  • Wish-Rate-Limit-Reset: The time the rate-limiter will reset.
    • Example: Wish-Rate-Limit-Reset:2021-05-19T16:37:00.000+00:00

Example Response

{
  "message": "Too many requests.",
  "code": 1056,
  "data": {}
}

How to Test

To avoid testing the API on production data, use our sandbox. The sandbox is completely contained and will not affect Wish users or your merchant account.

To reach the sandbox, visit: https://sandbox.merchant.wish.com

To use the sandbox in testing, use "https://sandbox.merchant.wish.com/v2/" as your base URL.

Steps to create sandbox user:

  1. Go to the sandbox :


  2. Sign up with your information





  3. To generate test transactions for api testing, click on Orders -> Action Required





  4. Click the generate transactions button


Assuming your access token is "an_example_access_token"


Examples

> curl "https://sandbox.merchant.wish.com/api/v3/oauth/test?access_token=an_example_access_token"

> curl "https://sandbox.merchant.wish.com/api/v2/product?id=4ef2858a9795c776ce000120&access_token=an_example_access_token"

> curl https://sandbox.merchant.wish.com/api/v2/product/enable -d "id=123456789009876543211234&access_token=an_example_access_token"

<?php

$access_token = urlencode('an_example_access_token');

$url = sprintf("https://sandbox.merchant.wish.com/api/v3/oauth/test?access_token=%s);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'sandbox');

$client->authTest();
?>

How To Debug

When API errors, it'll still return a JSON or XML response. The response contains information on exactly what caused the error

For more information, check out here

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/order/fulfill-one -d "tracking_provider=USPSSSSSSSSSSSSSSSSSSSSSSSSS&tracking_number=12345679&id=098765432112345678901234&access_token=an_example_access_token"

Example Response

{
    "message":"Tracking provider is not one of the accepted providers on Wish",
    "code":1000,
    "data":2003
}

Debugging

USPSSSSSSSSSSSSSSSSSSSSSSSSS is not a shipping provider, to fix, change it to USPS

Example Request 2

> curl https://sandbox.merchant.wish.com/api/v2/order/fulfill-one -d "tracking_provider=USPS&tracking_number=12345679&id=098765432112345678901234&access_token=an_example_access_token"

Example Response 2

{
    'code': 0,
    'data': {'success': True},
    'message': 'Your order is been processed right now!'
}

Request ID

Each API request is associated with a unique identifier. You can find this value in response headers, under Wish-Request-ID.

When you need to contact us about a specific request, please provide this ID to ensure the fastest possible reply.

FAQ (Frequently Asked Questions)

Here are some quick code snippets that are commonly used to get you started

How do I update price of a product?'

Update price of a product:

> curl https://sandbox.merchant.wish.com/api/v2/variant/update -d "sku=productsku&access_token=an_example_access_token&price=12.3"

<?php

$access_token = urlencode('an_example_access_token');

$sku = urlencode('123456789009876543211234')
$new_price = urlencode('11.3');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant/update?access_token=%s&sku=%s&price=%s",
    $access_token, $sku,$new_price,);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = json_decode(file_get_contents($url, TRUE, $context));
print_r($response);
echo "\n";
?>
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$variant = $client->getProductVariatonBySKU('sku');
$variant->price = 10.2;
$client->updateProductVariant($variant);
    

How do I update inventory of a product?

Update inventory of a product:

> curl https://sandbox.merchant.wish.com/api/v2/variant/update -d "sku=productsku&access_token=an_example_access_token&inventory=100"

<?php

$access_token = urlencode('an_example_access_token');

$sku = urlencode('blue-shoe-11');
$inventory = urlencode('100');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant/update-inventory?access_token=%s&sku=%s&inventory=%s",
    $access_token, $sku, $inventory);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->updateInventoryBySKU($sku,100);
?>

How do I enable/disable a product?

Enable/disable product:

> curl https://sandbox.merchant.wish.com/api/v2/product/enable -d "id=productid312&access_token=an_example_access_token"

<?php

$access_token = urlencode('an_example_access_token');

$id = urlencode('123456789009876543211234')

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/enable?access_token=%s&id=%s",
    $access_token, $id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->enableProductVariationBySKU('sku');
$client->enableProductVById('product_id');
?>

How do I get all products?

Download all products:

Start your batch Product download:
> curl https://sandbox.merchant.wish.com/api/v2/product/create-download-job?access_token=an_example_access_token"

This will provide you with a 'job_id' for your download.


Check the status of your download by 'job_id':
> curl https://sandbox.merchant.wish.com/api/v2/product/create-download-job?job_id=an_example_job_id&access_token=an_example_access_token"

When your download is ready, you will receive a 'download_link' in the response.


You will also receive an email with a link to download your Products.

<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$products = $client->getAllProducts();
$product_variations = $client->getAllProductVariations();
?>
<?php

$access_token = urlencode('an_example_access_token');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/create-download-job?access_token=%s",
$access_token);
$context = stream_context_create(array(
'http' => array(
'method' => 'GET',
'ignore_errors' => true,
),
));
// Send the request
$response = json_decode(file_get_contents($url, TRUE, $context));
print_r($response);
?>

How do I get all orders?

Download all orders:

Start your batch Order download:
> curl https://sandbox.merchant.wish.com/api/v2/order/create-download-job?access_token=an_example_access_token"

This will provide you with a 'job_id' for your download.


Check the status of your download by 'job_id':
> curl https://sandbox.merchant.wish.com/api/v2/order/create-download-job?job_id=an_example_job_id&access_token=an_example_access_token"

When your download is ready, you will receive a 'download_link' in the response.


You will also receive an email with a link to download your Orders.

<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$unfulfilled_orders = $client->getAllUnfulfilledOrdersSince('2010-01-20');
$changed_orders = $client->getAllChangedOrdersSince('2010-01-20');
?>
<?php

$access_token = urlencode('an_example_access_token');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/order/create-download-job?access_token=%s",
$access_token);
$context = stream_context_create(array(
'http' => array(
'method' => 'GET',
'ignore_errors' => true,
),
));
// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
?>

Quick Start Guide

We encourage you to skim through the section above to get an understanding about the fundamentals of this API. If you simply cannot wait, we hope this will get you started.

Get Your Access Token

Every request made must have an access token in the request. This token is used for authentication so please keep it a secret.

To obtain an access token, please visit this guide.

Test Authentication

Now that you have your access token you can test it by making a simple test request to the API and ensuring it works. For instructions on how to do this visit this guide.

<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
echo $client->authTest();
?>

Product

The product entity represents an item that is for sale on Wish. Each product can have multiple variations comprised of different sizes and colors. Each product has at least one product variation. Product variations, not products, are purchased by users. Each product contains multiple related SKUs.



With this API you can create, and update products. You can also retrieve one or many of your products.

Attributes
idThe Wish Id of the product, a 24 character string
nameThe name which you have given the product, example: 'Blue Shoe'
parent_skuYour unique identifier for the product
num_soldNumber of sales this product has received
num_savesNumber of times this product has been added to users' wishlists
review_statusOur review status of the product. Can be 'approved', 'rejected' or 'pending'
removed_by_merchantWhether the product has been completely removed by the merchant, these products cannot be edited
country_shippingA list of CountryShipping objects. Each CountryShipping object contains attributes country_code, price, localized_price, and localized_currency_code, which represent the shipping price for that country The price value will be returned as 999999 if you receive payments in a non-USD currency. Please use localized_price instead.
default_shipping_priceThe default shipping price for the product. Once set, the default shipping price will automatically apply as the shipping price for any new or unset countries. This value will be returned as 999999 if you receive payments in a non-USD currency. Please use localized_default_shipping_price instead.
localized_default_shipping_priceThe localized default shipping price for the product, in the merchant's local currency. Once set, the localized default shipping price will automatically apply as the shipping price for any new or unset countries.
tagsComma separated list of tags which are applied to the product
descriptionA blurb of text uploaded as the description to the product
variantsA list of Product Variation entities
requested_product_brand_idBrand ID of your product
landing_page_urlURL on your website containing the product details
upc8 to 14 digits GTIN (UPC, EAN, ISBN) contains no letters or other characters
main_imageURL of the main image of the product
extra_imagesURL of all extra images of the product, separated by the character '|'
clean_imageWish URL of the selected clean image of the product
enabledIf true, this product is eligible for sale.
is_promotedIf true, this product is promoted.
original_image_urlURL of the original image when product was created.
date_uploadedDate when product was created.
last_updatedTime when product was last updated (%m-%d-%YT%H:%M:%S).
wish_express_country_codesIf a product listing is enrolled in Wish Express this field will be a list of two letter country codes that the listing is eligible for

Create a Product

Use the endpoint to create a new product.

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/product/add

Explore API

Parameters
nameName of the product as shown to users on Wish
descriptionDescription of the product. Should not contain HTML. If you want a new line use "\n".
tagsoptional Comma separated list of strings that describe the product. Only 10 are allowed. Any tags past 10 will be ignored.
skuThe unique identifier that your system uses to recognize this product
coloroptional The color of the product. Example: red, blue, green
conditionoptional The condition of the product. Example: NEW, USED, REFURBISHED
sizeoptional The size of the product. Example: Large, Medium, Small, 5, 6, 7.5 (For custom size, the length of the characters must be less than 50 )
inventoryThe physical quantities you have for this product, max 500,000
price The price of the variation when the user purchases one, max 100,000
localized_price optional The price of the variation in the merchant's local currency. This is required for non-USD merchants.
shipping The shipping of the product when the user purchases one, max 1000. Note that this will be the product default shipping price and will be used as the shipping price for countries where shipping price is not provided when the product is created.
localized_shipping optional The shipping of the product when the user purchases one in the merchant's local currency, max 1000. Note that this will be the product localized_default shipping price and will be used as the localized shipping price for countries where localized shipping price is not provided when the product is created. This is required for non-USD merchants.
localized_currency_code optional The merchant's localized currency code. This must be provided in order to set localized pricing fields. This is required for non-USD merchants.
country_shipping_pricesoptional The country shipping prices of the product when user purchases one. JSON formatted dictionary of country codes and shipping prices accepted. Example: {"US":3.99,"CA":4.99, "LOCAL_CA":29.94}. Only countries you ship to are allowed. Any country you don't ship to is ignored. Use LOCAL_CC to set the localized price for the country.
msrpoptional Listings include a field for a comparison or reference price (“MSRP Field”). Merchants are not required to provide a value for the MSRP Field. If Merchants choose to provide a value for the MSRP Field (a “Reference Price”), each Reference Price must comply with the Product Reference Price Policy.
localized_msrpoptional Listings include a field for a comparison or reference price (“MSRP Field”) in the merchant's local currency. Merchants are not required to provide a value for the MSRP Field. If Merchants choose to provide a value for the MSRP Field (a “Reference Price”), each Reference Price must comply with the Product Reference Price Policy.
shipping_timeoptional (DEPRECATED/UNUSED) The amount of time it takes for the shipment to reach the buyer. Please also factor in the time it will take to fulfill and ship the item. Provide a time range in number of days. Lower bound cannot be less than 2 days. Example: 15-20
main_imageURL of a photo of your product. Link directly to the image, not the page where it is located. We accept JPEG, PNG or GIF format. Images should be at least 100 x 100 pixels in size. It may take up to 1 hour for the image to be uploaded.
parent_skuoptional When defining a variant of a product we must know which product to attach the variation to. parent_sku is the unique id of the product that you can use later when using the add product variation API.
requested_product_brand_idoptional Brand ID of your product
landing_page_urloptional URL on your website containing the product details
upcoptional 8 to 14 digits GTIN (UPC, EAN, ISBN) contains no letters or other characters
extra_imagesoptional URL of extra photos of your product. Link directly to the image, not the page where it is located. Same rules apply as main_image. You can specify one or more additional images separated by the character '|'. The total number of extra images plus the number of variation images must not exceed 100. It may take up to 1 hour for the images to be uploaded.
clean_imageoptional URL of the clean image of your product. Must the same URL as the main_image_url or one of the extra_image_urls. Products with clean image selected may receive increased impressions and sales. It may take up to 1 hour for the image to be set. Learn more.
max_quantityoptional The maximum quantity of products per order.
reference_valueoptional The reference value (in the given unit) that is used to calculate the price per unit of a product and to illustrate the unit count for the consumer to see. Learn More.
quantity_valueoptional The total quantity of the product variant (in the given unit) that is used to calculate price per unit. Note that if a product has multiple product variants, you will need to set quantity values for each product variant. Learn More.
unit optional The unit of measurement for the total content of a product. This will be used to display the price per unit, and is the unit of measurement that will be used for both the Reference Value and Quantity Value attributes. Learn More.

Enum: "OUNCE" "POUND" "MILLIGRAM" "GRAM" "KILOGRAM" "FLUID_OUNCE" "PINT" "QUART" "GALLON" "MILLILITER" "CENTILITER" "LITER" "CUBICMETER" "INCH" "FOOT" "YARD" "CENTIMETER" "METER" "SQUARE_FOOT" "SQUARE_METER" "COUNT" "LOAD" "WASH" "ROLL" "POD" null
length optional The length of your product that will be packaged to ship to customer (Units in cm)
  • Acceptable: 10
width optional The width of your product that will be packaged to ship to customer (Units in cm)
  • Acceptable: 13.40
height optional The height of your product that will be packaged to ship to customer (Units in cm)
  • Acceptable: 13.40
weight optional The weight of your product that will be packaged to ship to customer (Units in g)
  • Acceptable: 151.5
  • Acceptable: 10
declared_name optional Product name for logistics declaration
  • Acceptable: Repair Tools Kit Set
  • Acceptable: Rings
  • Unacceptable: !Rings
  • Unacceptable: T
  • Unacceptable: Good 衬衫
  • Unacceptable: Name that is longer than 200 characters
declared_local_name optional Product name written in local language for logistics declaration
  • Acceptable: 棉质外套
  • Unacceptable: !棉质外套
  • Unacceptable: 棉
  • Unacceptable: Name that is longer than 200 characters
pieces optional The amount of pieces associated with this item
  • Acceptable: 2
  • Acceptable: 1
  • Unacceptable: -1
declared_value optional The price of your product that will be declared to custom.
  • Acceptable: $100.99
  • Acceptable: 10.99
  • Unacceptable: $49.99 + S/H
hscode optional Harmonization System Code used for custom declaration.
  • Acceptable: 33021010.00
  • Acceptable: 6403.20
  • Unacceptable: 2
  • Unacceptable: a
origin_country optional country where product is manufactured. Country code should follow ISO 3166 Alpha-2 code. Example:CN, US
  • Acceptable: CN
  • Acceptable: US
  • Unacceptable: China
has_powder optional Whether product contains powder. Example: true, false.
  • Acceptable: True
  • Acceptable: False
  • Unacceptable: 0
  • Unacceptable: Yes
has_liquid optional Whether product contains liquid. Example: true, false.
  • Acceptable: True
  • Acceptable: False
  • Unacceptable: 0
  • Unacceptable: Yes
has_battery optional Whether product contains battery. Example: true, false.
  • Acceptable: True
  • Acceptable: False
  • Unacceptable: 0
  • Unacceptable: Yes
has_metal optional Whether product contains metal. Example: true, false.
  • Acceptable: True
  • Acceptable: False
  • Unacceptable: 0
  • Unacceptable: Yes

Returns
Upon success, a product will be created and that product is returned in the response with its corresponding Wish identifier.

Example

Lets say you had product named "red shoe" with a SKU of red-shoe-11,with price $100.00 and shipping of $10.00. If you want the description to be "this is a cool shoe" and its tags to be "red,shoe,cool". You want "http://i.imgur.com/Q1a32kD.jpg" to be the main image for your product and have additional imge "http://i.imgur.com/Cxagv.jpg" and "http://i.imgur.com/LuPSxBM.jpg". Assume your access token is "an_example_access_token"

  • name = red shoe
  • parent_sku = red-shoe
  • sku = red-shoe-11
  • inventory = 100
  • price = 100
  • localized_price = 600
  • shipping = 10
  • localized_shipping = 60
  • country_shipping_prices = {"US":3.99,"CA":4.99,"LOCAL_US":24.0}
  • description = this is a cool shoe
  • tags = red,shoe,cool
  • main_image = http://i.imgur.com/Q1a32kD.jpg
  • extra_images=http://i.imgur.com/Cxagv.jpg|http://i.imgur.com/Cxagv.jpg
  • access_token = an_example_access_token

Example Request

<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$product = array(
  'name'=>'red shoe',
  'main_image'=>'http://i.imgur.com/Q1a32kD.jpg',
  'extra_images'=>'http://i.imgur.com/Cxagv.jpg|http://i.imgur.com/Cxagv.jpg',
  'sku'=>'red-shoe-11',
  'parent_sku'=>'red-shoe',
  'country_shipping_prices'=>'{"US":3.99,"CA":4.99,"LOCAL_US":24.0}'
  'tags'=>'red,shoe,cool',
  'description'=>'a cool shoe',
  'inventory'=>'100',
      'price'=>'100',
          'localized_price'=>'600',
      'shipping'=>'10',
          'localized_shipping'=>'60',
      'localized_currency_code'=>'CNY'
  );
$prod_res = $client->createProduct($product);
print_r($prod_res);
?>
> curl https://sandbox.merchant.wish.com/api/v2/product/add -d "main_image=http://i.imgur.com/Q1a32kD.jpg&name=shoe&description=this is a cool shoe&tags=red,shoe,cool&sku=red-shoe-11&inventory=100&price=100&localized_price=60&shipping=10&localized_shipping=60&localized_currency_code=CNY&country_shipping_prices={"US":3.99,"CA":4.99,"LOCAL_US":24.0}&extra_images=http://i.imgur.com/Q1a32kD.jpg|http://i.imgur.com/Cxagv.jpg&parent_sku=red-shoe&access_token=an_example_access_token"
<?php

$access_token = urlencode('an_example_access_token');

$name = urlencode('red shoe');
$parent_sku = urlencode('red-shoe');
$sku = urlencode('red-shoe-11');
$inventory = urlencode('100');
$price = urlencode('100');
$shipping = urlencode('10');
$localized_price = urlencode('600');
$localized_shipping = urlencode('60');
$localized_currency_code = urlencode('CNY');
$country_shipping_prices = urlencode('{"US":3.99,"CA":4.99,"LOCAL_US":24.0}')
$description = urlencode('this is a cool shoe');
$tags = urlencode('red,shoe,cool');
$main_image = urlencode('http://i.imgur.com/Q1a32kD.jpg');
$extra_images = urlencode('http://i.imgur.com/Cxagv.jpg|http://i.imgur.com/Cxagv.jpg');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/add?access_token=%s&main_image=%s&name=%s&description=%s&tags=%s&sku=%s&inventory=%s&price=%s&shipping%s&localized_price=%s&localized_shipping=%s&localized_currency_code=%s&extra_images=%s&parent_sku=%s",
    $access_token, $main_image, $name, $description, $tags, $sku, $inventory, $price, $shipping, $localized_price, $localized_shipping, $localized_currency_code, $extra_images, $parent_sku);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{'code': 0,
 'data':
    {'Product': {'description': ' this is a cool shoe',
                 'id': '52a11ebdf94adc0cfee0dbd9',
                 'name': 'red shoe',
                 'number_saves': '0',
                 'number_sold': '0',
                 'parent_sku': 'red-shoe',
                 'review_status': 'pending',
                 'removed_by_merchant': False,
                 'tags': [{'Tag': {'id': 'red',
                                   'name': 'red'}},
                          {'Tag': {'id': 'cool',
                                   'name': 'cool'}},
                          {'Tag': {'id': 'shoe',
                                   'name': 'shoe'}}],
                 'country_shippings': [{'CountryShipping': {'price': '4.99',
                                                                                                                'localized_price': '30.0',
                                                    'localized_currency_code': 'CNY',
                                                    'country_code': 'CA'}},
                                       {'CountryShipping': {'price': '3.99',
                                                    'localized_price': '24.0',
                                                    'localized_currency_code': 'CNY',
                                                    'country_code': 'US'}}],
                  'variants': [{'Variant': {'enabled': 'True',
                                           'id': '52a11ebef94adc0cfee0dbdb',
                                           'product_id': '52a11ebdf94adc0cfee0dbd9',
                                           'inventory': '100',
                                           'shipping_time': '5-10',
                                           'sku': 'red-shoe-11',
                                           'price': '100.0',
                                           'shipping': '10.0'
                                           'localized_price': '600.0',
                                           'localized_shipping': '60.0'
                                           'localized_currency_code': 'CNY'}]}},
'message': ''}

Retrieve a Product

Retrieve the details about a product which exists on the Wish platform. You must have the unique product Id or the parent sku that was returned upon product creation.

HTTP Request Type: GET

Scope: products:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/product

Explore API

Parameters
idMust provide either id or parent_sku The unique wish identifier for this product
parent_skuMust provide either id or parent_sku The parent sku for this product
warehouse_nameoptional The warehouse from where the variant shippings and inventories are fetched. If not specified, default warehouse shippings and inventories are used.

Returns
Returns a product entity if a valid identifier was provided.

Example

Assume your access token is "an_example_access_token" . If you want to retrieve a product with the id 4ef2858a9795c776ce000120:

  • id = 4ef2858a9795c776ce000120
  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/product?id=4ef2858a9795c776ce000120&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$product = $client->getProductById('4ef2858a9795c776ce000120');
print_r($product);
?>
<?php

$access_token = urlencode('an_example_access_token');

$id = urlencode('4ef2858a9795c776ce000120');

$url = sprintf("https://sandbox.merchant.wish.com/api/v2/product?access_token=%s$id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{'code': 0,
 'data': {'Product':{'description': ' Cotton Women Fashion Dresses',
                      'id': '51e0a2c47d41a236cfffe3a0',
                      'name': 'TEST!!!',
                      'category': 'Fashion',
                      'number_saves': '12529',
                      'number_sold': '14',
                      'review_status': 'approved',
                      'removed_by_merchant': False,
                      'tags': [{'Tag': {'id': 'Dress', 'name': 'Dress'}},
                              ],
                      'default_shipping_price': '5.0',
                      'country_shippings': [{'CountryShipping': {'price': '4.99',
                                                                 'localized_price': '30',
                                                                 'localized_currency_code': 'CNY',
                                                                 'country_code': 'CA'}},
                                            {'CountryShipping': {'price': '3.99',
                                                                 'localized_price': '24',
                                                                 'localized_currency_code': 'CNY',
                                                                 'country_code': 'US'}}],
                      'variants': [{'Variant': {'enabled': 'True',
                                                'id': '51e0a2c67d41a236cfffe3a2',
                                                'product_id': '51e0a2c47d41a236cfffe3a0',
                                                'inventory': '10000',
                                                'msrp': '20000.0',
                                                'price': '10000.0',
                                                'shipping': '101.0',
                                                'localized_price': '60000.0',
                                                'localized_shipping': '606.0',
                                                'localized_currency_code': 'CNY',
                                                'sku': 'Bottle',
                                                'LogisticsMetadata': {
                                                   'declared_name': 'Bottle',
                                                   'declared_local_name': '瓶子',
                                                   'pieces': 1,
                                                   'height': '12.0',
                                                   'weight': '2.0',
                                                   'width': '23.0',
                                                   'length': '2.0',
                                                   'origin_country': 'US',
                                                   'hscode':'6104299034',
                                                   'product_id': '59c17fbae3a3f61e0dba33b8',
                                                   'id': '51e0a2c67d41a236cfffe3a2',
                                                   'declared_value': '32.0',
                                                   'Composition': {
                                                   'has_liquid': 'True',
                                                   'has_battery': 'False',
                                                   'has_powder': 'False',
                                                   'has_metal': 'False'
                                                    }
                                                }
                                                }}]}},
                      'country_shippings': [{'CountryShipping': {'price': '4.99',
                                                                 'localized_price': '30',
                                                                                                                        'localized_currency_code': 'CNY',
                                                                 'country_code': 'CA'}},
                                            {'CountryShipping': {'price': '3.99',
'localized_price': '24'
                                                                 'localized_currency_code': 'CNY',
                                                                 'country_code': 'US'}}],
'message': ''}

Update a Product

Updates the specified product with the parameters passed in the request. Any attribute not provided will be left unchanged. For example, if you pass the name parameter we will update the name of the product and leave everything else unchanged.

This request can only update attributes specific to products and cannot be used to update anything to do with the product variations of a product.

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/product/update

Explore API

Parameters
idMust provide either id or parent_sku Wish's unique identifier for the product you would like to update
parent_skuMust provide either id or parent_sku The parent sku for the product you would like to update
nameoptional Name of the product as shown to users
descriptionoptional Description of the product. If you want a new line use "\n".
tagsoptional Comma separated list of strings. The tags passed into this parameter will completely replace the tags that are currently on the product
requested_product_brand_idoptional Brand ID of your product
landing_page_urloptional URL on your website containing the product detail and buy button for the applicable product.
upcoptional 8 to 14 digits GTIN (UPC, EAN, ISBN) contains no letters or other characters
main_imageoptional URL of a photo of your product. Link directly to the image, not the page where it is located. We accept JPEG, PNG or GIF format. Images should be at least 100 x 100 pixels in size. It may take up to 1 hour for the image to be updated.
extra_imagesoptional URL of a photo of your product. Link directly to the image, not the page where it is located. Same rules apply as main_image. You can specify one or more additional images separated by the character '|'. The order of the urls will be the order of the images displayed on product page. To update existing images or add new images, you need to provide all extra image URLs, including the ones that remain the same. If none of the extra image URLs is provided, no update will be done. The total number of extra images plus the number of variation images must not exceed 100. It may take up to 1 hour for the images to be updated
clean_imageoptional URL of a clean image of your product. Update a product’s clean image with a Wish URL from an existing Wish main_image_url, Wish extra_image_url on the product, or an image added in this call. For example: this image. If the clean image URL is not an image for the product the clean image will not be set. Products with a clean image selected may receive increased impressions and sales. It may take up to 1 for the image to be updated. Learn more.
max_quantityoptional The maximum quantity of products per order.
conditionoptional The condition of the product. Example: NEW, USED, REFURBISHED
reference_valueoptional The reference value (in the given unit) that is used to calculate the price per unit of a product and to illustrate the unit count for the consumer to see. Learn More.
unit optional The unit of measurement for the total content of a product. This will be used to display the price per unit, and is the unit of measurement that will be used for both the Reference Value and Quantity Value attributes. Learn More.

Enum: "OUNCE" "POUND" "MILLIGRAM" "GRAM" "KILOGRAM" "FLUID_OUNCE" "PINT" "QUART" "GALLON" "MILLILITER" "CENTILITER" "LITER" "CUBICMETER" "INCH" "FOOT" "YARD" "CENTIMETER" "METER" "SQUARE_FOOT" "SQUARE_METER" "COUNT" "LOAD" "WASH" "ROLL" "POD" null

Returns
If the request was successful the API will return an HTTP status code of 200 and a status code of 0.

Example

Assume your access token is "an_example_access_token" . If you had a product with id 123456789009876543211234 and you wanted to change the name to "Awesome shoe", update the description to "This shoe is the best on Wish" and change the tags to "shoe,awesome,size 11" your parameters would be:

  • id = 123456789009876543211234
  • name = Awesome shoe
  • description = This shoe is the best on Wish
  • tags = shoe, awesome, size 11
  • access_token = an_example_access_token

If you did not want to update the tags, you would omit that parameter from your API call.

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/update -d "id=123456789009876543211234&name=Awesome shoe&description=This shoe is the best on Wish&tags=shoe, awesome, size 11&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$product = $client->getProductById('123456789009876543211234');
$product->name = "Awesome name";
$product->description = "This shoe is the best on Wish";
$product->tags = "shoe, awesome, size 11";
$client->updateProduct($product);
?>
<?php

$access_token = urlencode('an_example_access_token');

$id = urlencode('123456789009876543211234')
$name = urlencode('Awesome shoe');
$description = urlencode('This shoe is the best on Wish');
$tags = urlencode('shoe, awesome, size 11')

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/update?access_token=%s&id=%s&name=%s&description=%s&tags=%s",
    $access_token, $id, $name, $description, $tags);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {},
    'message': ''
}

Change Product Parent SKU

Change a product's parent SKUs, the new identifier must also be unique within all products' parent SKUs of the merchant and also has to be unique within all variation's SKUs

HTTP Request Type: POST

Scope: products:write

Definition
GET https://sandbox.merchant.wish.com/api/v2/product/change-sku

Explore API

Parameters
idMust provide either id or parent_sku The unique wish identifier for this product
parent_skuMust provide either id or parent_sku The parent sku for this product
new_parent_skuThe new unique parent sku for the product you would like to change to

Returns
If the request was successful the API will return an HTTP status code of 200 and a status code of 0.

Example

Assume your access token is "an_example_access_token" . If you have an item with the parent SKU 'ML-SZ52019' and you would like to change it to 'ML-SZ520190' your parameters would be:

  • parent_sku = ML-SZ52019
  • new_parent_sku = ML-SZ520190
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/change-sku -d "parent_sku=ML-SZ52019&new_sku=ML-SZ520190&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->changeProductVariationSKU('blue-shoe-11', 'blue-shoe-12');
<?php

$access_token = urlencode('an_example_access_token');

$parent_sku = urlencode('ML-SZ52019');
$new_parent_sku = urlencode('ML-SZ520190');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/change-sku?access_token=%s&parent_sku=%s&new_parent_sku=%s",
    $access_token, $parent_sku, $new_parent_sku);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {},
    'message': ''
}

Enable a Product

Enable a product and all of its product variations. This marks the product available for sale.

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/product/enable

Explore API

Parameters
idMust provide either id or parent_sku Wish's unique identifier for the product you would like to update
parent_skuMust provide either id or parent_sku The parent sku for the product you would like to update

Returns
If the request was successful the API will return an HTTP status code of 200 and a status code of 0.

Example

Assume your access token is "an_example_access_token" . If you had a product with id 123456789009876543211234 and you wanted to enable it, your parameters would be:

  • id = 123456789009876543211234
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/enable -d "id=123456789009876543211234&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->enableProductById('123456789009876543211234');
?>
<?php

$access_token = urlencode('an_example_access_token');

$id = urlencode('123456789009876543211234')

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/enable?access_token=%s&id=%s",
    $access_token, $id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {},
    'message': ''
}

Disable a Product

Disable a product and all of its product variations. This marks the product unavailable for sale.

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/product/disable

Explore API

Parameters
idMust provide either id or parent_sku Wish's unique identifier for the product you would like to update
parent_skuMust provide either id or parent_sku The parent sku supplied when product was uploaded

Returns
If the request was successful the API will return an HTTP status code of 200 and a status code of 0.

Example

Assume your access token is "an_example_access_token" . If you had a product with id 123456789009876543211234 and you wanted to disable it, your parameters would be:

  • id = 123456789009876543211234
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/disable -d "id=123456789009876543211234&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->disableProductById('123456789009876543211234');
?>
<?php

$access_token = urlencode('an_example_access_token');

$id = urlencode('123456789009876543211234')

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/disable?access_token=%s&id=%s",
    $access_token, $id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {},
    'message': ''
}

Remove Product

Call this to permanently remove a product from the store. This action cannot be undone, and will hide the product completely on Wish. Also note that the SKUs of the product will be modified to allow reusing them.

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/product/remove

Explore API

Parameters
idMust provide either id or parent_sku Wish's unique identifier for the product you would like to update
parent_skuMust provide either id or parent_sku The parent sku supplied when product was uploaded

Returns
This will return 200 if the product was removed successfully.

Example

Assume your access token is "an_example_access_token" . Suppose you want to remove your product with product_id = "57bb5803ba2a1f181de31b01":

  • id = 57bb5803ba2a1f181de31b01
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/remove -d "id='57bb5803ba2a1f181de31b01'&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$id = '57bb5803ba2a1f181de31b01';
$client->removeProduct('098765432112345678901234',$id);
<?php

$access_token = urlencode('an_example_access_token');

$id = urlencode('57bb5803ba2a1f181de31b01');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/remove?access_token=%s&id=%s",
    $access_token, $job_id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {},
    'message': ''
}

List all Products

This API will be changed starting Oct. 24, 2016. Please switch to the batch download API to download all Products.

Returns a list of all your products currently on the Wish platform. If you have a high number of products the response will be paginated. The response will contain the URL for fetching the next page of products.

HTTP Request Type: GET

Scope: products:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/product/multi-get

Explore API

Parameters
startoptional An offset into the list of returned items. Use 0 to start at the beginning. The API will return the requested number of items starting at this offset. Default to 0 if not supplied
Starting Oct. 24, 2016, 'start' will be limited to a maximum value of 25000
limitoptional A limit on the number of products that can be returned. Limit can range from 1 to 250 items and the default is 50
sinceoptional A date/time string in the format YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS. If a date or time is provided, only products updated since the given date or time will be fetched. Default is to fetch all.
upto optional A date/time string in the format YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS. If a date or time is provided, only products updated before the given date or time will be fetched. Default is to fetch all updated products until now.
show_rejectedoptional If specified to 'true', this API will return all products including those inappropriate products that were rejected during review.
warehouse_nameoptional The warehouse from where the variants' shippings and inventories are fetched. If not specified, default warehouse variation shippings and inventories are used.

Returns
Response will contain a list of product objects as well as a 'paging' field with paging options if needed.
By default, product objects are sorted in descending order by last update time and product id.

Example

Assume your access token is "an_example_access_token" . If you would like to view your products updated after 2014-10-15 and before 2015-06-10 01:00:00 in groups of 2 and you would like to see the 10th group your parameters would be:

  • start = 20
  • limit = 2
  • since = 2014-10-15
  • upto = 2015-06-10T01:00:00
  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/product/multi-get?limit=2&start=20&since=2014-10-15&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$products = $client->getAllProducts();
echo "You have ".count($products)." products!\n";
<?php

$access_token = urlencode('an_example_access_token');

$start = urlencode('20');
$limit = urlencode('2');
$since = urlencode('2014-10-15');
$upto = urlencode('2015-06-10T01:00:00');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/multi-get?access_token=%s&limit=%s&start=%s&upto=%s",
    $access_token, $limit, $start, $since, $upto);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{'code': 0,
 'data': [{'Product': {'description': 'Example description',
                       'id': '5284e18fb5baba49d5xxxxxx',
                       'name': 'Cute Ring',
                       'category': 'Fashion',
                       'number_saves': '6',
                       'number_sold': '0',
                       'parent_sku': 'Cute Bow Ring',
                       'review_status': 'approved',
                       'removed_by_merchant': False,
                       'default_shipping_price': '10.5',
                       'tags': [{'Tag': {'id': 'womensring', 'name': 'womens ring'}},
                                {'Tag': {'id': 'jewelry', 'name': 'Jewelry'}},
                                {'Tag': {'id': 'bow', 'name': 'Bow'}}],
                       'variants': [{'Variant': {'color': 'green',
                                                 'condition': 'NEW',
                                                 'enabled': 'True',
                                                 'id': '5284e192b111ba49d5xxxxxx',
                                                 'product_id': '5284e18fb5baba49d5xxxxxx',
                                                 'inventory': '11',
                                                 'msrp': '113.9',
                                                 'price': '110.9',
                                                 'shipping': '10.5',
                                                 'localized_price': '660.0',
                                                 'localized_shipping': '63.0',
                                                 'localized_currency_code': 'CNY',
                                                 'sku': 'AA1'}},
                                    {'Variant': {'color': 'blue',
                                                 'condition': 'USED',
                                                 'enabled': 'True',
                                                 'id': '5284e19qqqbaba49d5bbbbbb',
                                                 'product_id': '5284e18fb5baba49d5xxxxxx',
                                                 'inventory': '100',
                                                 'msrp': '19.9',
                                                 'price': '15.9',
                                                 'shipping': '10.5',
                                                 'localized_price': '90.0',
                                                 'localized_shipping': '63.0',
                                                 'localized_currency_code': 'CNY',
                                                 'sku': 'ZZ1'}}]}},
           {'Product': {'description': 'Example Description',
                         'id': '5284efafb5bab119d1zzzzzz',
                         'name': 'Fairisle Scarf',
                         'number_saves': '0',
                         'number_sold': '0',
                         'parent_sku': 'Fairisle Scarf',
                         'review_status': 'rejected',
                         'removed_by_merchant': False,
                         'default_shipping_price': '10.0',
                         'tags': [{'Tag': {'id': 'cottonscarf', 'name': 'cotton scarf'}},
                                  {'Tag': {'id': 'fashionaccessorie', 'name': 'Fashion Accessories'}},
                                  {'Tag': {'id': 'fashion', 'name': 'Fashion'}},
                                  {'Tag': {'id': 'scarf', 'name': 'scarf'}}],
                         'variants': [{'Variant': {'color': 'gray',
                                                   'enabled': 'True',
                                                   'id': '5284efb1b111ba49d1qqqqqq',
                                                   'product_id': '5284efafb5bab119d1zzzzzz',
                                                   'inventory': '1010',
                                                   'msrp': '25.9',
                                                   'price': '21.91',
                                                   'shipping': '10.0',
                                                   'localized_price': '120.0',
                                                   'localized_shipping': '60.0',
                                                   'localized_currency_code': 'CNY',
                                                   'sku': 'AA4'}},
                                       {'Variant': {'color': 'red',
                                                    'enabled': 'True',
                                                    'id': '5284efbaaababa49d1eiwqdf',
                                                    'product_id': '5284efafb5bab119d1zzzzzz',
                                                    'inventory': '1100',
                                                    'msrp': '21.99',
                                                    'price': '21.91',
                                                    'shipping': '11.0',
                                                    'localized_price': '120.0',
                                                    'localized_shipping': '66.0',
                                                    'localized_currency_code': 'CNY',
                                                    'sku': 'AAB'}}]}}],
                         'country_shippings': [{'CountryShipping': {'price': '4.99',
                                                                    'localized_price': '30.0',
                                                                                                                           'localized_currency_code': 'CNY',
                                                                    'country_code': 'CA'}},
                                               {'CountryShipping': {'price': '3.99',
'localized_price': '24.0',
                                                                    'localized_currency_code': 'CNY',
                                                                    'country_code': 'US'}}],
'message': '',
'paging': {'next': 'https://sandbox.merchant.wish.com/api/v2/product/multi-get?start=22&limit=2&since=2014-10-15&access_token=an_example_access_token',
'previous': 'https://sandbox.merchant.wish.com/api/v2/product/multi-get?start=18&limit=2&since=2014-10-15&access_token=an_example_access_token'}}

Remove Extra Images from a Product

This removes all the extra images from the product.
The main product image and variation images will not be affected.

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/product/remove-extra-images

Explore API

Parameters
idMust provide either id or parent_sku The unique Wish identifier for this product
parent_skuMust provide either id or parent_sku The parent sku for this product

Example

Assume your access token is "an_example_access_token". If you had a product with id 123456789009876543211234 and you wanted to remove its extra images, your parameters would be:

  • id = 123456789009876543211234
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/remove-extra-images -d "access_token=an_example_access_token" --data-urlencode "id=123456789009876543211234"
<?php

$access_token = urlencode('an_example_access_token');
$id = urlencode('123456789009876543211234');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/remove-extra-images?access_token=%s&id=%s",
    $access_token, $id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->removeExtraImagesById('123456789009876543211234');
?>

Example Response

{
    "message":"",
    "code":0,
    "data":{}
}

Edit Shipping Price of a Product

This edits the shipping prices of a product to a specific country.

The merchant's shipping settings for this country must exist to indicate that the merchant supports this country.

You can set field 'enabled' to false to indicate that the product is disabled for that country. Users from a disabled country will not be able to buy the product. To re-enable a product, set the 'enabled' field to true or set the shipping price without the 'enabled' field.

If you are part of the Wish Express program, you can set the field 'wish_express' to indicate whether the product should be enrolled in Wish Express for this country.

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/product/update-shipping

Explore API

Parameters
idMust provide either id or parent_sku The unique Wish identifier for this product
parent_skuMust provide either id or parent_sku The parent sku for this product
countryRequired The 2 letter country code. See Shippable Countries for a list of supported countries. Choose one from:
AD, AL, AR, AT, AU, BA, BE, BG, BR, CA, CH, CL, CO, CR, CZ, DE, DK, EE, ES, FI, FR, GB, GI, GR, HR, HU, IE, IL, IS, IT, JP, KR, LI, LT, LU, LV, MC, MD, ME, MK, MT, MX, NL, NO, NZ, PE, PL, PR, PT, RO, RS, SE, SG, SI, SK, SM, UA, US, VI, ZA, For regions, enter 2 leter country code + '_' + 2 or 3 letter regional code. E.g. "US_HI" for Hawaii, United States. See Customizable Regions for a list of supported regions.
price The shipping price (in USD) of this product to this country, max 1000.
localized_price optional The price of the variation in the merchant's local currency. This is required for non-USD merchants.
localized_currency_code optional The merchant's localized currency code. This must be provided in order to set localized pricing fields. This is required for non-USD merchants.
enabled Determines if the product is enabled or disabled. Users from a disabled country will not be able to buy the product.
wish_express Determines whether the product is enrolled in the Wish Express program for this country. If yes, the product must be delivered to customers in that country within 5 working days.
default_shipping_price The default shipping price for the product. Once set, the default shipping price will automatically apply as the shipping price for any new or unset countries.
localized_default_shipping_price optional The localized default shipping price for the productin the merchant's local currency. Once set, the localized default shipping price will automatically apply as the localized shipping price for any new or unset countries. This is required for non-USD merchants if the default_shipping_price is being updated.
use_country_shipping A boolean value which determines if the product is using country shipping price for the given region. This is used by regional shipping only. Setting to True will override the price field.
warehouse_name The name of the warehouse on which the action will be performed. If warehouse name is not specified, and country level shipping price is specified, the effect of enabled and wish_express will apply across all warehouses.
For example, if warehouse_name is not specified and:
if enabled is false, all standard / express warehouse's shipping to the specified country will be disabled;
if wish_express is false, the corresponding Express warehouse's shipping to that country will be disabled;
if wish_express is true, shipping will be copied to the corresponding Express warehouse, and inventory will be split between the corresponding Express warehouses and the Standard warehouse, no values will be modified if already set.
If warehouse name is not specified, and regional level shipping price is specified, the effect of enabled will apply to standard warehouse only. wish_express will have no effect.

Example

Assume your access token is "an_example_access_token". If you had a product with id 123456789009876543211234 and you wanted to edit its shipping price of Canada to $2.99 USD, enable Wish Express to Canada, and set the default shipping price to $3.99 USD, your parameters would be:

  • id = 123456789009876543211234
  • access_token = an_example_access_token
  • country = CA
  • price = 2.99
  • localized_price = 18
  • localized_currency_code = CNY
  • wish_express = true
  • default_shipping_price = 3.99
  • localized_default_shipping_price = 24

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/update-shipping -d "id=123456789009876543211234&country=CA&price=2.99&localized_price=18&localized_currency_code=CNY&localized_default_shipping_price=24&wish_express=true&access_token=an_example_access_token"
<?php

$access_token = urlencode('an_example_access_token');
$id = urlencode('123456789009876543211234');
$country = urlencode('CA');
$price = urlencode('2.99');
$localized_price = urlencode('18.0');
$loclaized_currency_code = urlencode('CNY');
$wish_express = urlencode('true');
$default_shipping_price = urlencode('3.99');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/update-shipping?access_token=%s&id=%s&country=%s&price=%s&localized_price=%s&localized_currency_code=%s&localized_default_shipping_price=%s&wish_express=%s&default_shipping_price=%s",
    $access_token, $id, $country, $price, $localized_price, $localized_currency_code, $localized_default_shipping_price, $wish_express, $default_shipping_price);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->updateShippingById('123456789009876543211234', 'CA', 2.99);

?>

Example Response

{
    "message":"",
    "code":0,
    "data":{}
}

Edit Shipping Prices of a Product

This edits the shipping prices of a product.

This country must be enabled in merchant's Shipping Settings to indicate that the merchant supports this country.

If you are enrolled in the Wish Express program, you can specify Wish Express countries to enable for the product.

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/product/update-multi-shipping

Explore API

Parameters
idRequired The unique Wish identifier for this product
AD, AL, AR, AT, AU, BA, BE, BG, BR, CA, CH, CL, CO, CR, CZ, DE, DK, EE, ES, FI, FR, GB, GI, GR, HR, HU, IE, IL, IS, IT, JP, KR, LI, LT, LU, LV, MC, MD, ME, MK, MT, MX, NL, NO, NZ, PE, PL, PR, PT, RO, RS, SE, SG, SI, SK, SM, UA, US, VI, ZA, Each value is the localized shipping price in the merchant's local currency of this product to the country. See Shippable Countries for a list of supported countries. Use the format localized_CC where CC is a valid country code. This sets the localized shipping price for the country within the warehouse specified in warehouse_name parameter, and meanwhile the country will be enabled in that warehouse. If localized_CC is provided and the country is included in wish_express_add_countries, and warehouse_name is not specified, the provided shipping price will be copied to the Wish Express shipping. Maximum is $1000 USD, or what's equivalent in local currency.
localized_CC This is required for non-USD merchants. If the country code (CC) is being updated, the localized_CC field must be provided as well. Each value is the localized shipping price in the merchant's local currency of this product to the country. See Shippable Countries for a list of supported countries. Use the format localized_CC where CC is a valid country code. This sets the localized shipping price for the country within the warehouse specified in warehouse_name parameter, and meanwhile the country will be enabled in that warehouse. If localized_CC is provided and the country is included in wish_express_add_countries, and warehouse_name is not specified, the provided shipping price will be copied to the Wish Express shipping. Maximum is $1000 USD, or what's equivalent in local currency.
localized_currency_codeThe merchant's local currency code. This is required for non-USD merchants. This can be retrieved in Merchant Currency Code API.
AU_ACT, AU_JBT, AU_NSW, AU_NT, AU_QLD, AU_SA, AU_TAS, AU_VIC, AU_WA, BR_BAC, BR_BAI, BR_MGC, BR_MGI, BR_PRC, BR_PRI, BR_RJC, BR_RJI, BR_RSC, BR_SFB, BR_SPC, BR_SPI, CA_AB, CA_BC, CA_MB, CA_NB, CA_NL, CA_NS, CA_NT, CA_NU, CA_ON, CA_PE, CA_QC, CA_SK, CA_YT, CL_AI, CL_AN, CL_AP, CL_AR, CL_AT, CL_BI, CL_CO, CL_LI, CL_LL, CL_LR, CL_MA, CL_ML, CL_NB, CL_RM, CL_TA, CL_VS, DK_014, DK_042, DK_FO, DK_GL, ES_CN, ES_IB, FR_20R, FR_GF, FR_GP, FR_MF, FR_MQ, FR_NC, FR_PF, FR_PM, FR_RE, FR_WF, FR_YT, MX_AGU, MX_BCN, MX_BCS, MX_CAM, MX_CHH, MX_CHP, MX_COA, MX_COL, MX_DIF, MX_DUR, MX_GRO, MX_GUA, MX_HID, MX_JAL, MX_MEX, MX_MIC, MX_MOR, MX_NAY, MX_NLE, MX_OAX, MX_PUE, MX_QUE, MX_ROO, MX_SIN, MX_SLP, MX_SON, MX_TAB, MX_TAM, MX_TLA, MX_VER, MX_YUC, MX_ZAC, PT_20, PT_30, US_AA, US_AE, US_AK, US_AL, US_AP, US_AR, US_AS, US_AZ, US_CA, US_CO, US_CT, US_DC, US_DE, US_FL, US_GA, US_GU, US_HI, US_IA, US_ID, US_IL, US_IN, US_KS, US_KY, US_LA, US_MA, US_MD, US_ME, US_MI, US_MN, US_MO, US_MP, US_MS, US_MT, US_NC, US_ND, US_NE, US_NH, US_NJ, US_NM, US_NV, US_NY, US_OH, US_OK, US_OR, US_PA, US_RI, US_SC, US_SD, US_TN, US_TX, US_UT, US_VA, US_VT, US_WA, US_WI, US_WV, US_WY, Use the format CC_RC where CC is a valid country code and RC is a valid region code inside the country. Each value is the shipping price (in USD) of this product to the region/state. The maximum value is 2 times the country shipping price. Updating shipping will enable the region automatically. See Customizable Regions for a list of supported regions.
localized_CC_RC This is required for non-USD merchants. If the field (CC_RC)'s is being updated, the localized_CC_RC field must be provided as well. Use the format localized_CC_RC where CC is a valid country code and RC is a valid region code inside the country. Each value is the shipping price in the merchant's local currency of this product to the region/state. The maximum value is 2 times the country shipping price. Updating shipping will enable the region automatically. See Customizable Regions for a list of supported regions.
disabled_countries A string that consists of country codes or region codes separated by comma. For example, 'AU,CA,US,US_HI,FR_RE'. Users in disabled countries or regions cannot see or buy the product.
enabled_countries A string that consists of country codes or region codes separated by comma. For example, 'AU,CA,US,US_HI,FR_RE'. Users in enabled countries or regions can see or buy the product.
wish_express_add_countries A string that consists of country codes separated by comma. For example, 'AU,CA,US'. The product must be shipped to a customer in any of those countries within 5 working days. If the Wish Express warehouse for the destination country does not exist yet, an error message will return. If country shipping price is provided in localized_CC and CC is in wish_express_add_countries, both STANDARD warehouse and Wish Express warehouse will be enabled with that provided localized shipping price.
wish_express_remove_countries A string that consists of country codes separated by comma. For example, 'AU,CA,US'.
regions_use_country_shipping A string that consists of country region codes separated by comma. For example, 'FR_RE, US_HI'. This is for regional shipping only. If a region is entered here, it overrides the price.
default_shipping_price The default shipping price for the product. Once set, the default shipping price will automatically apply as the shipping price for any new or unset countries.
localized_default_shipping_price The localized default shipping price for the product in the merchant's local currency. Once set, the localized default shipping price will automatically apply as the localized shipping price for any new or unset countries.
warehouse_name The name of the warehouse on which the action will be performed. If warehouse name is not specified, the effect of disabled_countries, wish_express_add_countries and wish_express_remove_countries will apply across all warehouses.
For example, if warehouse_name is not specified and:
if disabled_countries is set, all standard / express warehouse's shipping to the specified countries will be disabled;
if wish_express_add_countries is set, shipping will be copied to the corresponding Express warehouse, and inventory will be split between the corresponding Express warehouses and the Standard warehouse, no values will be modified if already set;
if wish_express_remove_countries is set, express shipping will be disabled for the corresponding countries;
Parameter Priority

The four variables - disabled_countries, enabled_countries, wish_express_remove_countries, and wish_express_add_countries - have the following priority.

  1. disabled_countries / enabled_countries
  2. wish_express_remove_countries
  3. wish_express_add_countries
For example, when 'US' is specified for disabled_countries, wish_express_remove_countries, and wish_express_add_countries at the same time, the disabled_countries take effect above others.

Example

Assume your access token is "an_example_access_token". If you had a product with id 123456789009876543211234 and you wanted to edit its shipping price of Canada to $2.99 USD, of Australia to $1.99, of Great Britain and Italy to "Use product variation prices", disable the product Mexico and Brazil, enable Wish Express for the product in France and Spain, disable Wish Express for the product in the United States and Canada, and set the default shipping price to $3.99 USD, your parameters would be:

  • id = 123456789009876543211234
  • access_token = an_example_access_token
  • CA = 2.99
  • localized_CA = 18
  • AU = 1.99
  • localized_AU = 12
  • localized_currency_code = CNY
  • disabled_countries = 'MX,BR'
  • wish_express_add_countries = 'FR,ES'
  • wish_express_remove_countries = 'US,CA'
  • default_shipping_price = 3.99
  • localized_default_shipping_price = 24

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/update-multi-shipping -d "id=123456789009876543211234&CA=2.99&AU=1.99&localized_CA=18&localized_AU=12&localized_currency_code=CNY&disabled_countries=MX,BR&wish_express_add_countries=FR,ES&wish_express_remove_countries=US,CA&access_token=an_example_access_token"
<?php

$access_token = urlencode('an_example_access_token');
$id = urlencode('123456789009876543211234');
$CA = urlencode('2.99');
$localized_CA = urlencode('18');
$AU = urlencode('1.99');
$localized_AU = urlencode('18');
$localized_currency_code = urlencode('CNY');
$disabled_countries = urlencode('MX,BR');
$wish_express_add_countries = urlencode('FR,ES');
$wish_express_remove_countries = urlencode('US,CA');
$default_shipping_price = urlencode('3.99');
$localized_default_shipping_price = urlencode('24');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/update-multi-shipping?access_token=%s&id=%s&CA=%s&AU=%s&localized_CA=%s&localized_AU=%s&localized_currency_code=%s&disabled_countries=%s&wish_express_add_countries=%s&wish_express_remove_countries=%s&default_shipping_price=%s&localized_default_shipping_price=%s",
    $access_token, $id, $CA, $AU, $localized_CA, $localized_AU, $localized_currency_code, $disabled_countries, $wish_express_add_countries, $wish_express_remove_countries, $default_shipping_price, $localized_default_shipping_price);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>
<?php

?>

Example Response

{
    "message":"",
    "code":0,
    "data":{}
}

Get Shipping Prices of a Product

Retrieve the shipping price of a product to a specific country and a flag indicating if the product is enabled for the country.

If merchant's shipping setting indicates that merchant does not ship to this country, the result will be an error.

If merchant's shipping setting indicates that he/she uses the product variation level shipping prices, the result will be an error.

HTTP Request Type: GET

Scope: products:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/product/get-shipping

Explore API

Parameters
idMust provide either id or parent_sku The unique Wish identifier for this product
parent_skuMust provide either id or parent_sku The parent sku for this product
countryRequired The 2 letter country code. See Shippable Countries for a list of supported countries. Choose one from:
AD, AL, AR, AT, AU, BA, BE, BG, BR, CA, CH, CL, CO, CR, CZ, DE, DK, EE, ES, FI, FR, GB, GI, GR, HR, HU, IE, IL, IS, IT, JP, KR, LI, LT, LU, LV, MC, MD, ME, MK, MT, MX, NL, NO, NZ, PE, PL, PR, PT, RO, RS, SE, SG, SI, SK, SM, UA, US, VI, ZA,
Response

Response will contain a 'ProductCountryAllShipping' dict. The 'shipping_prices' in the response has been deprecated. Please use DataV2, which contains a list of shipping options from all warehouses. Each shipping option contains the type of the price and the warehouse's name where it ships from.

Each WarehouseShipping object has the following schema:

use_product_shipping 'True'/'False'. If 'True' then the product shipping price to the country is determined by the product variations. If 'False' then the product shipping price is the fixed value in the field shipping_price.
price The shipping price of the product to the country. This field could be a number to indicate a shipping price. It could also be the string "Use Product Shipping Price" to indicate that the shipping price to this country is determined by the product variations. This value will be returned as 999999 if you receive payments in a non-USD currency. Please use localized_shipping_price instead.
localized_price The localized shipping price of the product to the country, in the merchant's local currency. This field could be a number to indicate a localized shipping price. It could also be the string "" to indicate that the localized shipping price to this country is determined by the product variations.
localized_currency_codeThe merchant's local currency code.
enabled 'True'/'False'. If 'True' then the product is available for sale in this country. If 'False' then the product is not available for sale in this country.
warehouse_name The name of the warehouse that this WarehouseShipping object is representing

Example

Assume your access token is "an_example_access_token". If you had a product with id 123456789009876543211234 and you wanted to know its shipping price to Canada, your parameters would be:

  • id = 123456789009876543211234
  • access_token = an_example_access_token
  • country = CA

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/get-shipping -d "id=123456789009876543211234&country=CA&access_token=an_example_access_token"
<?php

$access_token = urlencode('an_example_access_token');
$id = urlencode('123456789009876543211234');
$country = urlencode('CA');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/get-shipping?access_token=%s&id=%s&country=%s",
    $access_token, $id, $country);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->getShippingById('123456789009876543211234', 'CA');

?>

Example Response

{
  "message": "",
  "code": 0,
  "data": {
    "ProductCountryShipping": {
      "DataV2": {
        "ProductCountryWarehouseShipping": {
          "wish_express": "True",
          "warehouses": [
            {
              "WarehouseShipping": {
                "price_type": "wish_express",
                "price": "3.0",
                "localized_price": "18.00",
                "localized_currency_code": "CNY",
                "warehouse_name": "EXPRESS-CA",
                "enabled": "True",
                "use_product_shipping": "False"
              }
            },
            {
              "WarehouseShipping": {
                "price_type": "normal",
                "price": "None",
                "localized_price": "",
                "localized_currency_code": "CNY",
                "warehouse_name": "STANDARD",
                "enabled": "False",
                "use_product_shipping": "True"
              }
            }
          ],
          "enabled": "True",
          "id": "123456789009876543211234",
          "country_code": "CA"
        }
      },
      "shipping_price": "3.0",
      "localized_shipping_price": "18.00",
      "localized_currency_code": "CNY",
      "country_code": "CA",
      "wish_express": "True",
      "enabled": "True",
      "id": "123456789009876543211234",
      "use_product_shipping": "True"
    }
  }
}

Get All Shipping Prices of a Product

Retrieve the shipping prices of a product to all countries(both enabled and disabled).

HTTP Request Type: GET

Scope: products:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/product/get-all-shipping

Explore API

Parameters
idMust provide either id or parent_sku The unique Wish identifier for this product
parent_skuMust provide either id or parent_sku The parent sku for this product
Response

Response will contain a 'ProductCountryAllShipping' dict. The 'shipping_prices' in the response has been deprecated. Please use DataV2, which contains a list of shipping options from all warehouses. Each shipping option contains the type of the price and the warehouse's name where it ships from.

Each WarehouseShipping object has the following schema:

use_product_shipping 'True'/'False'. If 'True' then the product shipping price to the country is determined by the product variations. If 'False' then the product shipping price is the fixed value in the field shipping_price.
price The shipping price of the product to the country. This field could be a number to indicate a shipping price. It could also be the string "Use Product Shipping Price" to indicate that the shipping price to this country is determined by the product variations. This value will be returned as 999999 if you receive payments in a non-USD currency. Please use localized_shipping_price instead.
localized_price The localized shipping price of the product to the country, in the merchant's local currency. This field could be a number to indicate a localized shipping price. It could also be the string "" to indicate that the localized shipping price to this country is determined by the product variations.
localized_currency_codeThe merchant's local currency code.
enabled 'True'/'False'. If 'True' then the product is available for sale in this country. If 'False' then the product is not available for sale in this country.
warehouse_name The name of the warehouse that this WarehouseShipping object is representing

Example

Assume your access token is "an_example_access_token". If you had a product with id 123456789009876543211234, your parameters would be:

  • id = 123456789009876543211234
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/get-all-shipping -d "id=123456789009876543211234&access_token=an_example_access_token"
<?php

$access_token = urlencode('an_example_access_token');
$id = urlencode('123456789009876543211234');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/get-shipping?access_token=%s&id=%s",
    $access_token, $id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->getAllShippingById('123456789009876543211234');

?>

Example Response

{
  "message": "",
  "code": 0,
  "data": {
    "ProductCountryAllShipping": {
      "id": "123456789009876543211234",
      "DataV2": {
        "ProductCountryWarehouseAllShipping": {
          "id": "123456789009876543211234",
          "countries": [
            {
              "ProductCountryWarehouseShipping": {
                "wish_express": "False",
                "warehouses": [
                  {
                    "WarehouseShipping": {
                      "price_type": "normal",
                      "price": "4.0",
                      "localized_shipping_price": "24.0",
                      "localized_currency_code": "CNY",
                      "warehouse_name": "STANDARD",
                      "enabled": "True",
                      "use_product_shipping": "False"
                    }
                  }
                ],
                "enabled": "True",
                "id": "123456789009876543211234",
                "country_code": "CA"
              }
            },
            {
              "ProductCountryWarehouseShipping": {
                "wish_express": "False",
                "warehouses": [
                  {
                    "WarehouseShipping": {
                      "price_type": "wish_express",
                      "price": "None",
                      "localized_shipping_price": "24.0",
                      "localized_currency_code": "CNY",
                      "warehouse_name": "EXPRESS-US",
                      "enabled": "True",
                      "use_product_shipping": "True",
                      "regional_shippings": [
                        {
                          "RegionalShipping": {
                            "state": "California",
                            "use_country_shipping": "True",
                            "localized_currency_code": "USD",
                            "price": "None",
                            "enabled": "False",
                            "localized_price": "None",
                            "state_code": "CA"
                        },
                      ]
                    }
                  },
                  {
                    "WarehouseShipping": {
                      "price_type": "normal",
                      "price": "None",
                      "localized_shipping_price": "",
                      "localized_currency_code": "CNY",
                      "warehouse_name": "STANDARD",
                      "enabled": "False",
                      "use_product_shipping": "True",
                      "regional_shippings": [
                        {
                          "RegionalShipping": {
                            "state": "Hawaii",
                            "use_country_shipping": "False",
                            "localized_currency_code": "USD",
                            "price": "5.0",
                            "enabled": "True",
                            "localized_price": "5.0"
                            "state_code": "HI"
                        },
                      ]
                    }
                  }
                ],
                "enabled": "True",
                "id": "123456789009876543211234",
                "country_code": "US"
              }
            }
          ]
        }
      }
    }
  }
}

Get Shipping Prices of Many Products

Retrieve the shipping prices of many products to all enabled countries.

If merchant's shipping setting indicates that merchant ships worldwide, the result will be an error.

HTTP Request Type: GET

Scope: products:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/product/get-products-shipping

Explore API

Parameters
idsRequired List of product IDs separated by ','. At most 50 product IDs.
Response

Response will contain a list of 'ProductCountryAllShipping'. The 'shipping_prices' in the response has been deprecated. Please use DataV2, which contains a list of shipping options from all warehouses. Each shipping option contains the type of the price and the warehouse's name where it ships from.

Each WarehouseShipping object has the following schema:

use_product_shipping 'True'/'False'. If 'True' then the product shipping price to the country is determined by the product variations. If 'False' then the product shipping price is the fixed value in the field shipping_price.
price The shipping price of the product to the country. This field could be a number to indicate a shipping price. It could also be the string "Use Product Shipping Price" to indicate that the shipping price to this country is determined by the product variations. This value will be returned as 999999 if you receive payments in a non-USD currency. Please use localized_shipping_price instead.
localized_price The localized shipping price of the product to the country, in the merchant's local currency. This field could be a number to indicate a localized shipping price. It could also be the string "" to indicate that the localized shipping price to this country is determined by the product variations.
localized_currency_codeThe merchant's local currency code.
enabled 'True'/'False'. If 'True' then the product is available for sale in this country. If 'False' then the product is not available for sale in this country.
wish_express 'True'/'False'. If 'True' then the product is part of the Wish Express program and must be shipped to customers within the destination country's delivery deadline. View each country's Wish Express delivery deadline here.

Example

Assume your access token is "an_example_access_token". If you had a product with id 123456789009876543211234, your parameters would be:

  • ids = 123456789009876543211234,111122223333444455556666
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/get-products-shipping -d "ids=123456789009876543211234%2C111122223333444455556666&access_token=an_example_access_token"
<?php

$access_token = urlencode('an_example_access_token');
$ids = urlencode('123456789009876543211234,111122223333444455556666');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/get-shipping?access_token=%s&ids=%s",
    $access_token, $ids);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->getAllShippingById('123456789009876543211234');

?>

Example Response

{
  "message": "",
  "code": 0,
  "data": [
    {
      "ProductCountryAllShipping": {
        "id": "123456789009876543211234",
        "DataV2": {
          "ProductCountryWarehouseAllShipping": {
            "id": "123456789009876543211234",
            "countries": [
              {
                "ProductCountryWarehouseShipping": {
                  "wish_express": "False",
                  "warehouses": [
                    {
                      "WarehouseShipping": {
                        "price_type": "normal",
                        "price": "4.0",
                        "localized_price": "24.0",
                        "localized_currency_code": "CNY",
                        "warehouse_name": "STANDARD",
                        "enabled": "True",
                        "use_product_shipping": "False"
                      }
                    }
                  ],
                  "enabled": "True",
                  "id": "123456789009876543211234",
                  "country_code": "CA"
                }
              },
              {
                "ProductCountryWarehouseShipping": {
                  "wish_express": "False",
                  "warehouses": [
                    {
                      "WarehouseShipping": {
                        "price_type": "wish_express",
                        "price": "None",
                        "localized_price": "",
                        "localized_currency_code": "CNY",
                        "warehouse_name": "EXPRESS-US",
                        "enabled": "True",
                        "use_product_shipping": "True",
                        "regional_shippings": [
                          {
                            "RegionalShipping": {
                              "state": "California",
                              "use_country_shipping": "True",
                              "price": "None",
                              "localized_price": "None",
                              "localized_currency_code": "CNY",
                              "enabled": "False",
                              "state_code": "CA"
                          },
                        ]
                      }
                    },
                    {
                      "WarehouseShipping": {
                        "price_type": "normal",
                        "price": "None",
                        "localized_price": "",
                        "localized_currency_code": "CNY",
                        "warehouse_name": "STANDARD",
                        "enabled": "True",
                        "use_product_shipping": "True",
                        "regional_shippings": [
                          {
                            "RegionalShipping": {
                              "state": "Hawaii",
                              "use_country_shipping": "False",
                              "price": "5.0",
                              "localized_price": "30.0",
                              "localized_currency_code": "CNY",
                              "enabled": "True",
                              "state_code": "HI"
                          },
                        ]
                      }
                    }
                  ],
                  "enabled": "True",
                  "id": "123456789009876543211234",
                  "country_code": "US"
                }
              }
            ]
          }
        }
      }
    },
    {
      "ProductCountryAllShipping": {
        "id": "111122223333444455556666",
        "DataV2": {
          "ProductCountryWarehouseAllShipping": {
            "id": "111122223333444455556666",
            "countries": [
              {
                "ProductCountryWarehouseShipping": {
                  "wish_express": "False",
                  "warehouses": [
                    {
                      "WarehouseShipping": {
                        "price_type": "normal",
                        "price": "7.0",
                        "localized_price": "42.0",
                        "localized_currency_code": "CNY",
                        "warehouse_name": "STANDARD",
                        "enabled": "True",
                        "use_product_shipping": "False"
                      }
                    }
                  ],
                  "enabled": "True",
                  "id": "111122223333444455556666",
                  "country_code": "CA"
                }
              },
              {
                "ProductCountryWarehouseShipping": {
                  "wish_express": "False",
                  "warehouses": [
                    {
                      "WarehouseShipping": {
                        "price_type": "wish_express",
                        "price": "3.0",
                        "localized_price": "18.0",
                        "localized_currency_code": "CNY",
                        "warehouse_name": "EXPRESS-US",
                        "enabled": "True",
                        "use_product_shipping": "False",
                        "regional_shippings": [
                          {
                            "RegionalShipping": {
                              "state": "Alaska",
                              "use_country_shipping": "False",
                              "price": "None",
                              "localized_price": "None",
                              "localized_currency_code": "CNY",
                              "enabled": "False",
                              "state_code": "AK"
                          },
                        ]
                      }
                    },
                    {
                      "WarehouseShipping": {
                        "price_type": "normal",
                        "price": "None",
                        "localized_price": "",
                        "localized_currency_code": "CNY",
                        "warehouse_name": "STANDARD",
                        "enabled": "True",
                        "use_product_shipping": "True",
                        "regional_shippings": [
                          {
                            "RegionalShipping": {
                              "state": "Hawaii",
                              "use_country_shipping": "False",
                              "price": "5.0",
                              "localized_price": "30.0",
                              "localized_currency_code": "CNY",
                              "enabled": "True",
                              "state_code": "HI"
                          },
                        ]
                      }
                    }
                  ],
                  "enabled": "True",
                  "id": "111122223333444455556666",
                  "country_code": "US"
                }
              }
            ]
          }
        }
      }
    }
  ]
}

Get Merchant Shipping Settings

Retrieve merchant's shipping settings

HTTP Request Type: GET

Scope: products:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/product/get-shipping-setting

Explore API

Parameters

No parameters for this API

Response

Response will contain a list of 'CountryShippingSetting'.

country_code The 2 letter country code of the shipping price.
use_product_shipping 'True'/'False'. If 'True' then the product shipping price to the country is determined by the product variations. If 'False' then the product shipping price is the fixed value in the field shipping_price.
shipping_price The shipping price of the product to the country. This field could be a number to indicate a shipping price. It could also be the string "Use Product Shipping Price" to indicate that the shipping price to this country is determined by the product variations.
currency_code The currency the shipping_price is in, if the shipping price is a number.

Example

Assume your access token is "an_example_access_token". your parameters would be:

  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/get-shipping-setting -d "access_token=an_example_access_token"
<?php

$access_token = urlencode('an_example_access_token');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/get-shipping-setting?access_token=%s",
    $access_token);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->getShippingSetting();

?>

Example Response

{'code': 0,
 'data': {'ShippingSetting': {'country_settings': [
    {'CountryShippingSetting': {'country_code': 'AU',
      'shipping_price': '1.00',
      'use_product_shipping': 'False',
      'currency_code': 'USD'}},
    {'CountryShippingSetting': {'country_code': 'CA',
      'shipping_price': '2.00',
      'use_product_shipping': 'False',
      'currency_code': 'USD'}},
    {'CountryShippingSetting': {'country_code': 'GB',
      'shipping_price': '3.00',
      'use_product_shipping': 'False',
      'currency_code': 'USD'}},
    {'CountryShippingSetting': {'country_code': 'US',
      'shipping_price': 'Use Product Shipping Price',
      'use_product_shipping': 'True',
      'currency_code': 'N/A'}}],
   }},
 'message': ''}

Start a Batch Product Download

Call this to begin downloading a CSV file of your Products.

HTTP Request Type: POST

Scope: products:read

Definition
POST https://sandbox.merchant.wish.com/api/v2/product/create-download-job

Explore API

Parameters
sinceoptional The download will include Products last updated after this date.
Accepted formats: YYYY-MM-DD, YYYY-MM-DDTHH:MM:SS

To download all of your Products, do not provide the 'since' parameter.
limitoptional A limit on the number of Products that can be returned.
sortoptional The way the Products are sorted. By default, Products are sorted in descending order by product ID.
Accepted values: asc, desc
show_rejectedoptional If specified to 'true', this API will return all products including those inappropriate products that were rejected during review.
warehouse_nameoptional The product information will be for this warehouse. If not specified, the default warehouse product information is returned.

Returns
Returns the 'job_id' of your Product download. Check the status of your download via /product/get-download-job-status or cancel your download via /product/cancel-download-job.

Example #1

Assume your access token is "an_example_access_token". Suppose you want to download all of your Products:

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/create-download-job -d "access_token=an_example_access_token"

Example #2

Suppose you want to download a batch of Products with the following constraints:

  • since = 2016-07-01

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/create-download-job -d "since='2016-07-01'&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$since = '2016-07-01';
$client->productCreateDownloadJob('098765432112345678901234',$since);
<?php

$access_token = urlencode('an_example_access_token');

$since = urlencode('2016-07-01');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/create-download-job?access_token=%s&since=%s",
    $access_token, $since);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {'job_id': "57bb5803ba2a1f181de31b01"},
    'message': ''
}

Get the Status of Your Batch Product Download

Call this to get a progress update for your batch Product download.

HTTP Request Type: POST

Scope: products:read

Definition
POST https://sandbox.merchant.wish.com/api/v2/product/get-download-job-status

Explore API

Parameters
job_id The unique identifier you received from starting your batch Product download ( /product/create-download-job )

Returns
The API returns the current progress of the batch Product download you started with that 'job_id'.

If the CSV file is ready, a 'download_link' will be provided in the response. The link will expire 72 hours after the download becomes ready.

Example

Assume your access token is "an_example_access_token" . Suppose you want to check the progress of your batch Product download with job_id "57bb5803ba2a1f181de31b01":

  • job_id = 57bb5803ba2a1f181de31b01
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/get-download-job-status -d "job_id='57bb5803ba2a1f181de31b01'&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$job_id = '57bb5803ba2a1f181de31b01';
$client->productGetDownloadJobStatus('098765432112345678901234',$job_id);
<?php

$access_token = urlencode('an_example_access_token');

$job_id = urlencode('57bb5803ba2a1f181de31b01');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/change-shipping?access_token=%s&job_id=%s",
    $access_token, $job_id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {
    "status": "PENDING",
        "created_date": "2016-08-18 02:40:25.238000"
    },
    'message': ''
}

Example Response

{
    'code': 0,
    'data': {
        "status": "FINISHED",
        "total_count": 20553,
        "processed_count": 20553,
        "download_link": "https://merchant.wish.com/static/sweeper-production-merchant-export/52f64e7aab980a038d62d61e-57bce38526778a33b3f8c375-2016-08-16-19:27:01.csv",
        "created_date": "2016-08-18 02:40:25.238000",
        "start_run_time": "2016-08-18 03:12:07.135000",
        "end_run_time": "2016-08-18 02:49:28.798000",
    },
    'message': ''
}

Cancel Your Batch Product Download

Call this to cancel a batch Product download that is pending or running.

HTTP Request Type: POST

Scope: products:read

Definition
POST https://sandbox.merchant.wish.com/api/v2/product/cancel-download-job

Explore API

Parameters
job_id The unique identifier you received from starting your batch Product download ( /product/create-download-job )

Returns
The API will cancel your download and return a success message if your download is pending or currently running. If your CSV file is already ready or the download has already been cancelled, the API will provide you with an appropriate message accordingly.

Example

Assume your access token is "an_example_access_token" . Suppose you want to cancel your batch Product download with job_id = "57bb5803ba2a1f181de31b01":

  • job_id = 57bb5803ba2a1f181de31b01
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/product/cancel-download-job -d "job_id='57bb5803ba2a1f181de31b01'&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$job_id = '57bb5803ba2a1f181de31b01';
$client->productCancelDownloadJob('098765432112345678901234',$job_id);
<?php

$access_token = urlencode('an_example_access_token');

$job_id = urlencode('57bb5803ba2a1f181de31b01');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/product/cancel-download-job?access_token=%s&job_id=%s",
    $access_token, $job_id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {'message': 'Job cancelled successfully.'},
    'message': ''
}

Example Response

{
    'code': 0,
    'data': {'message': 'Job has already finished.'},
    'message': ''
}

Example Response

{
    'code': 0,
    'data': {'message': 'Job has already been cancelled.'},
    'message': ''
}

Product Variation

The product variation entity represents a SKU that is for sale. It has a price, shipping and possibly a size or color. Each product variation belongs to one product and each product has at least one product variation. A user always buys a product variation, and each SKU in your system will map to one product variation in Wish.



With this API you can create and update product variations. You can also retrieve details about specific product variations or page through all your product variations.

Attributes
idThe Wish Id of the product variation, a string of 24 characters
Product idThe Wish Id of the product this product variation belongs to, a 24 character string
skuThe unique identifier that your system uses to recognize this variant
colorWish's unique color identifier stored for the variant
color_nameThe human readable name of the color shown to customers when purchasing the variant
sizeThe size of the variation
inventoryThe physical quantities you have for this variation, max 500,000
priceThe price of the variation when the user purchases one. The price value will be returned as 999999 if you receive payments in a non-USD currency. Please use localized_price instead.
localized_priceThe price of the variation when the user purchases one. In your localized currency.
shippingThe shipping of the variation when the user purchases one. The shipping value will be returned as 999999 if you receive payments in a non-USD currency. Please use localized_shipping instead.
localized_shippingThe shipping of the variation when the user purchases one. In your localized currency.
localized_currency_codeYour localized currency code.
msrp Listings include a field for a comparison or reference price (“MSRP Field”). Merchants are not required to provide a value for the MSRP Field. If Merchants choose to provide a value for the MSRP Field (a “Reference Price”), each Reference Price must comply with the Product Reference Price Policy.
enabledWhether or not this product variation is enabled for purchase
removed_by_wishThe product variation has been removed / disabled by Wish because they have violated our Wish Merchant policies. These variations cannot be re-enabled.
shipping_time (DEPRECATED/UNUSED) The amount of time it takes for the shipment to reach the buyer
all_imagesUrl of all images of the product this product variation belongs to, separated by the character '|'
main_imageThe variant image which defaults to product.main_image if not set and will not be shown in the response of api/v2/product under Variant.
quantity_valueoptional The value of the total quantity of the variant in the given unit.

Create a Product Variation

To add a new variation to a product you can create a product variation. For example, a product has sizes Large and Extra-Large and you wanted to add size Medium, you would create a new product variation with this API. If the default shipping price is set, it will be used as the shipping price for the new variation. Otherwise, the highest active variation shipping price will be used. The number of variations of a product must not exceed 400.

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/variant/add

Explore API

Parameters
parent_skuThe parent_sku of the product this new product variation should be added to. If the product is missing a parent_sku, then this should be the SKU of a product variation of the product
skuThe unique identifier that your system uses to recognize this variation
color optional The color of the variation. Example: red, blue, green. Note: color and size cannot both be empty. The color and size pair should not be repetitive.
size optional The size of the variation. Example: Large, Medium, Small, 5, 6, 7.5 Note: color and size cannot both be empty. The color and size pair should not be repetitive.
inventoryThe physical quantities you have for this variation, max 500,000
price The price of the variation when the user purchases one, max 100,000
localized_price optional The price of the variation in the merchant's local currency.
localized_currency_code optional The merchant's localized currency code. This must be provided in order to set localized pricing fields.
msrpoptional Listings include a field for a comparison or reference price (“MSRP Field”). Merchants are not required to provide a value for the MSRP Field. If Merchants choose to provide a value for the MSRP Field (a “Reference Price”), each Reference Price must comply with the Product Reference Price Policy.
localized_msrpoptional Listings include a field for a comparison or reference price (“MSRP Field”) in the merchant's local currency. Merchants are not required to provide a value for the MSRP Field. If Merchants choose to provide a value for the MSRP Field (a “Reference Price”), each Reference Price must comply with the Product Reference Price Policy.
shipping_timeoptional (DEPRECATED/UNUSED) The amount of time it takes for the shipment to reach the buyer. Please also factor in the time it will take to fulfill and ship the item. Provide a time range in number of days. Lower bound cannot be less than 2 days. Example: 15-20
main_imageoptional URL of a photo for this product variation. Provide this when you have different pictures for different variations of the product. If left out, the variation will use the main_image of the product with the provided parent_sku. Link directly to the image, not the page where it is located. We accept JPEG, PNG or GIF format. Images should be at least 100 x 100 pixels in size. It may take up to 1 hour for the image to be updated.
length optional The length of your product that will be packaged to ship to customer (Units in cm)
  • Acceptable: 10
width optional The width of your product that will be packaged to ship to customer (Units in cm)
  • Acceptable: 13.40
height optional The height of your product that will be packaged to ship to customer (Units in cm)
  • Acceptable: 13.40
weight optional The weight of your product that will be packaged to ship to customer (Units in g)
  • Acceptable: 151.5
  • Acceptable: 10
declared_name optional Product name for logistics declaration
  • Acceptable: Repair Tools Kit Set
  • Acceptable: Rings
  • Unacceptable: !Rings
  • Unacceptable: T
  • Unacceptable: Good 衬衫
  • Unacceptable: Name that is longer than 200 characters
declared_local_name optional Product name written in local language for logistics declaration
  • Acceptable: 棉质外套
  • Unacceptable: !棉质外套
  • Unacceptable: 棉
  • Unacceptable: Name that is longer than 200 characters
pieces optional The amount of pieces associated with this item
  • Acceptable: 2
  • Acceptable: 1
  • Unacceptable: -1
declared_value optional The price of your product that will be declared to custom.
  • Acceptable: $100.99
  • Acceptable: 10.99
  • Unacceptable: $49.99 + S/H
hscode optional Harmonization System Code used for custom declaration.
  • Acceptable: 33021010.00
  • Acceptable: 6403.20
  • Unacceptable: 2
  • Unacceptable: a
origin_country optional country where product is manufactured. Country code should follow ISO 3166 Alpha-2 code. Example:CN, US
  • Acceptable: CN
  • Acceptable: US
  • Unacceptable: China
has_powder optional Whether product contains powder. Example: true, false.
  • Acceptable: True
  • Acceptable: False
  • Unacceptable: 0
  • Unacceptable: Yes
has_liquid optional Whether product contains liquid. Example: true, false.
  • Acceptable: True
  • Acceptable: False
  • Unacceptable: 0
  • Unacceptable: Yes
has_battery optional Whether product contains battery. Example: true, false.
  • Acceptable: True
  • Acceptable: False
  • Unacceptable: 0
  • Unacceptable: Yes
has_metal optional Whether product contains metal. Example: true, false.
  • Acceptable: True
  • Acceptable: False
  • Unacceptable: 0
  • Unacceptable: Yes
quantity_valueoptional The total quantity of the product variant (in the given unit) that is used to calculate price per unit. Note that if a product has multiple product variants, you will need to set quantity values for each product variant. Learn More.

Returns
If the request was successful and a Variant was added to the supplied Product, then the response will contain the variant created along with its Wish identifier.

Example

Assume your access token is "an_example_access_token" . If you have a product with a parent sku red-shoe and you would like to add a variant for the size 12, with sku red-shoe-12, your parameters would be:

  • parent_sku = red-shoe
  • sku = red-shoe-12
  • inventory = 10
  • price = 10
  • localized_price = 60
  • localized_currency_code = CNY
  • access_token = an_example_access_token
  • size = 12

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/variant/add -d "parent_sku=red-shoe&sku=red-shoe-12&inventory=10&price=10&size=12&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$product_var = array(
    'parent_sku'=>'red-shoe',
    'color'=>'red',
    'condition'=>'NEW',
    'sku'=>'red-shoe-12',
    'inventory'=>10,
    'size'=>12,
        'price'=>10,
    'shipping'=>3,
    'localized_price'=>60,
    'localized_shipping'=>18,
$var = $client->createProductVariaiton($product_var);
print_r($var);
<?php

$access_token = urlencode('an_example_access_token');

$parent_sku = urlencode('red-shoe');
$sku = urlencode('red-shoe-12');
$inventory = urlencode('10');
    $price = urlencode('10');
    $shipping = urlencode('3');
    $localized_price = urlencode('60'),
    $localized_shipping = urlencode('18'),
$size = urlencode('12');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant/add?access_token=%s&sku=%s&inventory=%s&price=%s&shipping=%s&localized_price=%s&localized_shipping=%s&size=%s&parent_sku=%s",
    $access_token, $sku, $inventory, $price, $shipping, $localized_cost, $localized_shipping_cost, $size, $parent_sku);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{'code': 0,
 'data': {'Variant': {'enabled': 'True',
                      'id': '529e6c2cf94aaa0cfe02846f',
                      'inventory': '10',
                      'size': '12',
                      'sku': 'red-shoe-12',
                                                  'price': '10',
                      'shipping': '3',
                      'localized_price': '60',
                      'localized_shipping': '18'
                      'localized_currency_code': 'CNY' }}
'msg' : '',
}

Retrieve a Product Variation

Retrieves the details of an existing product variation. Provide the SKU of the product variation and Wish will return details about the corresponding product variation.

HTTP Request Type: GET

Scope: products:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/variant

Explore API

Parameters
skuThe unique identifier of the item in your system.
warehouse_nameoptional The warehouse from where the variant shipping and inventory are fetched. If not specified, default warehouse shipping and inventory are used.

Returns
For successful requests the response will contain a Variant object in the requested format.
Notice: If normal shipping is not set for the variant, shipping column will be null in JSON, and left blank in XML.

Example

Assume your access token is "an_example_access_token" . If your store has an item with sku "red-shoe-8" and you would like to know its state on with your request's parameters would be:

  • sku = red-shoe-8
  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/variant?sku=red-shoe-8&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');

$var = $client->getProductVariationBySKU('red-shoe-8');
print_r($var);
<?php

$access_token = urlencode('an_example_access_token');

$sku = urlencode('red-shoe-8');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant?access_token=%s&sku=%s",
    $access_token, $sku);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{'code': 0,
 'data': {'Variant': {'enabled': 'True',
                      'id': '51e0a2c61111a236cfffe3a2',
                      'product_id' : '51e0a2c61111axxxcfffeyyy',
                      'inventory': '10100',
                      'msrp': '21100.0',
                      'price': '100.0',
                      'shipping': '10.0',
                                            'localized_price': '60',
                      'localized_shipping': '18',
                      'localized_currency_code': 'CNY',
                      'sku': 'red-shoe-8'}},
'message': ''}

Update a Product Variation

Updates the specified variation by updating the attributes of the parameters passed in the request. Any attribute not provided will be left unchanged.

This request can only update attributes specific to variations and cannot be used to update any attribute of a Product.

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/variant/update

Explore API

Parameters
skuThe unique identifier for the variation you would like to update
inventoryoptional The physical quantities you have for this variation, max 500,000
price optional The price of the variation when the user purchases one, max 100,000
localized_priceoptional The price of the variation in the merchant's local currency. This is required for non-USD merchants. If updating price, the localized_price must be provided as well.
localized_currency_codeoptional The merchant's localized currency code. This must be provided in order to set localized pricing fields.
enabledoptional True if the variation is for sale, False if you need to halt sales.
sizeoptional The size of the variation. Example: Large, Medium, Small, 5, 6, 7.5
coloroptional The color of the variation. Example: red, blue, green
msrpoptional Listings include a field for a comparison or reference price (“MSRP Field”). Merchants are not required to provide a value for the MSRP Field. If Merchants choose to provide a value for the MSRP Field (a “Reference Price”), each Reference Price must comply with the Product Reference Price Policy.
localized_msrpoptional Listings include a field for a comparison or reference price (“MSRP Field”) in the merchant's local currency. Merchants are not required to provide a value for the MSRP Field. If Merchants choose to provide a value for the MSRP Field (a “Reference Price”), each Reference Price must comply with the Product Reference Price Policy.
shipping_timeoptional (DEPRECATED/UNUSED) The amount of time it takes for the shipment to reach the buyer. Please also factor in the time it will take to fulfill and ship the item. Provide a time range in number of days. Lower bound cannot be less than 2 days. Example: 5-10
main_imageoptional URL of a photo for this product variation. Provide this when you have different pictures for different variations of the product. Link directly to the image, not the page where it is located. We accept JPEG, PNG or GIF format. Images should be at least 100 x 100 pixels in size. It may take up to 1 hour for the image to be updated.
update_product_imageoptional If True, the main_image you pass will be used to update the product's main image and the images of all other variations that use the product's main image. If False, only this variation's main image will be changed. Default to True if not supplied
warehouse_nameoptional The name of the warehouse on which the action will be performed. If the warehouse name is not provided, only the shipping price and inventory, if provided, will be applied to the STANDARD warehouse. The price, size, color, and MSRP are set to the product regardless of the warehouse.
length optional The length of your product that will be packaged to ship to customer (Units in cm)
  • Acceptable: 10
width optional The width of your product that will be packaged to ship to customer (Units in cm)
  • Acceptable: 13.40
height optional The height of your product that will be packaged to ship to customer (Units in cm)
  • Acceptable: 13.40
weight optional The weight of your product that will be packaged to ship to customer (Units in g)
  • Acceptable: 151.5
  • Acceptable: 10
declared_name optional Product name for logistics declaration
  • Acceptable: Repair Tools Kit Set
  • Acceptable: Rings
  • Unacceptable: !Rings
  • Unacceptable: T
  • Unacceptable: Good 衬衫
  • Unacceptable: Name that is longer than 200 characters
declared_local_name optional Product name written in local language for logistics declaration
  • Acceptable: 棉质外套
  • Unacceptable: !棉质外套
  • Unacceptable: 棉
  • Unacceptable: Name that is longer than 200 characters
pieces optional The amount of pieces associated with this item
  • Acceptable: 2
  • Acceptable: 1
  • Unacceptable: -1
declared_value optional The price of your product that will be declared to custom.
  • Acceptable: $100.99
  • Acceptable: 10.99
  • Unacceptable: $49.99 + S/H
hscode optional Harmonization System Code used for custom declaration.
  • Acceptable: 33021010.00
  • Acceptable: 6403.20
  • Unacceptable: 2
  • Unacceptable: a
origin_country optional country where product is manufactured. Country code should follow ISO 3166 Alpha-2 code. Example:CN, US
  • Acceptable: CN
  • Acceptable: US
  • Unacceptable: China
has_powder optional Whether product contains powder. Example: true, false.
  • Acceptable: True
  • Acceptable: False
  • Unacceptable: 0
  • Unacceptable: Yes
has_liquid optional Whether product contains liquid. Example: true, false.
  • Acceptable: True
  • Acceptable: False
  • Unacceptable: 0
  • Unacceptable: Yes
has_battery optional Whether product contains battery. Example: true, false.
  • Acceptable: True
  • Acceptable: False
  • Unacceptable: 0
  • Unacceptable: Yes
has_metal optional Whether product contains metal. Example: true, false.
  • Acceptable: True
  • Acceptable: False
  • Unacceptable: 0
  • Unacceptable: Yes
quantity_valueoptional The total quantity of the product variant (in the given unit) that is used to calculate price per unit. Note that if a product has multiple product variants, you will need to set quantity values for each product variant. Learn More.

Returns
If the request was successful the API will return an HTTP status code of 200 and a status code of 0.

Example

Assume your access token is "an_example_access_token" . If you have an item with the SKU 'blue-shoe-11' and it has the wrong size and you need to update its price, shipping and inventory your parameters would be:

  • sku = blue-shoe-11
  • price = 10.11
  • localized_price = 60
  • localized_currency_code = CNY
  • inventory = 1000
  • access_token = an_example_access_token

Lets say you didn't need to update price, then you would omit this parameter from your request.

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/variant/update -d "sku=blue-shoe-11&price=10.11&localized_price=60&localized_currency_code=CNY&inventory=1000&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');

$var = $client->getProductVariationBySKU('blue-shoe-11');
$var->inventory = 1000;
$var->price = 10.11;
$var->shipping = 10;
$var->localized_price = 60;
$var->localized_shipping = 60;
$var->localized_currency_code = CNY
$client->updateProductVariation($var);
<?php

$access_token = urlencode('an_example_access_token');

$sku = urlencode('blue-shoe-11');
$inventory = urlencode('1000');
$price = urlencode('10.11');
$shipping = urlencode('10.00');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant/update?access_token=%s&sku=%s&inventory=%s&price=%s&shipping=%s&localized_price=%s&localized_shipping=%s&localized_currency_code=%s",
    $access_token, $sku, $inventory, $price, $shipping, $localized_price, $localized_shipping, $localized_currency_code);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {},
    'message': ''
}

Change a Product Variation's SKU

Change a variation's unique identifier, the new identifier must also be unique within all SKUs of the merchant

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/variant/change-sku

Explore API

Parameters
skuThe unique identifier for the variation you would like to change
new_skuThe new unique identifier for the variation you would like to change to

Returns
If the request was successful the API will return an HTTP status code of 200 and a status code of 0.

Example

Assume your access token is "an_example_access_token" . If you have an item with the SKU 'blue-shoe-11' and you would like to change it to 'blue-shoe-12' your parameters would be:

  • sku = blue-shoe-11
  • new_sku = blue-shoe-12
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/variant/change-sku -d "sku=blue-shoe-11&new_sku=blue-shoe-12&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->changeProductVariationSKU('blue-shoe-11', 'blue-shoe-12');
<?php

$access_token = urlencode('an_example_access_token');

$sku = urlencode('blue-shoe-11');
$new_sku = urlencode('blue-shoe-12');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant/change-sku?access_token=%s&sku=%s&new_sku=%s",
    $access_token, $sku, $new_sku);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {},
    'message': ''
}

Enable a Product Variation

Enable a product variation. This marks the product variation available for sale.

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/variant/enable

Explore API

Parameters
skuThe unique identifier for the item you would like to update

Returns
If the request was successful the API will return an HTTP status code of 200 and a status code of 0.

Example

Assume your access token is "an_example_access_token" . If you have an item with the SKU 'blue-shoe-11' and you want to enable it, your parameters would be:

  • sku = blue-shoe-11
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/variant/enable -d "sku=blue-shoe-11&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->enableProductVariationBySKU('blue-shoe-11');
<?php

$access_token = urlencode('an_example_access_token');

$sku = urlencode('blue-shoe-11');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant/enable?access_token=%s&sku=%s",
    $access_token, $sku);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {},
    'message': ''
}

Disable a Product Variation

Disable a product variation. This marks the product variation unavailable for sale.

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/variant/disable

Explore API

Parameters
skuThe unique identifier for the item you would like to update

Returns
If the request was successful the API will return an HTTP status code of 200 and a status code of 0.

Example

Assume your access token is "an_example_access_token" . If you have an item with the SKU 'blue-shoe-11' and you want to disable it, your parameters would be:

  • sku = blue-shoe-11
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/variant/disable -d "sku=blue-shoe-11&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->disableProductVariationBySKU('blue-shoe-11');
<?php

$access_token = urlencode('an_example_access_token');

$sku = urlencode('blue-shoe-11');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant/disable?access_token=%s&sku=%s",
    $access_token, $sku);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {},
    'message': ''
}

Update Inventory

Update inventory for a product variation.

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/variant/update-inventory

Explore API

Parameters
skuThe unique identifier for the item you would like to update
inventoryThe physical number of items you have, max 500,000
warehouse_nameThe name of the warehouse on which the action will be performed. If the warehouse name is not provided, the inventory will be applied to the STANDARD warehouse.

Returns
If the request was successful the API will return an HTTP status code of 200 and a status code of 0.

Example

Assume your access token is "an_example_access_token" . If you have an item with the SKU 'blue-shoe-11' and you want to update the inventory to 100, your parameters would be:

  • sku = blue-shoe-11
  • access_token = an_example_access_token
  • inventory = 100

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/variant/update-inventory -d "sku=blue-shoe-11&inventory=100&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->updateProductInventoryBySKU('blue-shoe-11',100);
<?php

$access_token = urlencode('an_example_access_token');

$sku = urlencode('blue-shoe-11');
$inventory = urlencode('100');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant/update-inventory?access_token=%s&sku=%s&inventory=%s",
    $access_token, $sku, $inventory);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {},
    'message': ''
}

List all Product Variations

Returns a list of all your product variations currently on the Wish platform. This API is useful to paginate through all the SKUs that you have uploaded to Wish. If the number of results is too large the full result set may require pagination.

HTTP Request Type: GET

Scope: products:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/variant/multi-get

Explore API

Parameters
startoptional An offset into the list of returned items. Use 0 to start at the beginning. The API will return the requested number of items starting at this offset. Default to 0 if not supplied
limitA limit on the number of products that can be returned. Limit can range from 1 to 500 items and the default is 50
warehouse_nameoptional The warehouse from where the variants' shippings and inventories are fetched. If not specified, default warehouse variation shippings and inventories are used.

Returns
For successful requests the response data will contain a list of product variation objects. If the response requires pagination the 'paging' field will contain the URL for the next page of results.

Example

Assume your access token is "an_example_access_token" . If you would like to fetch information about all your items in groups of 2 and you would like to see the 10th group:

  • start = 20
  • limit = 2
  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/variant/multi-get?limit=2&start=20&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$variations = $client->getAllProductVariations();
echo "You have ".count($variations)." product variations!\n";
<?php

$access_token = urlencode('an_example_access_token');

$start = urlencode('20');
$limit = urlencode('2');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant/multi-get?access_token=%s&start=%s&limit=%s",
    $access_token, $start, $limit);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

Example Response
{'code': 0,
 'data': [{'Variant': {'enabled': 'True',
                       'id': '5215451b31111f73ff2xxxxxx',
                       'product_id' : '51e0a2c61111axxxcfffeyyy',
                       'inventory': '1314',
                       'msrp': '150.0',
                       'price': '100.0',
                       'shipping': '21.0',
                                              'localized_price': '600.0',
                       'localized_shipping': '126.0',
                       'localized_currency_code': 'CNY',
                       'sku': 'MMM'}},
            {'Variant': {'color': 'blue',
                       'enabled': 'True',
                       'id': '5214c1111c238837cdiiiiii',
                       'product_id' : '51e0a2c61111axxxcfffeyyy',
                       'inventory': '917',
                       'msrp': '100.0',
                       'price': '50.0',
                       'shipping': '9.81',
                       'localized_price': '300.0',
                       'localized_shipping': '60.0',
                       'localized_currency_code': 'CNY',
                       'sku': 'DD1111'}}],
'message': '',
'paging': {'next': 'https://sandbox.merchant.wish.com/api/v2/variant/multi-get?start=22&limit=2&access_token=an_example_access_token',
'previous': 'https://sandbox.merchant.wish.com/api/v2/variant/multi-get?start=18&limit=2&access_token=an_example_access_token'}}

Bulk Update Product Variations

Bulk update up to 100,000 existing product variations. You can use this API to update inventory, disable or enable product variations in a batch. This API is non-blocking, a job_id will be returned. Use Get Job Status of Variation Bulk Update to get the current status of the job. Once the job is completed, use the following APIs to get the results: Get Successfully Updated SKUs from Variation Bulk Update, Get Errors from Variation Bulk Update. Use Cancel Bulk Update Product Variations Job to cancel a running job.

HTTP Request Type: POST

Scope: products:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/variant/bulk-sku-update

Explore API

Parameters
updatesA json array of SKU objects. Each SKU object must have attribute sku as the unique identifier of a variation. Use the attribute inventory to update the inventory of a variation, and attribute enabled to enable or disable a variation.
warehouse_name The warehouse to apply the inventory updates to. If not provided, the inventory change will apply to the STANDARD warehouse. The enabled attributes above will be applied to all warehouses; this parameter will only impact inventory updates.

Returns
A job_id will be returned if request is successful.

Example

Assume your access token is "an_example_access_token". If you would like to update the inventory of SKU "aaa" to 10, and disable SKU "bbb":

  • updates=[{"sku":"aaa","inventory":10},{"sku":"bbb","enabled":false}]
  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2//api/v2/variant/bulk-sku-update -d "access_token=an_example_access_token&format=json&updates=[{"sku":"aaa","inventory":10},{"sku":"bbb","enabled":false}]"
    Not supported in SDK yet.
<?php

$access_token = urlencode('an_example_access_token');

$updates = urlencode('[{"sku":"aaa","inventory":10},{"sku":"bbb","enabled":false}]');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant/bulk-sku-update?access_token=%s&updates=%s",
    $access_token, $updates);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

Example Response
{
  "message": "",
  "code": 0,
  "data": {
    "job_id": "59e15a939a64f71c5024a1e3"
  }
}

Get Job Status of Variation Bulk Updates

Call this to get the current state and progress for your Product Variations bulk update.

HTTP Request Type: GET

Scope: products:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/variant/get-bulk-update-job-status

Explore API

Parameters
job_id The unique identifier you received from bulk update production variations (/variant/bulk-sku-update)

Returns
The status of the specified bulk update job and current number of processed items, as well as the number of successes and failures.

Example

Assume your access token is "an_example_access_token". Suppose you want to check the status of your bulk update for product variations with job_id "59e00339b2d5b8367ac3e8bd":

  • job_id = 59e00339b2d5b8367ac3e8bd
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/variant/get-bulk-update-job-status -d "job_id='59e00339b2d5b8367ac3e8bd'&access_token=an_example_access_token"
    Not supported in SDK yet.
<?php

$access_token = urlencode('an_example_access_token');

$job_id = urlencode('59e00339b2d5b8367ac3e8bd');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant/get-bulk-update-job-status?access_token=%s&job_id=%s",
    $access_token, $job_id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
  "message": "",
  "code": 0,
  "data": {
    "status": 4,
    "state": "FINISHED",
    "merchant_id": "515a29092f533b2778a7f625",
    "success_count": 10
    "end_time": 2017-10-17T05:48:21,
    "failure_count": 10,
    "start_time": "2017-10-17T05:46:51",
    "processed_count": 20,
    "results": {
        "successes": "https://merchant.wish.com/api/v2/variant/get-bulk-update-job-successes?job_id=59e00339b2d5b8367ac3e8bd"
        "failures": "https://merchant.wish.com/api/v2/variant/get-bulk-update-job-failures?job_id=59e00339b2d5b8367ac3e8bd"
    }
    "id": "59e5994b9a64f72cafea7730",
    "uploader_id": "5ae5923b9a64f72cab4a772a"
  }
}

Get Successfully Updated SKUs from Variation Bulk Updates

Call this to get a list of all SKUs that were successfully updated from your Product Variations bulk update.

HTTP Request Type: GET

Scope: products:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/variant/get-bulk-update-job-successes

Explore API

Parameters
job_id The unique identifier you received from bulk update production variations (/variant/bulk-sku-update)
startoptional An offset into the list of returned items. Use 0 to start at the beginning. The API will return the requested number of items starting at this offset. Default to 0 if not supplied
limitoptional A limit on the number of items that can be returned. Limit can range from 1 to 250 items and the default is 50

Returns
A list of successfully updated SKUs. If the response requires pagination the 'paging' field will contain the URL for the next page of results.

Example

Assume your access token is "an_example_access_token". Suppose you want to check the first 5 SKUs from your bulk update for product variations with job_id "59e00339b2d5b8367ac3e8bd" that were updated successfully:

  • job_id = 59e00339b2d5b8367ac3e8bd
  • access_token = an_example_access_token
  • limit = 5

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/variant/get-bulk-update-job-successes -d "job_id='59e00339b2d5b8367ac3e8bd'&access_token=an_example_access_token&limit='5'"
    Not supported in SDK yet.
<?php

$access_token = urlencode('an_example_access_token');

$job_id = urlencode('59e00339b2d5b8367ac3e8bd');

$limit = urlencode('5');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant/get-bulk-update-job-successes?access_token=%s&job_id=%s&limit=%s",
    $access_token, $job_id, $limit);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
  "message": "",
  "code": 0,
  "data": {
    "successes": [
      "SKU1",
      "SKU2",
      "SKU3",
      "SKU4",
      "SKU5"
    ]
  },
  "paging": {
    "next": "https://merchant.wish.com/api/v2/variant/get-bulk-update-job-successes?start=5&limit=5"
  }
}

Get Errors from Variation Bulk Updates

Call this to get a list of all errors encountered from your Product Variations bulk update.

HTTP Request Type: GET

Scope: products:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/variant/get-bulk-update-job-failures

Explore API

Parameters
job_id The unique identifier you received from bulk update production variations (/variant/bulk-sku-update)
startoptional An offset into the list of returned items. Use 0 to start at the beginning. The API will return the requested number of items starting at this offset. Default to 0 if not supplied
limitoptional A limit on the number of items that can be returned. Limit can range from 1 to 250 items and the default is 50

Returns
A list of errors. If the response requires pagination the 'paging' field will contain the URL for the next page of results.

Example

Assume your access token is "an_example_access_token". Suppose you want to check the first 3 errors that were raised from your bulk update for product variations with job_id "59e00339b2d5b8367ac3e8bd":

  • job_id = 59e00339b2d5b8367ac3e8bd
  • access_token = an_example_access_token
  • limit = 3

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/variant/get-bulk-update-job-failures -d "job_id='59e00339b2d5b8367ac3e8bd'&access_token=an_example_access_token&limit='3'"
    Not supported in SDK yet.
<?php

$access_token = urlencode('an_example_access_token');

$job_id = urlencode('59e00339b2d5b8367ac3e8bd');

$limit = urlencode('3');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant/get-bulk-update-job-failures?access_token=%s&job_id=%s&limit=%s",
    $access_token, $job_id, $limit);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
  "message": "",
  "code": 0,
  "data": {
    "errors": [
      {
        "sku": "fake_sku1",
        "error_code": 29,
        "error": "Your store does not have product with SKU 'fake_sku1', therefore no update can be done."
      },
      {
        "sku": "fake_sku2",
        "error_code": 29,
        "error": "Your store does not have product with SKU 'fake_sku2', therefore no update can be done."
      },
      {
        "sku": "fake_sku3",
        "error_code": 29,
        "error": "Your store does not have product with SKU 'fake_sku3', therefore no update can be done."
      }
    ]
  },
  "paging": {
    "next": "https://merchant.wish.com/api/v2/variant/get-bulk-update-job-failures?start=3&limit=3"
  }
}

Cancel Bulk Product Variations Update Job

Call this to cancel a previously submitted bulk product variations update job. Note that the job may have partially completed and that cancelling the job does not undo any changes.

HTTP Request Type: POST

Scope: products:read

Definition
POST https://sandbox.merchant.wish.com/api/v2/variant/cancel-bulk-update-job

Explore API

Parameters
job_id The unique identifier you received from bulk update production variations (/variant/bulk-sku-update)

Returns
Whether the job was successfully cancelled.

Example

Assume your access token is "an_example_access_token". Suppose you want to cancel your bulk update for product variations with job_id "59e00339b2d5b8367ac3e8bd":

  • job_id = 59e00339b2d5b8367ac3e8bd
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/variant/cancel-bulk-update-job -d "job_id='59e00339b2d5b8367ac3e8bd'&access_token=an_example_access_token"
    Not supported in SDK yet.
<?php

$access_token = urlencode('an_example_access_token');

$job_id = urlencode('59e00339b2d5b8367ac3e8bd');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/variant/cancel-bulk-update-job?access_token=%s&job_id=%s",
    $access_token, $job_id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
  "message": "",
  "code": 0,
  "data": {
    "message": "Job cancelled successfully.",
  }
}

Fulfillment

Interface for merchants to fulfill consumer orders.

Accepted Shipping Providers

This fetches all accepted shipping providers.

HTTP Request Type: GET

Definition
GET https://sandbox.merchant.wish.com/api/v2/fulfillment/get-shipping-carriers

Explore API

Parameters None

Returns
Response will contain an alphabetized list of all accepted shipping providers.

Here is the full list of accepted providers on Wish:

ABF
APCPostalLogistics
AirpakExpress
AmazonMCFUK
AmazonMCFUS
Aramex
AsendiaGermany
AsendiaHK
AsendiaUK
AsendiaUSA
AuPostChina
AustraliaPost
AustrianPost
AustrianPostRegistered
B2CEurope
BPost
BPostInternational
BRTBartolini
Belpost
BlueCareExpress
BrazilCorreios
Bring
Cacesa
CanadaPost
Celeritas
CelloSquare
CeskaPosta
Ceva
ColisPrive
Colissimo
CorreosChile
CorreosCostaRica
CorreosDeEspana
CorreosDeMexico
CorreosExpress
CroatianPost
CyprusPost
DBSchenkerSweden
DHL
DHL2MannHandling
DHLBenelux
DHLFreightSweden
DHLGermany
DHLGlobalMailAsia
DHLLTL
DHLNetherlands
DHLParcelNL
DHLParcelUK
DHLPoland
DHLSpainDomestic
DHLeCommerce
DPD
DPDFrance
DPDGermany
DPDIreland
DPDPoland
DPDUK
DPEXChina
DXDelivery
DanmarkPost
DeutschePost
DirectLink
EFS
ELTAHellenicPost
EMPSExpress
EMS (China)
EPostG
ETOMARS
Envialia
Estafeta
Estes
FastwayAustralia
FastwayIreland
FedEx
FedExApex
FedExUK
Freipost
FreteRapido
GLS
GLSItaly
GLSNetherlands
GlobegisticsInc
Hermes
HermesGermany
HongKongPost
IML
IndiaPost
IndiaPostInternational
IndonesiaPost
Intelipost
IsraelPost
ItalySDA
JanioAsia
JapanPost
KoreaPost
KoreaPostDomestic
LaPosteColissimo
LandmarkGlobal
LaserShip
LatviaPost
LithuaniaPost
LoneStarOvernight
MagyarPosta
MalaysiaPost
MalaysiaPostPosDaftar
MexicoRedpack
MexicoSendaExpress
MyHermesUK
NewZealandPost
Newgistics
Nexive
OnTrac
OneWorldExpress
PTSWorldwideExpress
PTTPosta
Palletways
PaquetExpress
ParcelForce
Pilot
PocztaPolska
PortugalCTT
PostNL
PostNLInternational
PostNLInternational3S
PostNord
PosteItaliane
PostenNorge
Qxpress
RLCarriers
RRDonnelley
RoyalMail
RussianPost
SFExpress
Sagawa
Saia
SekoLogistics
Sending
SequoiaLog
SimplyPost
SingaporeSpeedpost
SoutheasternFreightLines
Spring
SprintPack
SwedenPosten
SwissPost
TNT
TNTAustralia
TNTClickItaly
TNTFrance
TNTItaly
TNTPostItaly
TNTUK
TaiwanPost
Test_Delhivery
Test_WishPostDHL
Test_WishPostFedEx
Test_WishPostTNT
Test_WishPostUPS
TollIPEC
TollPriority
TrakPak
TransMission
TurkishPost
UDS
UPS
UPSFreight
UPSMailInnovations
UPSSurePost
USPS
UkrPoshta
VietnamPostEMS
WishPost
XPO
YODEL
YRC
Yamato
YodelInternational
Zeleris
Zinc

Example

Assume your access token is "an_example_access_token":

  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/fulfillment/get-shipping-carriers -d "access_token=an_example_access_token"
<?php

$access_token = urlencode('an_example_access_token');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/fulfillment/get-shipping-carriers?access_token=%s",
    $access_token, $image);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    "message":"",
    "code":0,
    "data":{
        "shipping_carriers":["4PX",
                            "ABF",
                            "AirpakExpress",
                            "AnjunExpress",
                            "Aramex",
                            "AsendiaGermany",
                            "AsendiaUK",
                            "AsendiaUSA",
                            "AuPostChina",
                            "AustraliaPost",
                            "AustrianPost",
                            "AustrianPostRegistered",
                            "BPost",
                            "BPostInternational",
                            "Belpost",
                            "CNEExpress",
                            "CanadaPost",
                            "ChinaAirPost",
                            "ColisPrive",
                            "Colissimo",
                            "CorreosDeEspana",
                            "CorreosExpress",
                            "CroatianPost",
                            "DHL",
                            "DHL2MannHandling",
                            "DHLBenelux",
                            "DHLGermany",
                            "DHLGlobalMail",
                            "DHLGlobalMailAsia",
                            "DHLNetherlands",
                            "DHLParcelNL",
                            "DHLPoland",
                            "DHLSpainDomestic",
                            "DPD",
                            "DPDFrance",
                            "DPDGermany",
                            "DPDIreland",
                            "DPDPoland",
                            "DPDUK",
                            "DPEXChina",
                            "DanmarkPost",
                            "DeutschePost",
                            "DirectLink",
                            "ECFirstClass",
                            "EMPSExpress",
                            "EMS",
                            "EPacket",
                            "Envialia",
                            "FedEx",
                            "FedExApex",
                            "FedExUK",
                            "GLS",
                            "GLSItaly",
                            "GLSNetherlands",
                            "GlobegisticsInc",
                            "Hermes",
                            "HermesGermany",
                            "HongKongPost",
                            "IndiaPost",
                            "IndiaPostInternational",
                            "IndonesiaPost",
                            "IsraelPost",
                            "ItalySDA",
                            "JapanPost",
                            "KoreaPost",
                            "LandmarkGlobal",
                            "LaoPost",
                            "LaPosteColissimo",
                            "LithuaniaPost",
                            "MagyarPosta",
                            "MalaysiaPost",
                            "MalaysiaPostPosDaftar",
                            "NewZealandPost",
                            "Nexive",
                            "OnTrac",
                            "OneWorldExpress",
                            "ParcelForce",
                            "PTTPosta",
                            "PocztaPolska",
                            "PosteItaliane",
                            "PostNL",
                            "PostNLInternational",
                            "PostNLInternational3S",
                            "RoyalMail",
                            "RussianPost",
                            "SFExpress",
                            "SimplyPost",
                            "SingaporePost",
                            "SingaporeSpeedpost",
                            "SwedenPosten",
                            "SwissPost",
                            "TNT",
                            "TNTAustralia",
                            "TNTClickItaly",
                            "TNTFrance",
                            "TNTItaly",
                            "TNTPostItaly",
                            "TNTUK",
                            "TaiwanPost",
                            "ThailandThaiPost",
                            "TollIPEC",
                            "TollPriority",
                            "TrakPak",
                            "TransMission",
                            "TurkishPost",
                            "UBISmartParcel",
                            "DHLParcelUK",
                            "UPS",
                            "UPSFreight",
                            "UPSMailInnovations",
                            "USPS",
                            "VietnamPostEMS",
                            "WeDoLogisitics",
                            "WishPost",
                            "YODEL",
                            "YodelInternational",
                            "YRC",
                            "YunExpress"
                            ]
    }
}

Get Countries that Require Confirmed Delivery

Get a list of country codes for countries that require Confirmed Delivery for the Confirmed Delivery Policy.

For more information about the Confirmed Delivery Policy, click here.

HTTP Request Type: POST

Scope: orders:read

Definition
POST https://sandbox.merchant.wish.com/api/v2/fulfillment/get-confirmed-delivery-countries

Explore API

Parameters None

Returns
Returns a list of country codes for countries that require Confirmed Delivery.

Example

Assume your access token is "an_example_access_token". Suppose you want a list of shipping carriers that provide Delivery Confirmation to the US:

  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/fulfillment/get-confirmed-delivery-countries -d "access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->orderGetConfirmedDeliveryCountries('098765432112345678901234');
<?php

$access_token = urlencode('an_example_access_token');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/fulfillment/get-confirmed-delivery-countries?access_token=%s",
    $access_token);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'message': '',
    'code': 0,
    'data': {
        'countries' : [ 'FR',
                        'DE',
                        'GB',
                        'US' ]
    }
}

Get Confirmed Delivery Shipping Carriers For Country

Get a list of Shipping Carriers that provide tracking with Delivery Confirmation to a specified country.

For a full list of these Shipping Carriers, click here.

HTTP Request Type: POST

Scope: orders:read

Definition
POST https://sandbox.merchant.wish.com/api/v2/fulfillment/get-confirmed-delivery-shipping-carriers-for-country

Explore API

Parameters
country_code The 2-letter country code you want to ship to. For a full list of these country codes, click here.

Returns
Returns a list of shipping carriers, as well as a link describing additional requriements for specific carriers, which you will need when fulfilling orders on Wish that require Delivery Confirmation.

Example

Assume your access token is "an_example_access_token". Suppose you want a list of shipping carriers that provide Delivery Confirmation to the US:

  • country_code = US
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/fulfillment/get-confirmed-delivery-shipping-carriers-for-country -d "country_code='US'&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$country_code = 'US'
$client->orderGetConfirmedDeliveryShippingCarriersForCountry('098765432112345678901234',$country_code);
<?php

$access_token = urlencode('an_example_access_token');

$country_code = urlencode('US');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/fulfillment/get-confirmed-delivery-shipping-carriers-for-country?access_token=%s&country_code=%s",
    $access_token, $country_code);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'message': '',
    'code': 0,
    'data': {
        'carriers': [ 'USPS',
                      'WishPost',
                      'EMS (China)',
                      'AsendiaUSA',
                      'BRTBartolini',
                      'DPD',
                      'DPEXChina',
                      'EMPSExpress',
                      'EPacket',
                      'FedEx',
                      'GLS',
                      'Hermes',
                      'SFExpress',
                      'TNT',
                      'TollIPEC',
                      'UPS',
                      'XPO',
                      'YODEL'],
        'extra_info': {
            'WishPost': 'https://merchant.wish.com/documentation/v2/qualifiedcarriers'
        }
  }
}

Example Response

{
    'code': 0,
    'data': {
        'carriers': [],
        'extra_info': {}
  },
  'message': ''
}

Warehouse

The Warehouse object represents separate Warehouses and shipping options you provide. With this API, you can fetch a list of your warehouses.

Attributes
idWish's unique identifier for the warehouse
warehouse_unit_idThe human readable ID for the warehouse, this is the ID to use for other API calls
destination_countriesThe list of destination country codes the Warehouse ships to, this field is currently only provided for Wish Express warehouses and only supports one country per Warehouse.
warehouse_typeThe type of shipping the Warehouse provides, 1 for Standard Shipping, 2 for Wish Express
warehouse_type_nameHuman readable string for the type of shipping the Warehouse provides

Get all Warehouses

Retrieves a list of all of your warehouses.

HTTP Request Type: GET

Definition
GET https://sandbox.merchant.wish.com/api/v2/warehouse/get-all

Explore API

Returns
Returns your list of Warehouses objects.

Example

Assume your access token is "an_example_access_token" .

  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/warehouse/get-all?access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$warehouses = $client->getAllWarehouses();
print_r($warehouses);
<?php

$access_token = urlencode('an_example_access_token');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/warehouse/get-all?access_token=%s",
    $access_token);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
  "message": "",
  "code": 0,
  "data": [
    {
      "MerchantWarehouse": {
        "warehouse_type_name": "EXPRESS",
        "destination_countries": [
          "US"
        ],
        "warehouse_type": "2",
        "id": "59e6xxxxxxxxxxxxxxxxxxxx",
        "warehouse_unit_id": "EXPRESS-US"
      }
    },
    {
      "MerchantWarehouse": {
        "warehouse_type_name": "STANDARD",
        "warehouse_type": "1",
        "id": "59e6xxxxxxxxxxxxxxxxxxxx",
        "warehouse_unit_id": "STANDARD"
      }
    }
  ]
}

Ticket

For each consumer question or complaint, a ticket is created to manage the dialogue between you, Wish, and the consumer.



With this API, you can fetch tickets awaiting your response, fetch a specific ticket, close a ticket, and reply to tickets.

Attributes
idWish's unique identifier for the ticket
transaction_idThe transaction the ticket is related to. Each ticket relates to at most one transaction
merchant_idThe merchant the ticket is for
buyer_infoThe information of the user who created the ticket
subjectThe subject for the ticket
stateThe state of the ticket can be: "Awaiting your response", "Awaiting buyer response", and "Awaiting store response"
labelWish's label for the ticket
sublabelWish's sublabel for the ticket
default_refund_reasonThe default reason the order will be refunded for, depends on the label of the ticket
photo_proofWhether the user has provided a photo
open_date (UTC)The date the ticket was created
last_update_date (UTC)The time that the ticket was last updated at
close_date (UTC)The date the ticket was closed (if applicable)
closed_byWho closed the ticket, can be: user, merchant, wish support, wish automated support
itemsA list of all items affected by the ticket, each item is an Order object
productsA list of all products affected by the ticket, each product is an Product object
repliesA list of all replies to the ticket
User Attributes
idWish's indentifier of the user
nameThe name of the user
joined_dateThe date the user joined wish
localeThe language preference of the user
Reply Attributes
dateWhen the reply was sent
messageContents of the reply
senderWho sent the reply, can be: user, merchant, wish support, wish automated support
image_urlsUrls of the images provided in the reply
translated_messageAn automatic translation to English
translated_message_zhAn automatic translation to Chinese

Retrieve a Ticket

Retrieves the details of an existing ticket. Supply the unique identifier for the ticket and if one exists this API will return the corresponding ticket.

HTTP Request Type: GET

Scope: tickets:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/ticket

Explore API

Parameters
idWish's unique identifier for the ticket (id in the Ticket object)

Returns
If there exists an ticket with the id provided for your account then the API returns a ticket object in the response.
If the ticket contains replies with images, the Reply object (inside the Ticket object) will contain a link to its attached image that expires in 60 minutes. Users can get an updated image link everytime they call the API.

Example

Assume your access token is "an_example_access_token" . If you have an ticket with id "123456789009876543210164" and you would like to retrieve any updates to it:

  • id = 123456789009876543210164
  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/ticket?id=123456789009876543210164&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$ticket = $client->getTicketById('123456789009876543210164');
print_r($ticket);
<?php

$access_token = urlencode('an_example_access_token');

$id = urlencode('123456789009876543210164');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/ticket?access_token=%s&id=%s",
    $access_token, $id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{'code': 0,
 'data': {'Ticket': {'UserInfo': {'id': '123456789012345678901234',
                                     'joined_date': '2012-02-02T11:22:21',
                                     'locale': 'en',
                                     'name': 'George Forman'},
                       'close_date': '2015-03-08T22:31:02',
                       'closed_by': 'wish support',
                       'id': '123456789012345678901234',
                       'items': [{'Order': {'ShippingDetail': {'city': '',
                                                                  'country': 'US',
                                                                  'name': 'George Forman',
                                                                  'phone_number': '123456',
                                                                  'state': 'California',
                                                                  'street_address1': '123 Fake St',
                                                                  'zipcode': '11111'},
                                              'cost': '6.69',
                                              'currency_code': 'USD',
                                              'last_updated': '2011-03-08T22:31:02',
                                              'order_id': '123456789012345678901234',
                                              'order_time': '2015-02-20T02:55:27',
                                              'released_to_merchant_time': '2015-02-20T03:55:27',
                                              'order_total': '9.39',
                                              'price': '6.4',
                                              'product_id': '123456789012345678901234',
                                              'product_image_url': 'https://google.com/not-a-image',
                                              'product_name': 'A product',
                                              'quantity': '1',
                                              'refunded_by': 'REFUNDED BY WISH FOR MERCHANT',
                                              'refunded_reason': 'Item did not work as described',
                                              'refunded_time': '2015-03-18',
                                              'shipped_date': '2015-02-20',
                                              'shipping': '3.0',
                                              'shipping_cost': '2.7',
                                              'pay_customer_vat_required': 'False',
                                              'shipping_provider': 'USPS',
                                              'sk': 'SKU123',
                                              'state': 'REFUNDED',
                                              'tracking_number': 'TR1234ACK',
                                              'transaction_id': '1223456789012345678901234',
                                              'variant_id': '123456789012345678901234'}}],
                       'label': 'Return or Exchange',
                       'last_update_date': '2015-02-09T12:13:43',
                       'merchant_id': '123456789012345678901234',
                       'open_date': '2015-03-06T21:23:01',
                       'photo_proof': 'True',
                       'replies': [{'Reply': {'date': '2015-03-06T21:23:01',
                                                'image_urls': "['https://fake-url']",
                                                'message': "Where is my product?",
                                                'sender': 'user',
                                                'translated_message': "Where is my product?",
                                                'translated_message_zh': '哪里是我的产品?'}}]
                       'state': 'Awaiting your response',
                       'state_id': '1',
                       'subject': 'Return or Exchange',
                       'sublabel': '',
                       'transaction_id': '123456789012345678901234'}},
 'message': ''}

List all Tickets Awaiting You

Returns a list of all your open tickets currently on the Wish platform awaiting your response. If you have a high number of tickets the response will be paginated. The response will contain the URL for fetching the next page of tickets, as well as the previous page.

HTTP Request Type: GET

Scope: tickets:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/ticket/get-action-required

Explore API

Parameters
startoptional An offset into the list of returned tickets. Use 0 to start at the beginning. The API will return the requested number of items starting at this offset. Default to 0 if not supplied
limitoptional A limit on the number of tickets that can be returned. Limit can range from 1 to 500 items and the default is 50
ticket_type optional Parameter used to choose which type of tickets to retrieve. Choices of ticket_types are:
post_purchase_tickets, post_customer_support_questions, pre_purchase_questions.
Default to post_purchase_tickets if not supplied.

Returns
Response will contain a list of ticket objects as well as a 'paging' field with paging options if needed.

Example

Assume your access token is "an_example_access_token" . If you would like to view your tickets in groups of 2 and you would like to see the 10th group your parameters would be:

  • start = 20
  • limit = 2
  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/ticket/get-action-required?limit=2&start=20&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$tickets = $client->getAllActionRequiredTickets();
echo "You have ".count($tickets)." tickets!\n";
<?php

$access_token = urlencode('an_example_access_token');

$start = urlencode('20');
$limit = urlencode('2');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/ticket/get-action-required?access_token=%s&limit=%s&start=%s",
    $access_token, $limit, $start);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{'code': 0,
 'data': [{'Ticket': {'UserInfo': {'id': '54f8e4ef2743dxxxxxxxxxxx',
                                      'joined_date': '2014-03-05T13:21:19',
                                      'locale': 'pt',
                                      'name': 'Mr. Rogers'},
                        'default_refund_reason': '19',
                        'id': '54f8ecd2f0812xxxxxxxxxx',
                        'items': [{'Order': {'ShippingDetail': {'city': 'San Fransicso',
                                                                   'country': 'BR',
                                                                   'name': 'Mr. Rogers',
                                                                   'phone_number': '1234567890',
                                                                   'state': 'S\xe3o Paulo',
                                                                   'street_address1': '123 Fake St',
                                                                   'street_address2': 'Apt 5',
                                                                   'zipcode': '10000000'},
                                               'color': 'black',
                                               'cost': '16.2',
                                               'currency_code': 'USD',
                                               'last_updated': '2014-03-06T07:37:16',
                                               'order_id': '123456789012345678901234',
                                               'order_time': '2015-03-05T23:40:53',
                                               'released_to_merchant_time': '2015-03-05T23:45:53',
                                               'order_total': '22.5',
                                               'price': '18.0',
                                               'product_id': '123456789012345678901234',
                                               'product_image_url': 'http://canary.contestimg.wish.com/api/webimage/123456789012345678901234-normal.jpg',
                                               'product_name': 'Cloth',
                                               'quantity': '1',
                                               'refunded_by': 'CANCELLED BY CUSTOMER',
                                               'refunded_reason': 'Customer cancelled the order',
                                               'refunded_time': '2015-03-05',
                                               'shipping': '7.0',
                                               'shipping_cost': '6.3',
                                               'pay_customer_vat_required': 'False',
                                               'size': 'M',
                                               'sk': 'SKU123-XL',
                                               'state': 'REFUNDED',
                                               'transaction_id': '123456789012345678901234',
                                               'variant_id': '5285bd3fb5baba7*********'}}],
                        'label': 'Request Refund/Cancel Order: Request a Different Color',
                        'last_update_date': '2015-03-09T12:13:57',
                        'merchant_id': '123456789012345678901234',
                        'open_date': '2015-03-05T23:54:58',
                        'photo_proof': 'False',
                        'replies': [{'Reply': {'date': '2015-03-05T23:54:58',
                                                 'image_urls': '[]',
                                                 'message': 'Quero meu reembolso ',
                                                 'sender': 'user',
                                                 'translated_message': 'I want my refund',
                                                 'translated_message_zh': '我希望我的退款'}}],
                        'state': 'Awaiting your response',
                        'state_id': '4',
                        'subject': 'Solicitar Reembolso/ Cancelar Pedido',
                        'sublabel': 'Request a Different Color',
                        'transaction_id': '123456789012345678901234'}},
           {'Ticket': {'UserInfo': {'id': '123456789012345678901234',
                                      'joined_date': '2011-12-12T05:22:52',
                                      'locale': 'en',
                                      'name': 'George Bush'},
                        'id': '123456789012345678901234',
                        'items': [{'Order': {'ShippingDetail': {'city': 'Waterloo',
                                                                   'country': 'CA',
                                                                   'name': 'George Bush',
                                                                   'phone_number': '1123-123-1234',
                                                                   'state': 'Ontario',
                                                                   'street_address1': 'Fake St',
                                                                   'zipcode': 'A0A 0A0'},
                                               'cost': '4.6',
                                               'currency_code': 'USD',
                                               'last_updated': '2015-03-09T10:23:13',
                                               'order_id': '123456789012345678901234',
                                               'order_time': '2012-12-12T06:40:12',
                                               'released_to_merchant_time': '2012-12-12T07:40:12',
                                               'order_total': '29.2',
                                               'price': '5.11',
                                               'product_id': '123456789012345678901234',
                                               'product_image_url': 'http://canary.contestimg.wish.com/api/webimage/5253fd0b1xxxxxxxxxxx-normal.jpg',
                                               'product_name': 'Automatic Car',
                                               'quantity': '4',
                                               'shipped_date': '2011-12-12',
                                               'shipping': '3.0',
                                               'shipping_cost': '2.7',
                                               'pay_customer_vat_required': 'False',
                                               'shipping_provider': 'SwissPost',
                                               'sk': 'SKU123',
                                               'state': 'SHIPPED',
                                               'tracking_number': 'TR1ACK',
                                               'transaction_id': '123456789012345678901234',
                                               'variant_id': '123456789012345678901234'}}],
                        'label': 'Shipping Status or ETA Inquiry',
                        'last_update_date': '2015-03-09T11:02:28',
                        'merchant_id': '123456789012345678901234',
                        'open_date': '2012-03-09T04:11:00',
                        'photo_proof': 'False',
                        'replies': [{'Reply': {'date': '2015-03-09T04:57:33',
                                                 'image_urls': '[]',
                                                 'message': 'I did not yet receive this item and it is know march 8 2015 it was estimated that it would be here Jan 2 2015 and it has not arrived ',
                                                 'sender': 'user',
                                                 'translated_message': 'I did not yet receive this item and it is know march 8 2015 it was estimated that it would be here Jan 2 2015 and it has not arrived ',
                                                 'translated_message_zh': '我还不接受这个项目,这是了解2015年3月8日,据估计,这将是这里2015年1月2日,也没有到达'}},
                                     {'Reply': {'date': '2015-03-09T10:23:12',
                                                 'image_urls': '[]',
                                                 'message': "Hello,friend\n\nSorry for caused you any troubles \n\nWe got the sad news from our shipping agent that your parcel may be lost due to the long time no information online. \n\nPlease don't worry, we won't let our customer lost their money, would you like us to sent your a new parcel for your order to your address:\n\nDain Steiner\nbox 203\nTeslin, Yukon, Y0A 1B0\nCanada\n\nOr you perfer a full refund for this order? Your reply will be highly appreciated, have a nice day :)\n\nRegards\nScreamprice Service Team",
                                                 'sender': 'merchant'}},
                                     {'Reply': {'date': '2015-03-09T11:02:28',
                                                 'image_urls': '[]',
                                                 'message': 'Please send me a new parcel thank yo',
                                                 'sender': 'user',
                                                 'translated_message': 'Please send me a new parcel thank yo',
                                                 'translated_message_zh': '请给我一个新的包裹谢谢'}}],
                        'state': 'Awaiting your response',
                        'state_id': '4',
                        'subject': 'Where is my order?',
                        'sublabel': '',
                        'transaction_id': '548a8de6baa0830ffxxxxxxx'}}],
 'message': '',
 'paging': {'next': 'https://sandbox.merchant.wish.com/api/v2/ticket/get-action-required?start=2&limit=2&access_token=an_example_access_token'}}

Announcements


Attributes
idWish's unique identifier for the announcement
titleThe title of the announcement
messageThe message content of the announcement
perma_linkThe permanent link to the announcement

Fetch Account Manager Announcements

Returns the most recent announcement that your Account Manager sends you about existing features, merchant training opportunities, merchant meetup events, items that need your attention, and more.

HTTP Request Type: GET

Scope: notifications:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/fetch-bd-announcement

Explore API

Parameters None

Returns
Response will contain a GetBDAnnouncementResponse object

Example

Assume your access token is "an_example_access_token" and if you would like to fetch the announcement

  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/fetch-bd-announcement?access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$count = $client->getBDAnnouncemtns();
<?php

$access_token = urlencode('an_example_access_token');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/fetch-bd-announcement?access_token=%s",
    $access_token);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'message': '', 'code': 0, 'data': {
        'GetBDAnnouncementResponse': {
            'title': '关于下调XXXXXXXXXXXXXXXXXXX',
            'created': 'Apr 01, 2016',
            'bd_id': '55781a50d29XXXXXXXXXX',
            'bd_name': 'TraXX XXXX',
            'message': '感谢大家XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
            'viewed': 'False'
        }
    }
}

Fetch System Updates

Returns all System Updates from Wish (located here on Merchant Dashboard). System updates are announcements about new features, policies, and programs Wish rolls out to merchants.

HTTP Request Type: GET

Scope: notifications:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/fetch-sys-updates-noti

Explore API

Parameters None

Returns
Response will contain a list of SystemUpdatesResponse objects which contains the details of each update. Each field in the SystemUpdatesResponse object is explained in the following table:

title string The title of the system update (in English)
body string The body of the message (in English)
link string The associated URL link for more information (in English)
cn_title string The title of the system update (in Chinese)
cn_body string The body of the message (in Chinese)
cn_link string The associated URL link for more information (in Chinese)
categories array List of categories that the system update is tagged with (up to three). Category values may be: ACCOUNT_SETTINGS, API, INSIGHTS, IP, LOCAL_CURRENCY, LOGISTICS, LOGISTICS_PRICING, ORDERS, PAYMENTS, POLICIES_AND_TERMS, PRODUCTS, SHIPPING_CARRIERS, TAX.
program string Name of the program that the system update is referring to. Note: ‘None’ means that there is no program associated with this system-update.
important boolean This value is True when the announcement requires merchant to take action before or after a specific date deadline and/or when there is an API update.
cta_text string The specific Call To Action (action required) for the announcement (in English).
cta_text_cn string The specific Call To Action (action required) for the announcement (in Chinese).
cta_effective_date string The date and time related to the specific Call To Action (action required) for the announcement. This value is in UTC timezone.

Example

Assume your access token is "an_example_access_token" and if you would like to get the system update

  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/fetch-sys-updates-noti?access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$count = $client->getSystemUpdatesNotifications();
<?php

$access_token = urlencode('an_example_access_token');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/fetch-sys-updates-noti?access_token=%s",
    $access_token);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'message': '', 'code': 0, 'data': [{
        'SystemUpdatesResponse': {
            'release_date': 'Thursday May 19, 2016',
            'id': '573e46218db5d1487ee4bdd8',
            'features': [{
                'Feature': {
                    'cn_title': '关于更新每个产品国际运费的新功能',
                    'body': 'We are very excited to announce that you can set international shipping prices per product now. No matter what sizes and weights your products are or what countries you are shipping to, you can always set shipping prices accordingly. You can start with changing overall default shipping prices on shipping settings page. Next step is to update per product shipping prices for specific countries by updating manually or a CSV file.\n\nFor a step to step guide, please visit our FAQ page for more information:',
                    'title': 'New Feature About Updating International Shipping Prices Per Product',
                    'link': 'https://merchantfaq.wish.com/hc/en-us/articles/218812008',
                    'cn_body': '尊敬的商户,我们非常荣幸的通知您,您现在可以给每个产品针对不同国家来设置不同运费了。无论您的产品是什么尺寸和重量或者要寄往哪些国家,您总可以根据不同的产品设定邮费。操作方法如下,您可以先使用配送设置页面来设置每个国家的默认运费,再去产品一览页面根据不同的国家更改每个产品的运费,可以手动修改或者上传CSV文件。 如果您想要获取更多信息和具体操作步骤,请访问常见问题:',
                    'cn_link': 'https://merchantfaq.wish.com/hc/zh-cn/articles/218812008',
                    'categories': ['LOGISTICS_PRICING', 'ORDERS', 'PRODUCTS'],
                    'program': 'ADVANCED_LOGISTICS',
                    'important': 'False',
                    'cta_text_en': '',
                    'cta_text_cn': '',
                    'cta_effective_date': ''
                }
            }]
        }
    }, {
        'SystemUpdatesResponse': {
            'release_date': 'Wednesday, December 11 2019',
            'id': '55bfae216daddd41f93512ce',
            'features': [{
                'Feature': {
                    'cn_title': '针对2020年1月中旬至2月初消费者对更快速发货的Wish产品需求的增加,请商户们及时准备充足的Wish Express库存',
                    'body': 'Based on historical data analysis, Wish products that offer fast-shipping options such as those with Wish Express enabled will likely experience an increased demand from customers between mid January and early February, 2020.\n\nIn anticipation of this potentially increased demand and sales for Wish Express products overall, Wish Express merchants are strongly encouraged to prepare for sufficient inventory now. Please plan for the inventory to arrive at your Wish Express warehouses by January 10, 2020.\n\nTo add more products to your Wish Express warehouse(s) now, please visit the link below:',
                    'title': 'Prepare sufficient Wish Express inventory in anticipation of increased demand for faster shipping Wish products mid January to early February 2020',
                    'link': 'https://merchant.wish.com/products/add',
                    'cn_body': '根据历史数据分析,提供快速配送选择的Wish产品(如启用Wish Express的产品)可能在2020年1月中旬至2月初期间会经历消费者需求增加的情况。\n\n由于预计在此期间Wish Express产品的消费者需求和销售整体上可能会增加,我们强烈鼓励Wish Express商户们现在就准备充足的库存。请为您的库存计划在2020年1月10日前到达您的Wish Express仓库。\n\n若需立即向您的Wish Express仓库添加更多产品,请访问以下链接:',
                    'cn_link': 'https://merchant.wish.com/products/add',
                    'categories': ['LOGISTICS', 'PRODUCTS'],
                    'program': 'None',
                    'important': True,
                    'cta_text_en': 'Please plan for your Wish Express inventory to arrive at Wish Express warehouses by January 10, 2020',
                    'cta_text_cn': '请为您的Wish Express库存计划在2020年1月10日前到达Wish Express仓库。',
                    'cta_effective_date': 'January 10, 2020 12:00 PM UTC'
                }
            }]
        }
    }]
}

Notifications


Attributes
idWish's unique identifier for the notification
titleThe title of the notification
messageThe message content of the notification
perma_linkThe permanent link to the notification

Fetch Notifications

Returns a list of all unviewed notifications (located here on Merchant Dashboard). Notifications are general messages Wish sends you about various updates, such as announcements, policy warnings, payments, new refunds, new infractions, and more.
If there is a large number of unviewed notifications in your account, the response will be paginated. The response will contain the URL for fetching the next page of notifications, as well as the previous page.

HTTP Request Type: GET

Scope: notifications:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/noti/fetch-unviewed

Explore API

Parameters
startoptional An offset into the list of returned notifications. Use 0 to start at the beginning. The API will return the requested number of items starting at this offset. Default to 0 if not supplied
limitoptional A limit on the number of notifications that can be returned. Limit can range from 1 to 500 items and the default is 50

Returns
Response will contain a list of GetNotiResponse objects as well as a 'paging' field with paging options if needed.

Example

Assume your access token is "an_example_access_token" . If you would like to view your notifications in groups of 2 and you would like to see the 10th group your parameters would be:

  • start = 20
  • limit = 2
  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/noti/fetch-unviewed?limit=2&start=20&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$notifications = $client->getAllNotifications();
echo $notifications;
<?php

$access_token = urlencode('an_example_access_token');

$start = urlencode('20');
$limit = urlencode('2');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/noti/fetch-unviewed?access_token=%s&limit=%s&start=%s",
    $access_token, $limit, $start);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{"message":"","code":0,"data":[
{"GetNotiResponse":{
    "perma_link":"http:\/\/merchant.wish.com\/release\/57180d6c49xxxxxxxxxxxxxx",
    "message":"Sizing Chart XXXXX",
    "id":"571810da7exxxxxxxxxxxxxx",
    "title":"There is a new xxxxxxxxxx"}},
{"GetNotiResponse":{
    "perma_link":"http:\/\/merchant.wish.com\/release\/57180d6c49xxxxxxxxxxxxxx",
    "message":"Sizing Chart XXXXX",
    "id":"571812abf9xxxxxxxxxxxxxx",
    "title":"There is a new xxxxxxxxxx"}}],
"paging":{"next":"https:\/\/merchant.wish.com\/api\/v2\/noti\/fetch-unviewed?start=12","previous":"https:\/\/merchant.wish.com\/api\/v2\/noti\/fetch-unviewed?start=8"}}

Mark a notification as viewed

Marks a notification as viewed

HTTP Request Type: POST

Scope: notifications:write

Definition
GET https://sandbox.merchant.wish.com/api/v2/noti/mark-as-viewed

Explore API

Parameters
noti_id Unique identifier for the notification

Returns
If there exists an unviewed notification with the id provided for your notification then the API returns success

Example

Assume your access token is "an_example_access_token" . If you have a notification with id "123456789009876543210164" and you would like to mark is viewed.

  • id = 123456789009876543210164
  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/noti/mark-as-viewed?noti_id=123456789009876543210164&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->markNotificationAsViewed('98753984xxxxxxx');
<?php

$access_token = urlencode('an_example_access_token');

$noti_id = urlencode('123456789009876543210164');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/noti/mark-as-viewed?access_token=%s&id=%s",
    $access_token, $noti_id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {'success': True},
    'message': ''
}

Get the unviewed notification count

Get the count of unviewed notification count

HTTP Request Type: GET

Scope: notifications:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/noti/get-unviewed-count

Explore API

Parameters None

Returns
Returns the count of the unviewed notifications

Example

Assume your access token is "an_example_access_token" and if you would like to get the unviewed notification count

  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/noti/get-unviewed-count?access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$count = $client->getUnviewedNotiCount();
<?php

$access_token = urlencode('an_example_access_token');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/noti/mark-as-viewed?access_token=%s",
    $access_token);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {'count': 8},
    'message': ''
}

Infractions

Interface to check infractions

Infractions count

Get the count of infractions of different stages

HTTP Request Type: GET

Scope: infractions:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/count/infractions

Explore API

Parameters
stage optional One of 1, 2 or 3, default is 1:
  • 1: ACTION_REQUIRED (Awaiting Merchant Response)
  • 2: AWAITING_WISH (Awaiting Wish Response)
  • 3: HISTORY (No further action needed)
The default is 1

Returns
Response will contain a CountInfractionsResponse object that has the count of infractions

Example

Assume your access token is "an_example_access_token" and if you would like to get the count of the infractions that need the attention of the merchant

  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/count/infractions?access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$count = $client->getInfractionCount();
<?php

$access_token = urlencode('an_example_access_token');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/count/infractions?access_token=%s",
    $access_token);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'message': '', 'code': 0, 'data': {
        'CountInfractionsResponse': {
            'count': '156'
        }
    }
}

Fetch infractions

Fetch infraction links that need the attention of the merchant

HTTP Request Type: GET

Scope: infractions:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/get/infractions

Explore API

Parameters
start optional An offset into the list of returned infractions. Use 0 to start at the beginning. The API will return the requested number of items starting at this offset. Default to 0 if not supplied
limit optional A limit on the number of infractions that can be returned. Limit can range from 1 to 500 items and the default is 50
stage optional One of 1, 2 or 3, default is 1:
  • 1: ACTION_REQUIRED (Awaiting Merchant Response)
  • 2: AWAITING_WISH (Awaiting Wish Response)
  • 3: HISTORY (No further action needed)
The default is 1
since optional A date/time string in the format YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS. If a date or time is provided, only products updated since the given date or time will be fetched. Default is to fetch all.
upto optional A date/time string in the format YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS. If a date or time is provided, only products updated before the given date or time will be fetched. Default is to fetch all updated products until now.

Returns
Response will contain a InfractionsResponse object that has a list of infraction objects which includes the information of that infraction
Infraction

id Unique identifier for the infraction
link The webpage link of the infraction
created_time The create time of the infraction
last_updated The last updated time of the infraction
state The current state of the infraction. The state may be 'NEW', 'AWAITING_MERCHANT', 'AWAITING_ADMIN' or 'CLOSED'
reason The infraction message
fine_amount The fine amount of the infraction
fine_currency The fine currency of the infraction
proof The proof list of the infraction, the 'proof_type' may be 'TICKET', 'ORDER', 'PRODUCT', 'MERCHANT', 'RATING', or 'VARIATION'

Example

Assume your access token is "an_example_access_token" and if you would like to get the infractions that need the attention of the merchant

  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/get/infractions?access_token=an_example_access_token&limit=5"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$count = $client->getInfractionLinks();
<?php

$access_token = urlencode('an_example_access_token');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/get/infractions?access_token=%s",
    $access_token);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

    {
        "message": "",
        "code": 0,
        "data": {
            "InfractionsResponse": {
                "infractions": [
                    {
                        "Infraction": {
                            "fine_amount": "10.0",
                            "fine_currency": "USD",
                            "reason": "Inappropriate content detected for product listing",
                            "last_updated": "2018-06-01T23:15:57",
                            "state": "AWAITING_MERCHANT",
                            "created_time": "2018-05-12T05:07:59",
                            "link": "https://merchant.wish.com/warning/view/5af67aaf2232612b29f6c5eb",
                            "extra_reason": "Weapon",
                            "id": "5af676af22326ssb29f6c5eb",
                            "proof": [
                                {
                                    "InfractionProof": {
                                        "message": "Inappropriate content detected for product listing",
                                        "proof_type": "PRODUCT",
                                        "object_id": "5af4317fb9c68aa5f9f25022"
                                    }
                                }
                            ]
                        }
                    }
                ]
            }
        },
        "paging": {
            "next": "https://merchant.wish.com/api/v2/get/infractions?access_token=xxx&start=50"
        }
    }

Reply to a Ticket

Send a reply for a ticket. Wish will notify the user of the reply if required.

HTTP Request Type: POST

Scope: tickets:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/ticket/reply

Explore API

Parameters
idWish's unique identifier for the ticket, or 'id' in the Ticket object
replyThe message you wish to send, with a max of 2000 characters

Returns
If you can access the ticket, it is not yet closed, and all the parameters are correct, the API will send the reply and return a HTTP status code of 200.

Example

Assume your access token is "an_example_access_token" . If the ticket's id is "098765432112345678901234":

  • id = 098765432112345678901234
  • reply = "some message"/li>
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/ticket/reply -d "reply=some%20message&id=098765432112345678901234&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->replyToTicketById('098765432112345678901234',"some message");
<?php

$access_token = urlencode('an_example_access_token');

$id = urlencode('098765432112345678901234');
$reply = "some message"

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/ticket/reply?access_token=%s&reply=%s&id=%s",
    $access_token, $reply, $id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {'success': True},
    'message': ''
}

Close a Ticket

Close a order in the Wish system. Call this API if you answered all the users questions to their statisification.

HTTP Request Type: POST

Scope: tickets:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/ticket/close

Explore API

Parameters
idWish's unique identifier for the ticket, or 'id' in the Ticket object

Returns
If the ticket is not already closed, and the id is correct, the API will mark the ticket as closed and return a HTTP status code of 200, notifying the user if required.

Example

Assume your access token is "an_example_access_token" . If you want to close the ticket with id "098765432112345678901234" because the order has been refunded.

  • id = 098765432112345678901234

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/ticket/close -d "id=098765432112345678901234&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->closeTicketById('098765432112345678901234');
<?php

$access_token = urlencode('an_example_access_token');

$id = urlencode('098765432112345678901234');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/ticket/close?access_token=%s&id=%s",
    $access_token, $id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {'success': True},
    'message': ''
}

Appeal to Wish Support for Ticket

Appeal to wish support for a ticket. Call this if the user has questions you are unable to answer.

HTTP Request Type: POST

Scope: tickets:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/ticket/appeal-to-wish-support

Explore API

Parameters
idWish's unique identifier for the ticket, or 'id' in the Ticket object

Returns
If the ticket is not already awaiting a response from wish, and the id is correct, the API will mark the ticket as awaiting wish response and return a HTTP status code of 200.

Example

Assume your access token is "an_example_access_token" . If you want wish to be aware of the ticket.

  • id = 098765432112345678901234

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/ticket/appeal-to-wish-support -d "id=098765432112345678901234&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;
use Wish\Model\WishReason;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->appealTicketById('098765432112345678901234');
<?php

$access_token = urlencode('an_example_access_token');

$id = urlencode('098765432112345678901234');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/ticket/appeal-to-wish-support?access_token=%s&id=%s",
    $access_token, $id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {'success': True},
    'message': ''
}

Re-open a Ticket

Re-open a ticket on the Wish platform. Call this API if something happens to make the ticket relevant again.

HTTP Request Type: POST

Scope: tickets:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/ticket/re-open

Explore API

Parameters
idWish's unique identifier for the ticket, or 'id' in the Ticket object
replyThe reason for re-opening the ticket, max of 2000 characters

Returns
If the ticket is closed, and the id is correct, the API will mark the ticket as open and return a HTTP status code of 200, notifying the user if required.

Example

Assume your access token is "an_example_access_token" . If you want to re-open the ticket with id "098765432112345678901234" because you have been notified delivery failed

  • id = 098765432112345678901234
  • reply = "some message"

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/ticket/re-open -d "id=098765432112345678901234&reply=some%20message&access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$client->reOpenTicketById('098765432112345678901234', "some message");
<?php

$access_token = urlencode('an_example_access_token');

$id = urlencode('098765432112345678901234');
$reply = urlencode('some message');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/ticket/re-open?access_token=%s&id=%s&message=%s",
    $access_token, $id, $reply);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {'success': True},
    'message': ''
}

Wish Returns Program

Interface to set up and modify information related to the Wish Returns Program.

Get all Return Warehouses

Get information related to all of your return warehouses.

HTTP Request Type: GET

Scope: returns:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/returns/get-all-warehouses

Explore API

Returns
Response will contain a MerchantReturnWarehouse object that has the return warehouse name and address, as well as the state of the address validation.

Address Validation States
VALID_USER_ADDRESSThe address shown is valid, and it is the address you entered.
VALID_SUGGESTED_ADDRESSThe address shown is valid, but it is an address we have suggested.
VALIDATINGWe are currently validating your address.
INVALIDThe address you have entered is invalid. Please edit the address using returns/edit-return-warehouse.

Example

Assume your access token is "an_example_access_token".

  • access_token = an_example_access_token

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/returns/get-all-warehouses?access_token=an_example_access_token"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';

$client = new WishClient($access_token,'prod');
$count = $client->getInfractionCount();
<?php

$access_token = urlencode('an_example_access_token');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/returns/get-all-warehouses?access_token=%s",
    $access_token);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    "message": "", "code": 0, "data": [
        {
            "MerchantReturnWarehouse": {
                "city": "Bentonville",
                "country": "US",
                "region": "US",
                "zipcode": "12345",
                "street_address1": "4123 Example Street",
                "email": "example@gmail.com",
                "state": "AR",
                "ship_to": "Example User",
                "warehouse_name": "Example Warehouse Name",
                "id": "59a024d19fbc5131da8917ed",
                "address_valid_state": "VALID USER ADDRESS"
            }
        }
    ]
}

Get the Return Settings for a Product

Get the region(s) for which a product has been enabled for returns, as well as the Warehouse IDs for the associated return warehouses.

HTTP Request Type: GET

Scope: returns:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/returns/get-product-return-settings

Explore API

Parameters
id The unique wish identifier of the product that you are trying to get return settings for.

Returns
Contains the returns region, warehouse ID, and 'is_active' status.

Example

Assume your access token is "an_example_access_token", and your product has id is "123456789013"

  • access_token = an_example_access_token
  • id = 123456789013

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/returns/get-product-return-settings?access_token=an_example_access_token&id=123456789013"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';
$id = '123456789013';
$client = new WishClient($access_token,'prod');
$count = $client->getInfractionCount();
<?php

$access_token = urlencode('an_example_access_token');
$id = urlencode('123456789013');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/returns/get-product-return-settings?access_token=%s&id=%s",
    $access_token,
    $id,
    );

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    "message": "",
    "code": 0,
    "data": [
        {
            "ProductReturnSetting": {
                "region": "US",
                "is_active": "True",
                "warehouse_id": "123456987123"
            }
        }
    ]
}

Enroll a Product in Returns Program

Enable returns for a product to a specified region (such as "EU", "MX", or "US"), based on the warehouse region. Requires the product to have dimensions information set. Note that you will only be able to enroll a product for a warehouse if the warehouse's address has been validated.

Note: Requires the product to have logistics information, see Set Product Logistics.

Note: Requires a return warehouse to exist in that region, see Create a Return Warehouse.

Note: The API limits calls to 500 per minute to ensure maximum function.

HTTP Request Type: POST

Scope: returns:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/returns/enroll-product-in-returns

Explore API

Parameters
idThe unique wish identifier of the product that you are trying to enroll in returns.
regionThe region (such as "MX", or "US") in which you want to enable returns for the product.
warehouse_id The unique wish identifier of the return warehouse. Can be found through /returns/get-all-warehouses under 'id'.

Returns
If the request was successful, the API will return an HTTP status code of 200 and a status code of 0.

Example

Assume your access token is "an_example_access_token", your warehouse id is "123456789012", your product has id is "123456789013" and your return warehouse has a region "US" Your parameters would be:

  • access_token = an_example_access_token
  • warehouse_id = 123456789012
  • id = 123456789013
  • region = "US"

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/returns/enroll-product-in-returns?access_token=an_example_access_token&warehouse_id=123456789012&id=123456789013®ion=US"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';
$warehouse_id = '123456789012';
$id = '123456789013';
$region = 'US';

$client = new WishClient($access_token,'prod');
$count = $client->getInfractionCount();
<?php

$access_token = urlencode('an_example_access_token');
$warehouse_id = urlencode('123456789012');
$id = urlencode('123456789013');
$region = urlencode('US');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/returns/enroll-product-in-returns?access_token=%s&warehouse_id=%s&id=%s®ion=%s",
    $access_token,
    $warehouse_id,
    $id,
    $region
    );

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {},
    'message': ''
}

Get Product/Variation Dimensions

Get the dimensions (length, width, height, weight) of a specific product or product variation based on ID.

HTTP Request Type: GET

Scope: returns:read

Definition
GET https://sandbox.merchant.wish.com/api/v2/returns/get-product-variation-dimensions

Explore API

Parameters
idThe unique wish identifier of the product you are trying to get dimensions for.
variation_id Optional The unique wish identifier of the variation you are trying to get dimensions for. Can be found using /get-product-variation under 'id'.

Returns
Response will contain a ProductVariationLogistics object that has length (cm), width (cm), height (cm), and weight (g) of the product or variation.

Example

Assume your access token is "an_example_access_token", the id of the product you are trying to modify is "123456789012" and the id of the variation of the product is "123456789013"

  • access_token = an_example_access_token
  • id = 123456789012
  • variation_id = 123456789013

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/returns/get-product-variation-dimensions?access_token=an_example_access_token&id=123456789012&variation_id=123456789013"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';
$id = '123456789012';
$variation_id = '123456789013';

$client = new WishClient($access_token,'prod');
$count = $client->getInfractionCount();
<?php

$access_token = urlencode('an_example_access_token');
$id = urlencode('123456789012');
$variation_id = urlencode('123456789013');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/returns/get-product-variation-dimensions?access_token=%s&id=%s&variation_id=%s",
    $access_token, $id, $variation_id);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    "message": "",
    "code": 0,
    "data": {
        "ProductVariationLogistics": {
        "width": "3.0",
        "length": "3.0",
        "id": "123456789012",
        "weight": "3.0",
        "variation_id": "123456789013",
        "height": "3.0"
        }
    }
}

Set Product Logistics

Set the dimensions of a specific product or a variation based on ID.

HTTP Request Type: POST

Scope: returns:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/returns/set-product-logistics

Explore API

Parameters
idThe unique wish identifier of the product whose dimensions you are trying to set.
variation_id Optional The unique wish identifier of the variation whose dimensions you are trying to set. Can be found using /get-product-variation under 'id'.
heightThe height (cm) of the product/variation whose dimensions you are trying to set.
lengthThe length (cm) of the product/variation whose dimensions you are trying to set.
widthThe width (cm) of the product/variation whose dimensions you are trying to set.
weightThe weight (g) of the product/variation whose dimensions you are trying to set.

Returns
If the request was successful, the API will return an HTTP status code of 200 and a status code of 0.

Example

Assume your access token is "an_example_access_token", the id of the product you are trying to modify is "123456789012", the id of the variation of the product is "123456789013", and the height, length, width of your product are all 3cm, and the weight is 3g

  • access_token = an_example_access_token
  • id = 123456789012
  • variation_id = 123456789013
  • height = 3
  • weight = 3
  • length = 3
  • width = 3

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/returns/set-product-logistics?access_token=an_example_access_token&id=123456789012&variation_id=123456789013&height=3&width=3&weight=3&length=3"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';
$id = '123456789012';
$variation_id = '123456789013';
$height = '3';
$weight = '3';
$length = '3';
$width = '3';

$client = new WishClient($access_token,'prod');
$count = $client->getInfractionCount();
<?php

$access_token = urlencode('an_example_access_token');
$id = urlencode('123456789012');
$variation_id = urlencode('123456789013');
$height = urlencode('3');
$weight = urlencode('3');
$length = urlencode('3');
$width = urlencode('3');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/returns/set-product-logistics?access_token=%s&id=%s&variation_id=%s&height=%s&weight=%s&length=%s&width=%s",
    $access_token, $id, $variation_id,
    $height, $weight, $length, $width);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    "message": "",
    "code": 0,
    "data": {}
}

Create a Return Warehouse

Creates a new return warehouse. Note that we will validate the address. This may take several minutes. You will receive a 200 response if your address passes basic validation, such as formatting checks. To see the status of validation of your address, use returns/get-all-warehouses. You will not be able to enroll a product in returns for this warehouse until the address is validated.

HTTP Request Type: POST

Scope: returns:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/returns/create-return-warehouse

Explore API

Parameters
ship_to The entity that return parcels should be addressed to. This should be a name that helps the carrier successfully identify the return warehouse and deliver return parcels.
warehouse_nameThe name of the return warehouse.
regionThe region (such as "EU", "MX", or "US") of the return warehouse.
phone_numberOptional for US The phone number for the return warehouse.
emailOptional for MX & US The email for the return warehouse.
cityThe city in which of the return warehouse is located.
stateThe state in which of the return warehouse is located.
countryThe country in which of the return warehouse is located. Country code should follow ISO 3166 Alpha-2 code. Example: CN, US.
zipcodeThe zip code/postal code in which the return warehouse is located.
street_address1The primary street address of the return warehouse.
street_address2Optional The secondary street address of the return warehouse.

Returns
Returns MerchantReturnWarehouse object with warehouse_id of the newly created warehouse.

Example

Assume your access token is "an_example_access_token". Say you wanted to create a warehouse named "new_warehouse", for the "US" region, located at "20 Test Drive" in the city of "TestCity", the state of "TestState", and the country of "US", with a zipcode of "11111".

  • access_token = an_example_access_token
  • region = "US"
  • street_address1 = "20 Test Drive"
  • city = "TestCity"
  • state = "TestState"
  • country = "US"
  • zipcode = "11111"

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/returns/create-return-warehouse -d "access_token=an_example_access_token®ion=US&street_address1=20 Test Drive&city=TestCity&state=TestState&country=US&zipcode=11111"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';
$region = 'US';
$street_address1 = "20 Test Drive";
$city = "TestCity";
$state = "TestState";
$country = "US";
$zipcode = "11111";

$client = new WishClient($access_token,'prod');
$count = $client->getInfractionCount();
<?php

$access_token = urlencode('an_example_access_token');
$region = urlencode('US');
$street_address1 = urlencode("20 Test Drive");
$city = urlencode("TestCity");
$state = urlencode("TestState");
$country = urlencode("US");
$zipcode = urlencode("11111");

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/returns/create-return-warehouse?access_token=%s®ion=%s&street_address_1=%s&city=%s&state=%s&country=%s&zipcode=%s",
    $access_token,
    $region,
    $street_address1,
    $city,
    $state,
    $country,
    $zipcode
    );

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    "message": "",
    "code": 0,
    "data": {
        "MerchantReturnWarehouse": {
            "id": "5ceefbc88a259700d38a6b4d"
        }
    }
}

Edit an Existing Return Warehouse

Edits the details for an existing return warehouse. Note that we will validate the address. This may take several minutes. You will receive a 200 response if your address passes basic validation, such as formatting checks. To see the status of validation of your address, use returns/get-all-warehouses. You will not be able to enroll a product in returns for this warehouse until the address is validated.

HTTP Request Type: POST

Scope: returns:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/returns/edit-return-warehouse

Explore API

Parameters
warehouse_id The unique wish identifier of the warehouse you are trying to edit. Can be found through /returns/get-all-warehouses under 'id'.
warehouse_nameOptional The name of the return warehouse.
ship_to Optional The entity that return parcels should be addressed to. This should be a name that helps the carrier successfully identify the return warehouse and deliver return parcels.
phone_numberOptional The phone number for the return warehouse.
emailOptional The email for the return warehouse.
cityOptional The state in which the return warehouse is located.
stateOptional The state of the warehouse that returns will be shipped to
zipcodeOptional The zip code/postal code in which the return warehouse is located.
street_address1Optional The primary street address of the return warehouse.
street_address2Optional The secondary street address of the return warehouse.

Returns
If the request was successful the API will return an HTTP status code of 200 and a status code of 0.

Example

Assume your access token is "an_example_access_token". Say the id of the warehouse you want to edit is "123456789012" and you wanted to change the city to "TestCity"

  • access_token = an_example_access_token
  • warehouse_id = "123456789012"
  • city = "TestCity"

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/returns/edit-return-warehouse -d "access_token=an_example_access_token&warehouse_id=123456789012&city=TestCity"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';
$warehouse_id = '123456789012';
$city = "TestCity";

$client = new WishClient($access_token,'prod');
$count = $client->getInfractionCount();
<?php

$access_token = urlencode('an_example_access_token');
$warehouse_id = urlencode('123456789012');
$city = urlencode("TestCity");

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/returns/edit-return-warehouse?access_token=%s&warehouse_id=%s&city=%s",
    $access_token,
    $warehouse_id,
    $city
    );

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    "message": "",
    "code": 0,
    "data": {}
}

Unenroll a Product from the Returns Program

Disables returns for a product for a specified region (such as "EU", "MX", or "US").

HTTP Request Type: POST

Scope: returns:write

Definition
POST https://sandbox.merchant.wish.com/api/v2/returns/disable-return-setting-for-region

Explore API

Parameters
idThe unique wish identifier of the product that you are trying to unenroll from returns.
regionThe region (such as "EU", "MX", or "US") for which you want to disable returns for the product.

Returns
If the request was successful, the API will return an HTTP status code of 200 and a status code of 0.

Example

Assume your access token is "an_example_access_token", your product has id is "123456789013" and your return warehouse has a region "US" Your parameters would be:

  • access_token = an_example_access_token
  • id = 123456789013
  • region = "US"

Example Request

> curl "https://sandbox.merchant.wish.com/api/v2/returns/disable-return-setting-for-region?access_token=an_example_access_token&id=123456789013®ion=US"
<?php
require_once 'vendor/autoload.php';

use Wish\WishClient;

$access_token = 'an_example_access_token';;
$id = '123456789013';
$region = 'US';

$client = new WishClient($access_token,'prod');
$count = $client->getInfractionCount();
<?php

$access_token = urlencode('an_example_access_token');
$id = urlencode('123456789013');
$region = urlencode('US');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/returns/disable-return-setting-for-region?access_token=%s&id=%s®ion=%s",
    $access_token,
    $id,
    $region
    );

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'GET',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    'code': 0,
    'data': {},
    'message': ''
}

Upload a Temporary Image

This uploads an image to our servers. The response will contain the URL of the image that was uploaded.
The image will be removed after 2 weeks. The maximum size of the image is 5 MB.

HTTP Request Type: POST

Definition
POST https://sandbox.merchant.wish.com/api/v2/image

Explore API

Parameters
imageThe image, in base64 encoded JPG format

Example

Assume your access token is "an_example_access_token". If you had an image with base64 encoding "ABCD1234abcd", your parameters would be:

  • image = ABCD1234abcd
  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/image -d "access_token=an_example_access_token " --data-urlencode "image=ABCD1234abcd"
Note: The base 64 data for the image must be URL Encoded to be transmitted correctly.
<?php

$access_token = urlencode('an_example_access_token');
$image = urlencode('ABCD1234abcd');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/image?access_token=%s&image=%s",
    $access_token, $image);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    "message":"",
    "code":0,
    "data":{"url" : http://merchant.wish.com/static/tmp-uploads/12345678901234567890123456789012.jpg?v=e3456}
}

Merchant Currency Code

This returns the merchant's localized currency code used in localized price updates. As well as the currency code that is currently used for payment.

Returns

localized_currency_code: The currency code you must provide to update any localized pricing fields for products and variations.

payment_currency_code: This is the currency code the merchant will be paid in for new transactions. If this is USD the merchant will be able to update USD prices in addition to the localized currency above.

product_boost_currency_code: The currency code for ProductBoost campaigns you create.

HTTP Request Type: GET

Definition
GET https://sandbox.merchant.wish.com/api/v2/get-currency-code

Explore API

Example

Assume your access token is "an_example_access_token". Your parameters would be:

  • access_token = an_example_access_token

Example Request

> curl https://sandbox.merchant.wish.com/api/v2/get-currency-code -d "access_token=an_example_access_token"
<?php

$access_token = urlencode('an_example_access_token');

$url = sprintf(
    "https://sandbox.merchant.wish.com/api/v2/get-currency-code?access_token=%s",
    $access_token);

$context = stream_context_create(array(
    'http' => array(
        'method'        => 'POST',
        'ignore_errors' => true,
    ),
));

// Send the request
$response = file_get_contents($url, TRUE, $context);
echo $response;
echo "\n";
?>

Example Response

{
    "message":"",
    "code":0,
    "data":{
      "localized_currency_code": "CNY",
      "payment_currency_code": "USD",
      "product_boost_currency_code": "USD"
    }
}

Shippable Countries

AD Andorra
AL Albania
AR Argentina
AT Austria
AU Australia
BA Bosnia and Herzegovina
BE Belgium
BG Bulgaria
BR Brazil
CA Canada
CH Switzerland
CL Chile
CO Colombia
CR Costa Rica
CZ Czech Republic
DE Germany
DK Denmark
EE Estonia
ES Spain
FI Finland
FR France
GB United Kingdom (Great Britain)
GI Gibraltar
GR Greece
HR Croatia
HU Hungary
IE Ireland
IL Israel
IS Iceland
IT Italy
JP Japan
KR South Korea
LI Liechtenstein
LT Lithuania
LU Luxembourg
LV Latvia
MC Monaco
MD Moldova
ME Montenegro
MK North Macedonia
MT Malta
MX Mexico
NL Netherlands
NO Norway
NZ New Zealand
PE Peru
PL Poland
PR Puerto Rico
PT Portugal
RO Romania
RS Serbia
SE Sweden
SG Singapore
SI Slovenia
SK Slovakia
SM San Marino
UA Ukraine
US United States
VI Virgin Islands, U.S.
ZA South Africa

Customizable Regions

Standard warehouse

Region Code Region Name Country Code Enabled by Default
AU_ACT Australian Capital Territory AU True
AU_JBT Jervis Bay Territory AU True
AU_NSW New South Wales AU True
AU_NT Northern Territory AU True
AU_QLD Queensland AU True
AU_SA South Australia AU True
AU_TAS Tasmania AU True
AU_VIC Victoria AU True
AU_WA Western Australia AU True
BR_BAC BA Capital & Metro Area BR True
BR_BAI BA Interior, SE, & Sede Recife BR True
BR_MGC MG Capital & Metro Area BR True
BR_MGI MG Interior BR True
BR_PRC PR Capital & Metro Area BR True
BR_PRI PR Interior, SC, & RS Interior BR True
BR_RJC RJ Capital & Metro Area BR True
BR_RJI RJ Interior & ES BR True
BR_RSC RS Capital & Metro Area BR True
BR_SFB Sede Fortaleza & Sede Brasilia BR True
BR_SPC SP Capital & Metro Area BR True
BR_SPI SP Interior BR True
CA_AB Alberta CA True
CA_BC British Columbia CA True
CA_MB Manitoba CA True
CA_NB New Brunswick CA True
CA_NL Newfoundland and Labrador CA True
CA_NS Nova Scotia CA True
CA_NT Northwest Territories CA True
CA_NU Nunavut CA True
CA_ON Ontario CA True
CA_PE Prince Edward Island CA True
CA_QC Quebec CA True
CA_SK Saskatchewan CA True
CA_YT Yukon CA True
CL_AI Aysén del General Carlos Ibáñez del Campo (11) CL True
CL_AN Antofagasta (2) CL True
CL_AP Arica y Parinacota (15) CL True
CL_AR La Araucanía (9) CL True
CL_AT Atacama (3) CL True
CL_BI Biobío (8) CL True
CL_CO Coquimbo (4) CL True
CL_LI Libertador General Bernardo O'Higgins (6) CL True
CL_LL Los Lagos (10) CL True
CL_LR Los Ríos (14) CL True
CL_MA Magallanes y de la Antártica Chilena (12) CL True
CL_ML Maule (7) CL True
CL_NB Ñuble (16) CL True
CL_RM Metropolitana de Santiago (13) CL True
CL_TA Tarapacá (1) CL True
CL_VS Valparaíso (5) CL True
DK_014 Bornholm DK True
DK_042 Samso DK True
DK_FO Faroe Islands DK True
DK_GL Greenland DK True
ES_CN Canary Islands ES True
ES_IB Balearic Islands ES True
FR_20R Corsica FR True
FR_GF French Guiana FR True
FR_GP Guadeloupe FR True
FR_MF Saint Martin FR True
FR_MQ Martinique FR True
FR_NC New Caledonia FR True
FR_PF French Polynesia FR True
FR_PM Saint Pierre and Miquelon FR True
FR_RE Reunion FR True
FR_WF Wallis and Futuna FR True
FR_YT Mayotte FR True
MX_AGU Aguascalientes MX True
MX_BCN Baja California MX True
MX_BCS Baja California Sur MX True
MX_CAM Campeche MX True
MX_CHH Chihuahua MX True
MX_CHP Chiapas MX True
MX_COA Coahuila MX True
MX_COL Colima MX True
MX_DIF Distrito Federal MX True
MX_DUR Durango MX True
MX_GRO Guerrero MX True
MX_GUA Guanajuato MX True
MX_HID Hidalgo MX True
MX_JAL Jalisco MX True
MX_MEX México MX True
MX_MIC Michoacán MX True
MX_MOR Morelos MX True
MX_NAY Nayarit MX True
MX_NLE Nuevo León MX True
MX_OAX Oaxaca MX True
MX_PUE Puebla MX True
MX_QUE Querétaro MX True
MX_ROO Quintana Roo MX True
MX_SIN Sinaloa MX True
MX_SLP San Luis Potosí MX True
MX_SON Sonora MX True
MX_TAB Tabasco MX True
MX_TAM Tamaulipas MX True
MX_TLA Tlaxcala MX True
MX_VER Veracruz MX True
MX_YUC Yucatán MX True
MX_ZAC Zacatecas MX True
PT_20 Azores PT True
PT_30 Madeira PT True
US_AA AA US True
US_AE AE US True
US_AK Alaska US True
US_AL Alabama US True
US_AP AP US True
US_AR Arkansas US True
US_AS American Samoa US True
US_AZ Arizona US True
US_CA California US True
US_CO Colorado US True
US_CT Connecticut US True
US_DC District of Columbia US True
US_DE Delaware US True
US_FL Florida US True
US_GA Georgia US True
US_GU Guam US True
US_HI Hawaii US True
US_IA Iowa US True
US_ID Idaho US True
US_IL Illinois US True
US_IN Indiana US True
US_KS Kansas US True
US_KY Kentucky US True
US_LA Louisiana US True
US_MA Massachusetts US True
US_MD Maryland US True
US_ME Maine US True
US_MI Michigan US True
US_MN Minnesota US True
US_MO Missouri US True
US_MP Northern Mariana Islands US True
US_MS Mississippi US True
US_MT Montana US True
US_NC North Carolina US True
US_ND North Dakota US True
US_NE Nebraska US True
US_NH New Hampshire US True
US_NJ New Jersey US True
US_NM New Mexico US True
US_NV Nevada US True
US_NY New York US True
US_OH Ohio US True
US_OK Oklahoma US True
US_OR Oregon US True
US_PA Pennsylvania US True
US_RI Rhode Island US True
US_SC South Carolina US True
US_SD South Dakota US True
US_TN Tennessee US True
US_TX Texas US True
US_UT Utah US True
US_VA Virginia US True
US_VT Vermont US True
US_WA Washington US True
US_WI Wisconsin US True
US_WV West Virginia US True
US_WY Wyoming US True

Wish Express warehouse

Region Code Region Name Country Code Enabled by Default
AU_ACT Australian Capital Territory AU False
AU_JBT Jervis Bay Territory AU False
AU_NSW New South Wales AU False
AU_NT Northern Territory AU False
AU_QLD Queensland AU False
AU_SA South Australia AU False
AU_TAS Tasmania AU False
AU_VIC Victoria AU False
AU_WA Western Australia AU False
BR_BAC BA Capital & Metro Area BR False
BR_BAI BA Interior, SE, & Sede Recife BR False
BR_MGC MG Capital & Metro Area BR False
BR_MGI MG Interior BR False
BR_PRC PR Capital & Metro Area BR False
BR_PRI PR Interior, SC, & RS Interior BR False
BR_RJC RJ Capital & Metro Area BR False
BR_RJI RJ Interior & ES BR False
BR_RSC RS Capital & Metro Area BR False
BR_SFB Sede Fortaleza & Sede Brasilia BR False
BR_SPC SP Capital & Metro Area BR False
BR_SPI SP Interior BR False
CA_AB Alberta CA False
CA_BC British Columbia CA False
CA_MB Manitoba CA False
CA_NB New Brunswick CA False
CA_NL Newfoundland and Labrador CA False
CA_NS Nova Scotia CA False
CA_NT Northwest Territories CA False
CA_NU Nunavut CA False
CA_ON Ontario CA False
CA_PE Prince Edward Island CA False
CA_QC Quebec CA False
CA_SK Saskatchewan CA False
CA_YT Yukon CA False
CL_AI Aysén del General Carlos Ibáñez del Campo (11) CL False
CL_AN Antofagasta (2) CL False
CL_AP Arica y Parinacota (15) CL False
CL_AR La Araucanía (9) CL False
CL_AT Atacama (3) CL False
CL_BI Biobío (8) CL False
CL_CO Coquimbo (4) CL False
CL_LI Libertador General Bernardo O'Higgins (6) CL False
CL_LL Los Lagos (10) CL False
CL_LR Los Ríos (14) CL False
CL_MA Magallanes y de la Antártica Chilena (12) CL False
CL_ML Maule (7) CL False
CL_NB Ñuble (16) CL False
CL_RM Metropolitana de Santiago (13) CL False
CL_TA Tarapacá (1) CL False
CL_VS Valparaíso (5) CL False
DK_014 Bornholm DK False
DK_042 Samso DK False
DK_FO Faroe Islands DK False
DK_GL Greenland DK True
ES_CN Canary Islands ES True
ES_IB Balearic Islands ES False
FR_20R Corsica FR False
FR_GF French Guiana FR True
FR_GP Guadeloupe FR True
FR_MF Saint Martin FR True
FR_MQ Martinique FR True
FR_NC New Caledonia FR True
FR_PF French Polynesia FR True
FR_PM Saint Pierre and Miquelon FR True
FR_RE Reunion FR True
FR_WF Wallis and Futuna FR True
FR_YT Mayotte FR True
MX_AGU Aguascalientes MX False
MX_BCN Baja California MX False
MX_BCS Baja California Sur MX False
MX_CAM Campeche MX False
MX_CHH Chihuahua MX False
MX_CHP Chiapas MX False
MX_COA Coahuila MX False
MX_COL Colima MX False
MX_DIF Distrito Federal MX False
MX_DUR Durango MX False
MX_GRO Guerrero MX False
MX_GUA Guanajuato MX False
MX_HID Hidalgo MX False
MX_JAL Jalisco MX False
MX_MEX México MX False
MX_MIC Michoacán MX False
MX_MOR Morelos MX False
MX_NAY Nayarit MX False
MX_NLE Nuevo León MX False
MX_OAX Oaxaca MX False
MX_PUE Puebla MX False
MX_QUE Querétaro MX False
MX_ROO Quintana Roo MX False
MX_SIN Sinaloa MX False
MX_SLP San Luis Potosí MX False
MX_SON Sonora MX False
MX_TAB Tabasco MX False
MX_TAM Tamaulipas MX False
MX_TLA Tlaxcala MX False
MX_VER Veracruz MX False
MX_YUC Yucatán MX False
MX_ZAC Zacatecas MX False
PT_20 Azores PT False
PT_30 Madeira PT False
US_AA AA US True
US_AE AE US True
US_AK Alaska US True
US_AL Alabama US False
US_AP AP US True
US_AR Arkansas US False
US_AS American Samoa US False
US_AZ Arizona US False
US_CA California US False
US_CO Colorado US False
US_CT Connecticut US False
US_DC District of Columbia US False
US_DE Delaware US False
US_FL Florida US False
US_GA Georgia US False
US_GU Guam US True
US_HI Hawaii US True
US_IA Iowa US False
US_ID Idaho US False
US_IL Illinois US False
US_IN Indiana US False
US_KS Kansas US False
US_KY Kentucky US False
US_LA Louisiana US False
US_MA Massachusetts US False
US_MD Maryland US False
US_ME Maine US False
US_MI Michigan US False
US_MN Minnesota US False
US_MO Missouri US False
US_MP Northern Mariana Islands US False
US_MS Mississippi US False
US_MT Montana US False
US_NC North Carolina US False
US_ND North Dakota US False
US_NE Nebraska US False
US_NH New Hampshire US False
US_NJ New Jersey US False
US_NM New Mexico US False
US_NV Nevada US False
US_NY New York US False
US_OH Ohio US False
US_OK Oklahoma US False
US_OR Oregon US False
US_PA Pennsylvania US False
US_RI Rhode Island US False
US_SC South Carolina US False
US_SD South Dakota US False
US_TN Tennessee US False
US_TX Texas US False
US_UT Utah US False
US_VA Virginia US False
US_VT Vermont US False
US_WA Washington US False
US_WI Wisconsin US False
US_WV West Virginia US False
US_WY Wyoming US False