en:api_start

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>

Go to the tab of users managing (SettingsUsers)
Add a new user (API token should be field with a random value)

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

Get products list - getting products list of the client
Page parameter - specify the page that importing is going from
Per-page - quantity of products per page










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

Find Product by ID - is used for getting information about a product by it's ID

productId - indicate the product ID









—-

Update product - is used for editing previosly created ID of the product. Specify information for editing on the Request body block

productId - enter a product ID

Curl

curl -X 'DELETE' \
  'https://719.eu6.ysell.pro/api/v1/product/153' \
  -H 'accept: */*' \
  -H 'Authorization: Bearer  123321'

Deleting product ID

Delete Product - is used for deleting product ID

Create fbm/fba lisging - is used for creating Amazon lisitings
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 creating listing
sku - indicated SKU will be used for listing creation
asin - indicated ASIN will be used for listing creation
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 - is 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

Operations with suppliers

/supplier Return all supplier - returns 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


Post /Supplier Create new supplier

Specify supplier name. Supplier ID will be assigned automatically

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”





GET /supplier/{supplierNum}/product Find product by supplier num - is used for returning ID information by Supplier number







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”

PUT /supplier/{supplierID} Update Supplier - is used for information editing on Supplier

supplierId - specify supplier ID

Curl

curl -X 'DELETE' \
  'https://719.eu6.ysell.pro/api/v1/supplier/3' \
  -H 'accept: */*' \
  -H 'Authorization: Bearer 123321'
}'

Supplier deleting with ID “3”


Delete /supplier/{supplierID} - is used for deleting information about Supplier
supplierId - Supplier ID

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

Operations with Manufacturers

GET /manufacturer Return all manufacturers - is used for returning 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”


Post /maufacturer Create new Manufacturer

Enter a name of Manufacturer in the “Name” field. ID of Manufacturer will be assigned automatically.


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”

PUT /manufacturer/{manufacturerID} Update Manufacturer - is used for information editing on Manufacturer

manufacturerId - specify Manufacturer ID
Specify name of Manufacturer in the “Name” field.


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”

Delete /manufacturer/{manufacturerID} Delete Manufacturer

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"
  },
 ]
Operations with marketplaces

GET /marketplace Return all marketplaces - returns information on connected to the Client marketplaces










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 '

Get /order Returns order - is used for getting information on order


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 on ysell.pro

platform - platform that will be used for order creation

platform_order_id - order Id on the platform

purchase_date - order purchase date

payment_date - order payment date

latest_ship_date - the last time period for order sending

currency - currency

ship_name - receiver's name

ship_email - receiver's email address

ship_addr1 - reciever's address

ship_city - receiver's city

ship_postal_code - receiver's postal code

ship_country - receiver's country

ship_phone_number - receiver's phone number

Curl

curl -X 'GET' \
  'https://719.eu6.ysell.pro/api/v1/order/75' \
  -H 'accept: */*' \
  -H 'Authorization: Bearer '

Getting information on the order with ID 75

GET /order/{ID} Return order by ID - is used for return information on the order

ID - indicate order ID


Curl

curl -X 'DELETE' \
  'https://719.eu6.ysell.pro/api/v1/order/60' \
  -H 'accept: */*' \
  -H 'Authorization: Bearer '

Getting information on the order with ID 75

Delete /order/{ID} Delete Order by ID - is used for order deleting

ID - enter order ID


Curl

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'

Response body

{
  "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"
}
 

Adding product to order with ID 70

Post /order-item Create new order item - is used for adding position to the order

order_id - indicate 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

Shipments

Operations with shipments

Curl

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'

Response body

{
    "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": []
  },
 

Getting information on shipment 719-1

GET /prep-shipment Get prep shipment list - используется получения информации о отправке с Преп-центра. is used for getting information on 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 shiment status

total_cost - price for the shipment processing

declared_qty - quantity of product units indicated by client

declared_box_qty - quantity of boxes with product indicated by client

processed_qty - quantity of product processed by the Prep Center

messages - text of memo to shipment

Price

Price schema operations

Prep

PrepShipments

All of API methods returns 20 entries

Pay attention to the answer header

x-pagination-current-page: 1 - current page

x-pagination-page-count: 1 - general page quantity

x-pagination-per-page: 20 - entries per page

x-pagination-total-count: 9 - general entries quantity

To indicate page number specify page parameter

  • en/api_start.1653552226.txt.gz
  • Last modified: 2022/05/26 10:03
  • by artem