en:api_start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:api_start [2022/05/06 13:52]
artem
en:api_start [2022/06/28 15:32] (current)
simon
Line 1: Line 1:
 ====== Setting Ysell.pro through API ====== ====== Setting Ysell.pro through API ======
  
->API — application programming interface, that serves as an interface between programs and simplify their interaction. +> API (Application Programming Interface) serves as an interface between programs and simplifies their interaction. 
->Ysell provides the opportunity of working with web-services via our own API.+> Ysell offers the possibility to work with web services through our own API.
  
 ---- ----
  
->To work with the API you should specify API token for the User+> To work with the APIyou should specify an API token for the user
->>Bearer authentication is scheme of autentification of HTTP which uses markers of security, it'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> +>> Bearer authentication is an HTTP authentication scheme that uses security markers called bearer tokens. The bearer token is an encoded string that is usually generated by the server in response to request for input to the system. A client should send the token in the Authorization header while creating the request: Authorization: bearer <token>
  
 ---- ----
  
->Go to the tab of users managing (**Settings** -> **Users**) +> Go to the **Users** tab (**Settings** -> **Users**). 
->Add a new user (API token should be field with a random value)+> Add a new user (API token should be field with a random value).
 >>{{:ru:api.png?700|}} {{:ru:api_1.png?500|}} >>{{:ru:api.png?700|}} {{:ru:api_1.png?500|}}
  
 +> Go to **Settings - ysell API**
 +>>{{:ru:apwi.png?600|}}
 +
 +----
 +
 +> Authorize with the API token by clicking **Authorize**. Enter **Bearer** and //generated API key// in the authentication string.
 +>>{{:ru:api_23.png?600|}} {{:ru:apibearer_2.png?600|}}
  
 ---- ----
Line 57: Line 64:
   },   },
  </code>  </code>
-//Getting products list of the client//+//Retrieving the customer's product list//
 </WRAP> </WRAP>
->**Get products list** Getting products list of the client  +>**Get products list** Retrieving the customer's product list  
-> **Page** parameter - specify the page that importing is going from  +> **Page** parameter - Specify the page from which the import is done  
-> **Per-page** - Quantity of products per page+> **Per-page** - Number of products per page
 >{{:ru:api_2.png?900|}} >{{:ru:api_2.png?900|}}
 > >
Line 124: Line 131:
 } }
  </code>  </code>
-//Creation a product with ID 155 that'named Tequila Sunset with indicating product dimensions, package dimension and product image.//+//Creation of a product with ID 155 named Tequila Sunset, specifying the product dimensions, packaging size and product image.//
 </WRAP> </WRAP>
->**id** - product ID  +>**id** - Product ID  
 >**ext_id** - **Product ID** of the product. >**ext_id** - **Product ID** of the product.
 >**title** - Product title. >**title** - Product title.
->**product_image** - link to the product image.+>**product_image** - Link to the product image.
 >**manufacturer_id** - ID from previously created product manufacturers. >**manufacturer_id** - ID from previously created product manufacturers.
