API Documentation
7/24/2024, 9:25:05 AM

Once released, Api Product Management becomes available at seller level 54.
You'll be able to get your API key through your profile settings.

Authentication

All routes require authentication using a Bearer token in the Authorization header:

Authorization: Bearer <your_api_key>

Routes

Edit Product

Edit an existing product's details.

  • Endpoint:/api/product/edit

  • Method: POST

    Request Body:

{
  "id": "product_id",
  "title": "New Product Title",
  "description": "New product description",
  "price": 10.9
}

All fields except id are optional. Only include the fields you want to update.

Response:

  • 200 OK: Product updated successfully

  • 400 Bad Request: Invalid input

  • 401 Unauthorized: Missing or invalid token

  • 403 Forbidden: Product not found or doesn't belong to the user

Get Product

Retrieve details of a specific product.

  • Endpoint:/api/product/get

  • Method: POST

Request Body:

{
  "id": "product_id"
}

Response:

  • 200 OK: Returns product details

  • 400 Bad Request: Missing product ID

  • 401 Unauthorized: Missing or invalid token

  • 403 Forbidden: Product not found or doesn't belong to the user

Get All Products

Retrieve all products belonging to the authenticated user.

  • Endpoint:/api/product/all

  • Method: POST

  • Request Body: Empty

Response:

  • 200 OK: Returns an array of product objects

  • 401 Unauthorized: Missing or invalid token

  • 403 Forbidden: No products found

Error Handling

All routes return appropriate HTTP status codes and error messages in case of failures.