NAV
json

Introduction

Welcome to the StarEditions API! You can use our API to push order into our api.

To connect to the API you will need two pieces of information: - store-name - token

This combination will allow you to perform request on orders specific to that store. These details will be provided to you by StarEditions. Contact support if you do not have them.

Connecting to the API

Endpoint

To access the api, connect through the url specific to your store. http://app.letsprintondemand.com/api/v1/[store-name]

Headers

To ensure responses are always formatted as JSON please add the following headers with every request:

Content-Type: application/json Accept: application/json

Authentication

Authorization:

With every request ensure that you pass the provided token in the header:

Authorization: Bearer <token>

/order

POST

Summary: Push an order into our system from a store. Pushing an order to the system will push it into our production system.

HTTP Request

POST /order

The order has the following structure:

{
  "email": "string", // Required - customer email
  "order_ref": "string", // Required - your internal reference to the order
  "note": "string",
  "total_price": "float", // Required - Total order value
  "subtotal_price": "float",
  "total_weight": "float", // Weight in grams
  "total_tax": "float",
  "taxes_included": "boolean", // TRUE or FALSE
  "currency": "string",
  "financial_status": "float", // Required - set to 'paid' to process payment
  "total_discounts": "float",
  "total_line_items_price": "float",
  "cancelled_at": "datetime",
  "cancel_reason": "string",
  "browser_ip": "string",
  "processing_method": "string",
  "source_name": "string", // Required source type eg. WordPress/Magento/Bespoke
  "fulfillment_status": "string",
  "shipping_lines": [// Reequired - at least one entry
    {
      "title", // Required -  Shipping method name eg. Free Shipping / Express / Standard / Royal Mail/ Courier etc
      "price",
      "code" // Required Shipping method type eg. Royal Mail/ Courier
    }
  ],
  "billing_address": {
    "address1": "string", // Required
    "address2": "string",
    "phone": "string",
    "city": "string", // Required
    "zip": "string", // Required
    "province": "string",
    "name": "string", // Required - Customer Name
    "country_code": "string"// Required ISO Alpha 2
  },
  "shipping_address": {
    "address1": "string", // Required
    "address2": "string",
    "phone": "string", // required
    "city": "string", // Required
    "zip": "string", // Required
    "province": "string",
    "name": "string", // Required - Customer Name
    "country_code": "string"// Required
  },
  "line_items": [ // Required - minimal 1 item
    {
      "variant_id": "string",
      "title": "string",
      "quantity": "integer", // Required
      "sku": "string", // Required
      "name": "string", // Required
      "variant_title": "string",
      "vendor": "string",
      "grams": "float",
      "price": "float",
      "total_discount": "float",
      "fulfillment_status": "string",
      "properties": [
        [
          {
            "value": "Personaliation text line 1"
          },
          {
            "value": "Personaliation text line 2"
          }
        ]
      ]
    }
  ]
}

Responses

Code Description
200 Accepted request
422 Something is wrong with the order

/order/{id}

GET

Summary: Retrieve one of your orders

HTTP Request

GET /order/{id}

Parameters

Name Located in Description Required Type
id path The unique id of the order Yes String

Responses

Code Description
200 Accepted request
404 Order not found

/store

GET

Summary: Retrieve the store details for the store

HTTP Request

GET /store

Parameters

Name Located in Description Required Type
store path The unique name identifying the store Yes

Response:

{
  "Shop_ID": "String",
  "Shop_Name": "String",
  "Custom_Endpoint": "String"
}

Responses

Code Description
200 Retrieving a shop
401 No access to this resource

PUT

Summary: Update the webhook for your shope

HTTP Request

PUT /{store}/store

Payload:

{
  "Custom_Endpoint": "String" // Update the url where information is returned
}

Responses

Code Description
200 Updated shop
422 Payload in valid

Errors

The Kittn API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The kitten requested is hidden for administrators only.
404 Not Found -- The specified kitten could not be found.
405 Method Not Allowed -- You tried to access a kitten with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The kitten requested has been removed from our servers.
418 I'm a teapot.
429 Too Many Requests -- You're requesting too many kittens! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.