->**packageDimensionW** - package dimensions of the product (Width)  +>**packageDimensionW** - Package dimensions of the product (Width). 
->**packageDimensionH** - package dimensions of the product (Height) +>**packageDimensionH** - Package dimensions of the product (Height). 
->**packageDimensionD** - package dimensions of the product (Depth) +>**packageDimensionD** - Package dimensions of the product (Depth). 
->**packageDimensionUnits** - unit measure of the package +>**packageDimensionUnits** - Unit measure of the package. 
->**packageWeight** - weight of the package +>**packageWeight** - Weight of the package. 
->**packageWeightUnits** - unit measure of the product weight +>**packageWeightUnits** - Unit measure of the product weight. 
->**masterboxDimensionW** - masterbox dimension (Width) +>**masterboxDimensionW** - Masterbox dimension (Width). 
->**masterboxDimensionH** - размеры коробки с товаром (Высота+>**masterboxDimensionH** - Masterbox dimension (Height). 
->**masterboxDimensionD** - размеры коробки с товаром (Глубина+>**masterboxDimensionD** - Masterbox dimension (Depth). 
->**masterboxDimensionUnits** - единицы измерения для коробки с товаром +>**masterboxDimensionUnits** - Unit measurement dimension of the masterbox. 
->**masterboxQty** - кол-во товара в Masterbox +>**masterboxQty** - Masterbox quantity of the product.  
->**masterboxWeight** - вес коробки с товаром +>**masterboxWeight** - Masterbox weight with the product.  
->**masterboxWeightUnits** - единицы измерения веса коробки с товаром +>**masterboxWeightUnits** - Unit of measurement for the weight of the master box with the product. 
->**productDimensionD** - размеры единицы товара (Глубина+>**productDimensionD** -  Product dimension (Depth). 
->**productDimensionW** - размеры единицы товара (Ширина+>**productDimensionW** - Product dimension (Width). 
->**productDimensionH** - размеры единицы товара (Высота+>**productDimensionH** - Product dimension (Height). 
->**productDimensionUnits** - единицы измерения размера единицы товара +>**productDimensionUnits** - Unit of measurement of the product unit. 
->**productWeightUnits** - единицы измерения веса единицы товара +>**productWeightUnits** - Unit of measurement for the weight of the product. 
->**productWeight** - вес единицы товара.+>**productWeight** - Weight of the product.
 >>{{:ru:api_3.png?780|}} >>{{:ru:api_3.png?780|}}
  
Line 177: Line 184:
 } }
  </code>  </code>
-//Получение информации о товаре по его идентификатору.//+//Retrieve information about a product by its ID//
 </WRAP> </WRAP>
->**Find Product by ID** - используется для получение информации о конкретном товаре.+>**Find Product by ID** - is used to obtain information about a product based on its ID.
 > >
->**productId** - укажите ID товара. +>**productId** - indicate the product ID 
 >{{:ru:api_4.png?850|}} >{{:ru:api_4.png?850|}}
 > >
Line 195: Line 202:
  
  
->**Update product** - используйте для редактирования ранее созданных ID товараВ блоке **Request body** укажите информацию для редактирования+>**Update product** - is used for editing the previously created ID of the productSpecify the information to be edited in the **Request body** block.
 > >
->**productId** - введите ID товара.+>**productId** - enter a product ID.
 >{{:ru:api_5.png?900|}} >{{:ru:api_5.png?900|}}
  
Line 209: Line 216:
   -H 'Authorization: Bearer  123321'   -H 'Authorization: Bearer  123321'
 </code> </code>
-//Удаление ID товара//+//Deleting product ID//
 </WRAP> </WRAP>
->**Delete Product** - используйте для удаления ID товара.+>**Delete Product** - is used to delete the product ID.
 >>{{:ru:api_6.png?600|}} >>{{:ru:api_6.png?600|}}
  
 ---- ----
  
->**Create fbm/fba lisging** - используйте для создания листингов Амазон+>**Create fbm/fba lisging** - is used for the creation of Amazon listings
->**productId** - введите ID товара для добавления fbm/fba листинга+>**productId** - Enter product ID to add FBM/FBA listing
->**company_id** - ID компании, которая будет указана как владелец листинга+>**company_id** - Company ID specified as the owner of the list
->**marketplace_id** - ID торговой площадки [[https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html|Список ID маркетплейсов]] +>**marketplace_id** - Marketplace ID [[https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html|list of marketplaces IDs]]. 
->**platform** - маркетплейс, который будет использоваться для формирования листинга+>**platform** - Marketplace used for the creation of offers
->**sku** - указанный SKU будет использоваться при создании листинга+>**sku** - The specified SKU will be used to create the list
->**asin** - указанный ASIN будет использоваться при создании листинга+>**asin** - The specified ASIN will be used to create the list
->**type** - укажите тип листинга - FBA/FBM +>**type** - Specify the listing type - FBA/FBM. 
->**title** - укажите название ID +>**title** - Enter ID title. 
->**price** - укажите цену листинга.+>**price** - Specify list price.
 >>{{:ru:api_7.png?800|}} >>{{:ru:api_7.png?800|}}
  
Line 267: Line 274:
 } }
  </code>  </code>
-//Обновление Supplier товара//+//Product supplier update//
 </WRAP> </WRAP>
  
->**Update product Suplier** - используется для обновления информации о поставщике товара+>**Update product Suplier** - Is used for updating the information about the product supplier.
 > >
->**product_id** - укажите ID товара+>**product_id** - Indicate a product ID. 
->**supplier_id** - укажите ID поставщика+>**supplier_id** - Indicate dicate a supplier ID. 
->**supplier_num** - номер товара у поставщика +>**supplier_num** - Supplier product number. 
->**price** - цена товара +>**price** - Product price. 
->**discount_price** - цена со скидкой +>**discount_price** - Price with discount. 
->**discount_enabled** - опция для включения скидочной цены. 1 - включить. 0 отключить+>**discount_enabled** - Is used to activate the product discount. 1 - activate, 2 deactivate.  
->**qty** - кол-во товара+>**qty** - product quantity.  
->**main** - является ли поставщик основным +>**main** - if the product supplier is the main supplier. 
->**url** - ссылка на сайт постащика +>**url** - Link to the website of the supplier. 
->**note** = примечание.+>**note** = note/memo
  
 >>{{:ru:api_8.png?700|}} >>{{:ru:api_8.png?700|}}
Line 325: Line 332:
 ] ]
 </code> </code>
