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/10 18: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** - masterbox dimension (Height) +>**masterboxDimensionH** - Masterbox dimension (Height). 
->**masterboxDimensionD** - masterbox dimension (Depth) +>**masterboxDimensionD** - Masterbox dimension (Depth). 
->**masterboxDimensionUnits** - unit measure dimension of the masterbox +>**masterboxDimensionUnits** - Unit measurement dimension of the masterbox. 
->**masterboxQty** - masterbox quantity of the product  +>**masterboxQty** - Masterbox quantity of the product 
->**masterboxWeight** - masterbox weight with the product  +>**masterboxWeight** - Masterbox weight with the product 
->**masterboxWeightUnits** - unit measure of the masterbox weight with the product +>**masterboxWeightUnits** - Unit of measurement for the weight of the master box with the product. 
->**productDimensionD** -  product dimension (Depth) +>**productDimensionD** -  Product dimension (Depth). 
->**productDimensionW** - product dimension (Width) +>**productDimensionW** - Product dimension (Width). 
->**productDimensionH** - product dimension (Height) +>**productDimensionH** - Product dimension (Height). 
->**productDimensionUnits** - unit measure of the product unit +>**productDimensionUnits** - Unit of measurement of the product unit. 
->**productWeightUnits** - unit measure of the product weight +>**productWeightUnits** - Unit of measurement for the weight of the product. 
->**productWeight** - weight of the product+>**productWeight** - Weight of the product.
 >>{{:ru:api_3.png?780|}} >>{{:ru:api_3.png?780|}}
  
Line 177: Line 184:
 } }
  </code>  </code>
-//Getting information about a product by its ID//+//Retrieve information about a product by its ID//
 </WRAP> </WRAP>
->**Find Product by ID** - it'used for getting information about a product by it'ID+>**Find Product by ID** - is used to obtain information about a product based on its ID.
 > >
 >**productId** - indicate the product ID  >**productId** - indicate the product ID 
Line 195: Line 202:
  
  
->**Update product** - It'used for editing previosly created ID of the product. Specify information for editing on the **Request body** block+>**Update product** - is used for editing the previously created ID of the product. Specify the information to be edited in the **Request body** block.
 > >
->**productId** - enter a product ID+>**productId** - enter a product ID.
 >{{:ru:api_5.png?900|}} >{{:ru:api_5.png?900|}}
  
Line 211: Line 218:
 //Deleting product ID// //Deleting product ID//
 </WRAP> </WRAP>
->**Delete Product** - it'used for deleting 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** - it'used for Amazon lisitings creating +>**Create fbm/fba lisging** - is used for the creation of Amazon listings. 
->**productId** - enter product ID to add FBM/FBA listing +>**productId** - Enter product ID to add FBM/FBA listing. 
->**company_id** - company ID that will be specified as listing owner +>**company_id** - Company ID specified as the owner of the list. 
->**marketplace_id** - marketplace ID [[https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html|list of marketplaces IDs]] +>**marketplace_id** - Marketplace ID [[https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html|list of marketplaces IDs]]. 
->**platform** - marketplace that will be used for listing creating +>**platform** - Marketplace used for the creation of offers. 
->**sku** - indicated SKU will be used for listing creation +>**sku** - The specified SKU will be used to create the list. 
->**asin** - указанный ASIN будет использоваться при создании листинга. indicated ASIN will be used for listing creating  +>**asin** - The specified ASIN will be used to create the list. 
->**type** - specify the listing type - FBA/FBM +>**type** - Specify the listing type - FBA/FBM. 
->**title** - enter ID title +>**title** - Enter ID title. 
->**price** - indicate listing price+>**price** - Specify list price.
 >>{{:ru:api_7.png?800|}} >>{{:ru:api_7.png?800|}}
  
Line 267: Line 274:
 } }
  </code>  </code>
-//Product Supplier updating//+//Product supplier update//
 </WRAP> </WRAP>
  
->**Update product Suplier** - used for information updating on product supplier +>**Update product Suplier** - Is used for updating the information about the product supplier.
 > >
->**product_id** - indicate a product ID +>**product_id** - Indicate a product ID. 
->**supplier_id** - indicate a supplier ID +>**supplier_id** - Indicate dicate a supplier ID. 
->**supplier_num** - supplier product number +>**supplier_num** - Supplier product number. 
->**price** - product price +>**price** - Product price. 
->**discount_price** - price with discount +>**discount_price** - Price with discount. 
->**discount_enabled** - option is used for activating product discount. 1 - enable, 2 - disable  +>**discount_enabled** - Is used to activate the product discount. 1 - activate, 2 - deactivate.  
->**qty** - product quantity  +>**qty** - product quantity 
->**main** - if the product supplier is main  +>**main** - if the product supplier is the main supplier. 
->**url** - link to the supplier website+>**url** - Link to the website of the supplier.
 >**note** = note/memo >**note** = note/memo
  
