Products

This endpoint allows you to create, update and delete products inside Keyline.

Attributes you send to Keyline

name string The name of the product
kind string The kind of the product, the value has to be one of the following:
brochure, book, business_card, sticker, pad, pages, couvert, custom
custom_description string The custom description of the product

Attributes Keyline sends back to you

id integer The ID of the product that was just created
order_id integer The ID of the associated order
state integer The state of the product
reference integer The reference of the product
name integer The name of the product
custom_description string The customs description of the product
costs datetime The costs of the product
kind datetime The kind of the product
print_externally boolean true if print externally
cleared_for_production_at datetime The date and time when the product was cleared for production
created_at datetime The date and time when the product was last modified
updated_at datetime The date and time when the product was last modified

Actions

Creating a product

POST
/api/v1/orders/{ORDER_ID}/products

Example request

$ curl -X POST -H "Authorization: Bearer 4b00c2cbffba2d16d24dd8adf0e843e6b143b54dbf800ce7ef12d431927ef63f"\
-H "Content-Type: application/json"\
-d '{ "product": {
        "name": "Broschüre (Rückendrahtheftung)",
        "kind": "brochure"
      }
    }'
"https://api.keyline-mis.com/api/v1/orders/123/products"

Updating a product

PATCH
/api/v1/orders/{ORDER_ID}/products/{PRODUCT_ID}

Example request

$ curl -X PATCH -H "Authorization: Bearer 4b00c2cbffba2d16d24dd8adf0e843e6b143b54dbf800ce7ef12d431927ef63f"\
-H "Content-Type: application/json"\
-d '{"product": {
      "custom_description": "Rückendrahtheftung"
      }
    }'
"https://api.keyline-mis.com/api/v1/orders/123/products/1"

Deleting a product

DELETE
/api/v1/invoices/{ORDER_ID}/products/{PRODUCT_ID}

Example request

$ curl -X DELETE -H "Authorization: Bearer 4b00c2cbffba2d16d24dd8adf0e843e6b143b54dbf800ce7ef12d431927ef63f"\
-H "Content-Type: application/json"\
"https://api.keyline-mis.com/api/v1/orders/123/products/1"