-//Получение списка поставщиков с клиента//+//Receive supplier list from a customer //
 </WRAP> </WRAP>
->//Операции с поставщиками//+>//Operations with suppliers//
 > >
-> /supplier Return all supplier - возвращает список поставщиков с клиента+> /supplier Return all supplier - returns the supplier list of a customer.
 > >
 >{{:ru:api_12.png?750|}} >{{:ru:api_12.png?750|}}
Line 370: Line 377:
 } }
 </code> </code>
-//Создание поставщика с названием testSupplier2//+//Create a supplier with the title testSupplier2//
 </WRAP> </WRAP>
  
 ---- ----
  
->Post /Supplier Create new supplier+POST /Supplier to create a new supplier
 > >
->Укажите название поставщика. ID поставщика будет присвоено автоматически. +Specify supplier nameSupplier ID will be assigned automatically
 >{{:ru:api_13.png?800|}} >{{:ru:api_13.png?800|}}
  
Line 407: Line 414:
 } }
 </code> </code>
-//Получение информации по ID товара по номеру поставщика "322"//+//Retrieve information about the product ID with the number "322//
 </WRAP> </WRAP>
 > >
Line 413: Line 420:
 > >
 > >
->GET /supplier/{supplierNum}/product Find product by supplier num - используйте для возврата информации ID товара по номеру поставщика+>GET /supplier/{supplierNum}/product Find product by supplier num - is used for returning ID information by supplier number.
 > >
 >{{:ru:api_14.png?750|}} >{{:ru:api_14.png?750|}}
Line 445: Line 452:
 } }
 </code> </code>
-//Обновление информации о поставщике с ID "3"//+//Updating information on the Supplier with ID "3"//
 </WRAP> </WRAP>
->PUT /supplier/{supplierID} Update Supplier используйте для редактирования информации о поставщике.+GET /supplier/{supplierID} Update Supplier for information editing on Supplier.
 > >
->**supplierId** - укажите идентификатор поставщика+>**supplierId** - specify supplier ID
 >{{:ru:api_15.png?780|}} >{{:ru:api_15.png?780|}}
  
Line 463: Line 470:
 }' }'
 </code> </code>
-//Удаление поставщика с ID "3"//+//Deletion of the supplier with ID "3//
 </WRAP> </WRAP>
 > >
->Delete /supplier/{supplierID} - используйте для удаления информации о поставщике+>Delete /supplier/{supplierID} - is used to delete information about suppliers
->**supplierId** - Идентификатор поставщика.+>**supplierId** - Supplier ID
 >{{:ru:api_16.png?600|}} >{{:ru:api_16.png?600|}}
  
Line 493: Line 500:
 ] ]
 </code> </code>
-//Получение информации о производителях с клиента//+//Receive information about the manufacturer from the customer//
 </WRAP> </WRAP>
  
->Операции с производителями+>Operations with Manufacturers
 > >
->GET /manufacturer Return all manufacturers - Используется для возврата информации о производителях с клиента.+>GET /manufacturer Return all manufacturers - is used for returning information on Manufacturers from Client
 >{{:ru:api_17.png?750|}} >{{:ru:api_17.png?750|}}
 > >
Line 527: Line 534:
 } }
 </code> </code>
-//Создание производителя "NewManufacturer"//+//Manufacturer created "NewManufacturer"//
 </WRAP> </WRAP>
 > >
->Post /maufacturer Create new Manufacturer +>POST /maufacturer Create new Manufacturer 
 > >
->Введите в строку "name" название производителя. ID производителя будет присвоен автоматически.+>Enter a name of Manufacturer in the "Namefield. ID of Manufacturer will be assigned automatically.
 > >
 >{{:ru:api_18.png?700|}} >{{:ru:api_18.png?700|}}
Line 559: Line 566:
 </code> </code>
  
-//Обновление информации о производителе с названием "NewManufacturer" - присвоение названия "NewManufacturer2"//+//Updating the information about the manufacturer named "NewManufacturer2"//
 </WRAP> </WRAP>
