This is an old revision of the document!
Setting Ysell.pro through API
API — application programming interface, that serves as an interface between programs and simplify their interaction.
Ysell provides the opportunity of working with web-services via our own API.
To work with the API you should specify API token for the User.Bearer authentication is scheme of autentification of HTTP which uses markers of security, it's called bearer tokens. Bearer token is encoded string usually generated by server in answer to request of entering to the system. A client should send the token in the Authorization header while creating the request: Authorization: Bearer <token>
Product
Curl
curl -X 'GET' \ 'https://719.eu6.ysell.pro/api/v1/product' \ -H 'accept: */*' \ -H 'Authorization: Bearer'
Response body
[ { "id": 1, "ext_id": "1", "title": "Melozio", "condition": "New", "manufacturer_id": 1, "purchase_price": "2.50", "netto": 100, "main_supplier": { "id": 1, "product_id": 1, "supplier_id": 1, "supplier_num": "45245634", "note": "", "url": "", "qty": 0, "price": "2.50", "discount_enabled": 0, "discount_price": null, "discount_qty": 0, "main": 1 }, "listings": [], "image": "" },
Getting products list of the client
Create New Product
Curl
curl -X 'POST' \ 'https://719.eu6.ysell.pro/api/v1/product' \ -H 'accept: */*' \ -H 'Authorization: Bearer 123321' \ -H 'Content-Type: multipart/form-data' \ -F 'productDimensionW=10' \ -F 'masterboxWeight=17' \ -F 'packageDimensionD=6' \ -F 'productWeight=0.1' \ -F 'masterboxDimensionD=60' \ -F 'packageDimensionH=12' \ -F 'productWeightUnits=kg' \ -F 'manufacturer_id=1' \ -F 'masterboxDimensionH=60' \ -F 'product_image=https://719.eu6.ysell.pro/product_images/150/1.jpg' \ -F 'masterboxQty=200' \ -F 'productDimensionD=6' \ -F 'masterboxWeightUnits=kg' \ -F 'packageDimensionUnits=cm' \ -F 'productDimensionH=12' \ -F 'packageWeightUnits=kg' \ -F 'masterboxDimensionUnits=cm' \ -F 'packageDimensionW=10' \ -F 'productDimensionUnits=cm' \ -F 'title=Tequila Sunset' \ -F 'ext_id=p-719-155' \ -F 'masterboxDimensionW=120' \ -F 'id=155' \ -F 'packageWeight=0.5'
Response body
{ "id": 155, "ext_id": "p-719-155", "title": "Tequila Sunset", "condition": "New", "manufacturer_id": 1, "purchase_price": null, "netto": 0, "main_supplier": null, "listings": [], "image": "https://719.eu6.ysell.pro/product_images/150/1.jpg" }
Creation a product with ID 155 that's named Tequila Sunset with indicating product dimensions, package dimension and product image.
id - product ID
ext_id - Product ID of the product.
title - Product title.
product_image - link to the product image.
manufacturer_id - ID from previously created product manufacturers.
packageDimensionW - package dimensions of the product (Width)
packageDimensionH - package dimensions of the product (Height)
packageDimensionD - package dimensions of the product (Depth)
packageDimensionUnits - unit measure of the package
packageWeight - weight of the package
packageWeightUnits - unit measure of the product weight
masterboxDimensionW - masterbox dimension (Width)
masterboxDimensionH - masterbox dimension (Height)
masterboxDimensionD - masterbox dimension (Depth)
masterboxDimensionUnits - unit measure dimension of the masterbox
masterboxQty - masterbox quantity of the product
masterboxWeight - masterbox weight with the product
masterboxWeightUnits - unit measure of the masterbox weight with the product
productDimensionD - product dimension (Depth)
productDimensionW - product dimension (Width)
productDimensionH - product dimension (Height)
productDimensionUnits - unit measure of the product unit
productWeightUnits - unit measure of the product weight
productWeight - weight of the product
Curl
curl -X 'GET' \ 'https://719.eu6.ysell.pro/api/v1/product/155' \ -H 'accept: application/json' \ -H 'Authorization: Bearer 123321'
Response body
{ "id": 155, "ext_id": "p-719-155", "title": "Tequila Sunset", "condition": "New", "manufacturer_id": 1, "purchase_price": null, "netto": 0, "main_supplier": null, "listings": [], "image": "https://719.eu6.ysell.pro/product_images/150/1.jpg" }
Getting information about a product by its ID
—-
Curl
curl -X 'DELETE' \ 'https://719.eu6.ysell.pro/api/v1/product/153' \ -H 'accept: */*' \ -H 'Authorization: Bearer 123321'
Deleting product ID
Create fbm/fba lisging - it's used for Amazon lisitings creating
productId - enter product ID to add FBM/FBA listing
company_id - company ID that will be specified as listing owner
marketplace_id - marketplace ID list of marketplaces IDs
platform - marketplace that will be used for listing creating
sku - indicated SKU will be used for listing creation
asin - указанный ASIN будет использоваться при создании листинга. indicated ASIN will be used for listing creating
type - specify the listing type - FBA/FBM
title - enter ID title
price - indicate listing price
Curl
curl -X 'POST' \ 'https://719.eu6.ysell.pro/api/v1/product/set-supplier' \ -H 'accept: */*' \ -H 'Authorization: Bearer 123321' \ -H 'Content-Type: multipart/form-data' \ -F 'discount_enabled=1' \ -F 'price=11' \ -F 'discount_price=' \ -F 'product_id=155' \ -F 'supplier_id=3' \ -F 'url=google.com' \ -F 'note=Note' \ -F 'supplier_num=322' \ -F 'qty=14' \ -F 'discount_qty=' \ -F 'main=1'
Response body
{ "id": 45, "product_id": 155, "supplier_id": 3, "supplier_num": "322", "note": "Note", "url": "google.com", "qty": "14", "price": "11", "discount_enabled": "1", "discount_price": null, "discount_qty": null, "main": "1" }
Product Supplier updating
Update product Suplier - used for information updating on product supplier
product_id - indicate a product ID
supplier_id - indicate a supplier ID
supplier_num - supplier product number
price - product price
discount_price - price with a discount
discount_enabled - option is used for activating product discount. 1 - enable, 2 - disable
qty - product quantity
main - if the product supplier is main
url - link to the supplier website
note = note/memo
Supplier
Curl
curl -X 'GET' \ 'https://719.eu6.ysell.pro/api/v1/supplier' \ -H 'accept: */*' \ -H 'Authorization: Bearer '
Response body
[ { "id": 1, "name": "Nespresso DE", "memo": "" }, { "id": 2, "name": "SET", "memo": "" }, { "id": 3, "name": "A&V furniture company ", "memo": null }, { "id": 4, "name": "Test", "memo": "" }, { "id": 5, "name": "2", "memo": "" }, ]
Getting supplier list from a client
Curl
curl -X 'POST' \ 'https://719.eu6.ysell.pro/api/v1/supplier' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{ "id": 0, "name": "testSupplier2" }'
Response body
{ "id": 16, "name": "testSupplier2", "memo": null }
Creating a supplier with title testSupplier2
Curl
curl -X 'GET' \ 'https://719.eu6.ysell.pro/api/v1/supplier/322/product' \ -H 'accept: */*' \ -H 'Authorization: Bearer '
Response body
{ "id": 45, "product_id": 155, "supplier_id": 3, "supplier_num": "322", "note": "Note", "url": "google.com", "qty": 14, "price": "11.00", "discount_enabled": 1, "discount_price": null, "discount_qty": 0, "main": 1 }
Getting information on product ID by number “322”
Curl
curl -X 'PUT' \ 'https://719.eu6.ysell.pro/api/v1/supplier/3' \ -H 'accept: */*' \ -H 'Authorization: Bearer 123321' \ -H 'Content-Type: application/json' \ -d '{ "id": 0, "name": "UpdatedSupplier" }'
Response body
{ "id": 3, "name": "UpdatedSupplier", "memo": null }
Updating information on the Supplier with ID “3”
Curl
curl -X 'DELETE' \ 'https://719.eu6.ysell.pro/api/v1/supplier/3' \ -H 'accept: */*' \ -H 'Authorization: Bearer 123321' }'
Supplier deleting with ID “3”
Manufacturer
Curl
curl -X 'GET' \ 'https://719.eu6.ysell.pro/api/v1/manufacturer' \ -H 'accept: */*' \ -H 'Authorization: Bearer'
Response body
[ { "id": 1, "name": "Nespresso" }, { "id": 3, "name": "A&V furniture company " }, ]
Getting information on Manufacturers from Client
Curl
curl -X 'POST' \ 'https://719.eu6.ysell.pro/api/v1/manufacturer' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{ "id": 0, "name": "NewManufacturer" }'
Response body
{ "id": 23, "name": "NewManufacturer" }
Manufacturer creating “NewManufacturer”
Curl
curl -X 'PUT' \ 'https://719.eu6.ysell.pro/api/v1/manufacturer/22' \ -H 'accept: */*' \ -H 'Authorization: Bearer 123321' \ -H 'Content-Type: application/json' \ -d '{ "id": 0, "name": "NewManufacturer2" }'
Response body
{ "id": 22, "name": "NewManufacturer2" }
Information updating on Manufacturer with name “NewManufacturer2”
Curl
curl -X 'DELETE' \ 'https://719.eu6.ysell.pro/api/v1/manufacturer/22' \ -H 'accept: */*' \ -H 'Authorization: Bearer '
Information deleting about Manufacturer with ID “22”
Marketplace
Curl
curl -X 'GET' \ 'https://719.eu6.ysell.pro/api/v1/marketplace' \ -H 'accept: */*' \ -H 'Authorization: Bearer '
Response body
[ { "id": 1, "country_code": "GB", "currency": "GBP", "marketplace_id": "A1F83G8C2ARO7P", "url": "https://amazon.co.uk", "created_at": null, "updated_at": null, "sales_channel": "amazon.co.uk", "region": "AMAZON_EU", "endpoint": "https://mws-eu.amazonservices.com", "domain_zone": "co.uk" }, ]
Order
Operations with orders
Curl
curl -X 'GET' \ 'https://719.eu6.ysell.pro/api/v1/order?sort=o-719-67&page=1' \ -H 'accept: */*' \ -H 'Authorization: Bearer '
Curl
curl -X 'POST' \ 'https://719.eu6.ysell.pro/api/v1/order' \ -H 'accept: */*' \ -H 'Authorization: Bearer 123321' \ -H 'Content-Type: multipart/form-data' \ -F 'buyer_state=' \ -F 'buyer_phone_number=+49 421 668 9414 0' \ -F 'payment_date=2022-04-30' \ -F 'status_id=' \ -F 'buyer_country=DE' \ -F 'purchase_date=2022-04-30' \ -F 'ship_state=' \ -F 'ship_city=Bremen' \ -F 'ship_name=Gomez' \ -F 'buyer_email=gomez@gmail.com' \ -F 'currency=' \ -F 'platform=amazon' \ -F 'ship_country=DE' \ -F 'buyer_addr1=Walter-Geerdes-Str' \ -F 'buyer_postal_code=28307' \ -F 'buyer_addr2=Walter-Geerdes-Str' \ -F 'buyer_city=Bremen' \ -F 'buyer_name=Gomez' \ -F 'platform_order_id=Amazon-1' \ -F 'latest_ship_date=2022-04-30' \ -F 'ship_email=info@fulfillment-box.de' \ -F 'id=' \ -F 'company_id=719' \ -F 'ship_phone_number=+49 421 668 9414 0' \ -F 'ship_addr1=Walter-Geerdes-Str' \ -F 'ship_addr2=14' \ -F 'ship_postal_code=28307 '
POST /order Create new order - is used for creating a new order
id - order ID. If the box “Send empty value” is checked ID is generated automatically.
status_id - Status order ID. Check “Send empty value” box to set status automatically
company_id - Company ID в ysell.pro
platform - платформа для формирования заказа
platform_order_id - идентификатор заказа на платформе
purchase_date - дата приобретения заказа
payment_date - дата оплаты заказа
latest_ship_date - Окончание периода времени, в течение которого вы обязались отправить заказ
currency - валюта
ship_name - Имя получателя
ship_email - Адрес электронной почты получателя
ship_addr1 - Адрес получателя
ship_city - Город получателя
ship_postal_code - Почтовый индекс получателя
ship_country - Страна получателя заказа
ship_phone_number - Номер телефона получателя заказа
Price
Price schema operations
Prep
PrepShipments
По умолчанию все API методы возвращают 20 записей.
Обратите внимание на заголовки ответа
x-pagination-current-page: 1 - текущая страница
x-pagination-page-count: 1 - всего страниц
x-pagination-per-page: 20 - записей на страницу
x-pagination-total-count: 9 - всего записей
Для указания номера страницы укажите параметр page=НомерСтраницы