Skip to content

Latest commit

 

History

History
314 lines (256 loc) · 3.87 KB

File metadata and controls

314 lines (256 loc) · 3.87 KB

Merinozky Management App API Documentation

Authentication

All API endpoints require authentication. Use Bearer token authentication by including the following header:

Authorization: Bearer <your-token>

Base URL

/api/v1/

Products API

List Products

GET /products/

Returns a list of all products.

Get Single Product

GET /products/{code}/

Returns details of a specific product.

Create Product

POST /products/

Create a new product.

Update Product

PUT /products/{code}/

Update an existing product.

Delete Product

DELETE /products/{code}/

Delete a product.

Adjust Product Stock

POST /products/{code}/adjust_stock/

Adjust stock level for a product.

Request body:

{
    "adjustment_quantity": 10
}

Product Variants API

List Variants

GET /variants/

Returns a list of all product variants.

Get Single Variant

GET /variants/{code}/

Returns details of a specific variant.

Create Variant

POST /variants/

Create a new product variant.

Update Variant

PUT /variants/{code}/

Update an existing variant.

Delete Variant

DELETE /variants/{code}/

Delete a variant.

Adjust Variant Stock

POST /variants/{code}/adjust_stock/

Adjust stock level for a variant.

Request body:

{
    "adjustment_quantity": 10
}

Stock Adjustment

POST /stock-adjustments/

Request body for single product using code or id:

{
    "product_code":"P00018",
    "adjustment_quantity": 99
}
{
    "product":1,
    "adjustment_quantity": 99
}

Request body for single variant using code or id:

{
    "variant_code":"P00018-5",
    "adjustment_quantity": 99
}
{
    "variant":1,
    "adjustment_quantity": 5
}

bulk adjustment for given products and variants

Request body for single variant using code:

[
{
    "variant_code":"P00018-5",
    "adjustment_quantity": 5
},
{
    "product_code":"P00018",
    "adjustment_quantity": -18
},
{
    "variant":1,
    "adjustment_quantity": 5
},
{
    "product":1,
    "adjustment_quantity": 99
}
]

Orders API

List Orders

GET /orders/

Returns a list of all orders.

Get Single Order

GET /orders/{id}/

Returns details of a specific order including its items.

Update Order

PUT /orders/{id}/

Update an existing order.

Update Order partialy

PATCH /orders/{id}/

Request body for single order change:

{
    "uma_status": "packed"
}

Update status of item

PATCH /api/v1/orders/{id}/items/{itemid}/status/

Request body

{
 "uma_picked": "picked"
}

Sync requests

Orders Sync from API

POST /api/v1/sync

Request body

{
 "type": "orders"
}

Orders Sync Status to API

POST /api/v1/sync

Request body

{"type":"orders_status",
"orderids": [3,4],
"statusid": 21
}

Products Sync from API

POST /api/v1/sync

Request body

{"type":"products_simple",
"codes":"P00147-5;P00170"
}

Products Full Load XML

POST /api/v1/sync

Request body

{"type":"products_full"
}

Products Partial (quantities) Load XML

POST /api/v1/sync

Request body

{"type":"products_partial"
}

Update Stock data adjustment to Upgates

POST /api/v1/sync

Request body

{"type":"update_stock"
}

Response Formats

Success Response

{
    "data": {},
    "message": "Operation successful"
}

Error Response

{
    "error": {
        "code": "ERROR_CODE",
        "message": "Error message description"
    }
}

Status Codes

  • 200: Success
  • 201: Created
  • 400: Bad Request
  • 401: Unauthorized
  • 403: Forbidden
  • 404: Not Found
  • 500: Internal Server Error