API

The Gem Logic API lets you integrate with external systems and automate workflows. You can use it to manage products, sales, contacts, repairs, inventory counts, and print jobs programmatically.

Navigate to Settings ‣ API to create and manage your API keys.

Authentication

All API requests must include an API key in the x-api-key HTTP header. You can create keys from the Settings ‣ API page. Keys can be deactivated or deleted at any time.

Example request:

curl -X GET https://your-instance.gem-logic.com/api/marketplaces/ \
  -H "x-api-key: YOUR_API_KEY"

Danger

Keep your API keys secret. Never share them in public repositories or client-side code. If a key is compromised, deactivate it immediately and create a new one.

Base URL

All endpoints are relative to your instance URL, under the /api/ prefix:

https://your-instance.gem-logic.com/api/

Response format

All responses are returned as JSON. Successful requests return a 200 (for GET) or 201 (for POST) status code. Errors return the appropriate status code with a message:

  • 200 OK — successful GET request

  • 201 Created — successful POST request

  • 400 Bad Request — invalid or missing data

  • 401 Unauthorized — invalid or missing API key

  • 404 Not Found — resource does not exist

Endpoints

Marketplaces

Method

GET

URL

/api/marketplaces/

Description

Returns a list of all sales channels.

Response fields:

Field

Type

Description

id

integer

Unique identifier

marketplace

string

Marketplace name

Products

List products

Method

GET

URL

/api/products/{marketplace_id}

Description

Returns products filtered by marketplace. Use the marketplace ID from the marketplaces endpoint.

Response fields:

Field

Type

Description

id

integer

Unique identifier

item_sku

string

Product SKU

created

datetime

Creation date

status

string

Product status

images

array

List of product images (id, image)

item_weight

decimal

Weight

item_height

decimal

Height

item_length

decimal

Length

item_width

decimal

Width

Create product image

Method

POST

URL

/api/products/create/image/

Description

Upload a product image using base64 encoding. If the product SKU does not exist yet, a new product is created automatically.

Request fields:

Field

Type

Required

Description

item_sku

string

Yes

Product SKU to attach the image to

image

string (base64)

Yes

Base64-encoded image data

Sales

List sales

Method

GET

URL

/api/sales/

Description

Returns a list of all sale orders.

Response fields:

Field

Type

Description

order_id

string

Unique order identifier

Create sale

Method

POST

URL

/api/sales/create/

Description

Creates a new sale order.

Contacts

Method

GET

URL

/api/contacts/

Description

Returns a list of all contacts.

Response fields:

Field

Type

Description

id

integer

Unique identifier

complete_name

string

Full name

contact_type

string

Type of contact

email

string

Email address

phone

string

Phone number

language

string

Preferred language

Repairs

Create repair

Method

POST

URL

/api/repairs/create/

Description

Creates a new repair order with an associated repair item. If marketplace or division is not provided, the first available one is used.

Request fields:

Field

Type

Required

Description

client_id

integer

No

ID of the client/contact

marketplace

string / integer

No

Marketplace ID or name

division_id

integer

No

Business division ID

title

string

No

Title or description of the repair item

repair_info_1

string

No

Additional repair comment

repair_info_2

string

No

Additional repair comment

repair_info_3

string

No

Additional repair comment

quantity

decimal

No

Quantity (default: 1)

weight

decimal

No

Item weight

weight_unit

string

No

Unit of weight measurement

size

string

No

Item size

color

string

No

Item color

engravement

string

No

Engravement text

client_reference | string

No

Client’s reference number

Example response:

{"message": "Repair created successfully.", "order_id": "R-0001"}

Add item to repair

Method

POST

URL

/api/repairs/add-item/

Description

Adds a new item to an existing repair order.

Request fields:

Field

Type

Required

Description

order_id

string

Yes

Order ID of the repair to add the item to

item_sku

string

No

Product SKU to link with the item

title

string

No

Title or description

repair_info_1

string

No

Additional repair comment

repair_info_2

string

No

Additional repair comment

repair_info_3

string

No

Additional repair comment

quantity

decimal

No

Quantity (default: 1)

weight

decimal

No

Item weight

weight_unit

string

No

Unit of weight measurement

size

string

No

Item size

color

string

No

Item color

engravement

string

No

Engravement text

client_reference | string

No

Client’s reference number

cost

decimal

No

Cost of the item

Inventory counts

Create inventory count

Method

POST

URL

/api/inventory-counts/

Description

Creates a new inventory count session.

Response fields:

Field

Type

Description

id

string

Inventory count ID

created_at

datetime

Creation timestamp

status

string

Always active

tag_count

integer

Number of counted products

List inventory count products

Method

GET

URL

/api/inventory-counts/{inventory_count_id}/products/

Description

Returns all products counted in a specific inventory count.

Response fields:

Field

Type

Description

id

string

Unique identifier

created_at

datetime

When the product was counted

product_sku

string

Product SKU

product_name

string

Product name

quantity

integer

Counted quantity

Interactive API explorer

Gem Logic includes a built-in interactive API explorer powered by Swagger UI. You can access it from the API documentation link on the Settings ‣ API page. The explorer lets you try out each endpoint directly from your browser.