->PUT /manufacturer/{manufacturerID} Update Manufacturer - Используйте для редактирования информация о поставщике+>PUT /manufacturer/{manufacturerID} Update Manufacturer - Updating the information about the manufacturer named "NewManufacturer2".
 > >
->manufacturerId - укажите ID производителя+>manufacturerId - specify Manufacturer ID. 
->В строке "Name" укажите название производителя.+>Specify the name of the Manufacturer in the "Name" field.
 > >
 >{{:ru:api_19.png?700|}} >{{:ru:api_19.png?700|}}
Line 577: Line 584:
   -H 'Authorization: Bearer '   -H 'Authorization: Bearer '
 </code> </code>
-//Удаление информации о производителе с ID "22"//+//Deleting information about the manufacturer with ID "22"//
 </WRAP> </WRAP>
  
Line 613: Line 620:
 </WRAP> </WRAP>
  
->//Операции с торговыми площадками//+>//Operations with marketplaces//
 > >
->GET /marketplace Return all marketplaces - возвращает информацию о подключенных к клиенту маркетплейсах+>GET /marketplace Return all marketplaces - Provides information about the connection to the customer marketplaces.
 > >
 >{{:ru:api_21.png?600|}} >{{:ru:api_21.png?600|}}
Line 629: Line 636:
 ---- ----
  
-====== Order ======+====== Orders ======
  
->//Операции с заказами//+>//Operations with orders//
 <WRAP right box 35%> <WRAP right box 35%>
 **Curl** **Curl**
Line 642: Line 649:
 </WRAP> </WRAP>
 > >
->Get /order Returns order - используется для получения информации о заказе+>Get /order Returns order - is used to receive information about the order.
 > >
 >{{:ru:api_22.png?600|}} >{{:ru:api_22.png?600|}}
Line 683: Line 690:
   -F 'ship_postal_code=28307 '</code>   -F 'ship_postal_code=28307 '</code>
 </WRAP> </WRAP>
->POST /order Create new order - используется для создания заказов.+>POST /order Create new order - is used for the creation of a new order.
 > >
->id - Идентификатор заказаПри наличии чек-бокса Send empty value, идентификатор генерируется автоматически.+>id - order IDIf the box "Send empty value" is checkedthe ID is generated automatically
 > >
->status_id - [[ru:orderdescription|Status ID]] заказаАктивный чек-бокс Send empty value проставляет статус автоматически+>status_id - [[en:orderdescription|Status order ID]]. Check "Send empty value" box to set status automatically.
 > >
->company_id - [[ru:comp|ID компании]] в ysell.pro+>company_id - [[en:comp|Company ID]] on ysell.pro.
 > >
->platform - платформа для формирования заказа+>platform - Platform used for order creation.
 > >
->platform_order_id - идентификатор заказа на платформе+>platform_order_id - Order ID on the platform.
 > >
->purchase_date - дата приобретения заказа+>purchase_date - Order purchase date.
 > >
->payment_date - дата оплаты заказа+>payment_date - Order payment date.
 > >
->latest_ship_date - Окончание периода времени, в течение которого вы обязались отправить заказ+>latest_ship_date - The last period for sending the order. 
 > >
->currency - валюта+>currency - Currency.
 > >
->ship_name - Имя получателя+>ship_name - Recipient name.
 > >
->ship_email - Адрес электронной почты получателя+>ship_email - Recipient e-mail address.
 > >
->ship_addr1 - Адрес получателя+>ship_addr1 - Recipient address. 
 > >
->ship_city - Город получателя+>ship_city - Recipient City.
 > >
->ship_postal_code - Почтовый индекс получателя+>ship_postal_code - Recipient Postal Code.
 > >
->ship_country - Страна получателя заказа+>ship_country - Recipient Country.
 > >
->ship_phone_number - Номер телефона получателя заказа+>ship_phone_number - Recipient phone number
  
 ---- ----
 +<WRAP right box>
 +**Curl**
 +<code>
 +curl -X 'GET' \
 +  'https://719.eu6.ysell.pro/api/v1/order/75' \
 +  -H 'accept: */*' \
 +  -H 'Authorization: Bearer '
 +</code>
 +//Get information about the order with ID 75//
 +</WRAP>
 +>GET /order/{ID} Return order by ID - is used for return information on the order
 +>
 +>ID - indicate order ID
 +>
 +> {{:ru:api_25.png?600|}}
  