Line 325: Line 332:
 ] ]
 </code> </code>
-//Getting supplier list from a client//+//Receive supplier list from a customer //
 </WRAP> </WRAP>
 >//Operations with suppliers// >//Operations with suppliers//
 > >
-> /supplier Return all supplier - returns supplier list from client+> /supplier Return all supplier - returns the supplier list of customer.
 > >
 >{{:ru:api_12.png?750|}} >{{:ru:api_12.png?750|}}
Line 370: Line 377:
 } }
 </code> </code>
-//Creating a supplier with title testSupplier2//+//Create a supplier with the title testSupplier2//
 </WRAP> </WRAP>
  
 ---- ----
  
->Post /Supplier Create new supplier+POST /Supplier to create a new supplier
 > >
->Specify supplier name. Supplier ID will be assigned automatically+> Specify supplier name. Supplier ID will be assigned automatically
 >{{:ru:api_13.png?800|}} >{{:ru:api_13.png?800|}}
  
Line 407: Line 414:
 } }
 </code> </code>
-//Getting information on product ID by number "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 - used for returning ID information by Supplier number+>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 447: Line 454:
 //Updating information on the Supplier with ID "3"// //Updating information on the Supplier with ID "3"//
 </WRAP> </WRAP>
->PUT /supplier/{supplierID} Update Supplier used for information editing on Supplier +GET /supplier/{supplierID} Update Supplier  - for information editing on Supplier.
 > >
 >**supplierId** - specify supplier ID >**supplierId** - specify supplier ID
Line 463: Line 470:
 }' }'
 </code> </code>
-//Supplier deleting with ID "3"//+//Deletion of the supplier with ID "3//
 </WRAP> </WRAP>
 > >
->Delete /supplier/{supplierID} - used for deleting information about Supplier+>Delete /supplier/{supplierID} - is used to delete information about suppliers.
 >**supplierId** - Supplier ID >**supplierId** - Supplier ID
 >{{:ru:api_16.png?600|}} >{{:ru:api_16.png?600|}}
Line 493: Line 500:
 ] ]
 </code> </code>
-//Getting information on Manufacturers from Client//+//Receive information about the manufacturer from the customer//
 </WRAP> </WRAP>
  
 >Operations with Manufacturers >Operations with Manufacturers
 > >
->GET /manufacturer Return all manufacturers -  used for returning information on Manufacturers from Client+>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>
-//Manufacturer creating "NewManufacturer"//+//Manufacturer created "NewManufacturer"//
 </WRAP> </WRAP>
 > >
->Post /maufacturer Create new Manufacturer +>POST /maufacturer Create new Manufacturer 
 > >
 >Enter a name of Manufacturer in the "Name" field. ID of Manufacturer will be assigned automatically. >Enter a name of Manufacturer in the "Name" field. ID of Manufacturer will be assigned automatically.
Line 559: Line 566:
 </code> </code>
  
-//Information updating on Manufacturer with name "NewManufacturer2"//+//Updating the information about the manufacturer named "NewManufacturer2"//
 </WRAP> </WRAP>
->PUT /manufacturer/{manufacturerID} Update Manufacturer - used for information editing on Manufacturer+>PUT /manufacturer/{manufacturerID} Update Manufacturer - Updating the information about the manufacturer named "NewManufacturer2".
 > >
->manufacturerId - specify Manufacturer ID +>manufacturerId - specify Manufacturer ID. 
->Specify name of Manufacturer in the "Name" field.+>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>
-//Information deleting about Manufacturer with ID "22"//+//Deleting information about the manufacturer with ID "22"//
 </WRAP> </WRAP>
  
Line 615: Line 622:
 >//Operations with marketplaces// >//Operations with marketplaces//
 > >
->GET /marketplace Return all marketplaces - returns information on connected to the Client 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// >//Operations with orders//
Line 642: Line 649:
 </WRAP> </WRAP>
 > >
->Get /order Returns order - is used for getting information on 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 - is used for creating a new order+>POST /order Create new order - is used for the creation of a new order.
 > >
->id - order ID. If the box "Send empty value" is checked ID is generated automatically. +>id - order ID. If the box "Send empty value" is checked, the ID is generated automatically. 
 > >
->status_id - [[en:orderdescription|Status order ID]]. Check "Send empty value" box to set status automatically+>status_id - [[en:orderdescription|Status order ID]]. Check "Send empty value" box to set status automatically.
 > >
->company_id - [[en:comp|Company 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.1652201556.txt.gz
  • Last modified: 2022/05/10 18:52
  • by artem