-====== Price ====== +---- 
->Price schema operations+<WRAP right box> 
 +**Curl** 
 +<code> 
 +curl -X 'DELETE'
 +  'https://719.eu6.ysell.pro/api/v1/order/60'
 +  -H 'accept: */*' \ 
 +  -H 'Authorization: Bearer ' 
 +</code> 
 +//Deleting the order with ID 75// 
 +</WRAP> 
 +>Delete /order/{ID} Delete Order by ID - is used to delete orders. 
 +
 +>ID - enter order ID 
 +
 +>{{:ru:api_26.png?600|}}
  
-====== Prep ======+----
  
-====== PrepShipments ======+<WRAP right box> 
 +**Curl** 
 +<code> 
 +curl -X 'POST'
 +  'https://719.eu6.ysell.pro/api/v1/order-item'
 +  -H 'accept: */*' \ 
 +  -H 'Authorization: Bearer ' \ 
 +  -H 'Content-Type: multipart/form-data'
 +  -F 'p_id=155' \ 
 +  -F 'order_id=70' \ 
 +  -F 'shipment_items_cost=20' \ 
 +  -F 'qty=15' \ 
 +  -F 'asin=TestAsin'
 +  -F 'id=' \ 
 +  -F 'product_name=TestName'
 +  -F 'item_price=15' \ 
 +  -F 'sku=TestSKU' 
 +</code> 
 +**Response body** 
 +<code> 
 +
 +  "id": 147, 
 +  "order_id": "70", 
 +  "sku": "TestSKU", 
 +  "qty": "15", 
 +  "image": "https://719.eu6.ysell.pro/product_images/155/51yLgO1l4xL (1).jpg", 
 +  "item_price": "15", 
 +  "unit_price": null, 
 +  "product_id": null, 
 +  "item_type": "product" 
 +
 + </code> 
 +//Adding a product to the order with ID 70// 
 +</WRAP> 
 +>Post /order-item Create new order item - is used for adding positions to the order. 
 +
 +>**order_id** - Enter order ID. 
 +
 +>**asin** - ASIN of the product. 
 +
 +>**p_id** - Product ID. 
 +
 +>**product_name** - Name of the product. 
 +
 +>**sku** - SKU of the product. 
 +
 +>**qty** - Quantity of product in the order. 
 +
 +>**item_price** - Price of a unit. 
 +>{{:ru:api_27.png?600|}}
  
 +----
  
 +====== Shipments ======
  
-<WRAP center round important 80%+>//Operations with shipments// 
-По умолчанию все API методы возвращают **20 записей**.+<WRAP right box
 +**Curl** 
 +<code> 
 +curl -X 'GET'
 +  'https://719.eu6.ysell.pro/api/v1/prep-shipment?page=1&per-page=10&sort=1'
 +  -H 'accept: */*' \ 
 +  -H 'Authorization: Bearer 123321' 
 +</code> 
 +**Response body** 
 +<code> 
 +
 +    "id": 1, 
 +    "company_id": 719, 
 +    "shipment_num": "719-1", 
 +    "shipment_type": "warehouse", 
 +    "shipment_type_description": "Send to the warehouse", 
 +    "status": 0, 
 +    "status_description": "New", 
 +    "total_cost": 0, 
 +    "declared_qty": 211, 
 +    "declared_box_qty": 0, 
 +    "processed_qty": 0, 
 +    "messages": [] 
 +  }, 
 + </code> 
 +//Information about shipment 719-1// 
 +</WRAP> 
 +>**GET /prep-shipment Get prep shipment list** -  is used to receive information about the shipment from the Prep Center. 
 +
 +>**company_id** - Company ID. 
 +
 +>**shipment_num** - Number of the shipment. 
 +
 +>**shipment_type** - Type of the shipment. 
 +
 +>**shipment_type_description** - Description of the shipment type. 
 +
 +>**status** - Status of the shipment. 
 +
 +>**status_description** - Description of the shipment status. 
 +
 +>**total_cost** - Price for processing the shipment. 
 +
 +>**declared_qty** - Quantity of product units specified by the customer. 
 +
 +>**declared_box_qty** - Number of cartons with the product specified by the customer. 
 +
 +>**processed_qty** - Quantity of product processed by the Prep Center. 
 +
 +>**messages** - Dispatch notification.
  
-Обратите внимание на заголовки ответа  
  
- **x-pagination-current-page**: 1  - текущая страница 
- 
- **x-pagination-page-count**: 1 - всего страниц 
- 
-** x-pagination-per-page**: 20  - записей на страницу 
- 
- **x-pagination-total-count**: 9  - всего записей 
- 
-Для указания номера страницы укажите параметр **page=НомерСтраницы** 
-</WRAP> 
  
  • en/api_start.1651837922.txt.gz
  • Last modified: 2022/05/06 13:52
  • by artem