API Reference

Orders

Create and manage orders

GET/v1/orders

Get All Orders

Get all fulfillment orders for a service integration store.

Authorization

x-api-key
Required
<token>

The API key to authenticate requests provided by Roastify. If you do not have an API key, please contact [email protected]

In: header

Status codeDescription
200Get all fulfillment orders
400Returns an error
401Unauthorized
404Not Found
422Data Validation Error
500Internal Server Error
curl -X GET "https://api.roastify.app/v1/orders"

{
  "orders": [
    {
      "orderId": "string",
      "createdAt": "string",
      "updatedAt": "string",
      "orderStatus": "Created",
      "isTest": false,
      "retailCosts": {
        "currency": "usd",
        "subtotal": 2500,
        "discount": 100,
        "tax": 150,
        "total": 2900
      },
      "toAddress": {
        "name": "string",
        "company": "string",
        "street1": "string",
        "street2": "string",
        "city": "string",
        "state": "string",
        "country": "string",
        "zip": "string",
        "phone": "string",
        "email": "string"
      },
      "items": [
        {
          "sku": "COF-WHB-12O-COL-BOX",
          "artworkUrl": "https://acme-aws-s3.com/designs/12oz-coffee-box-artwork.png",
          "quantity": 3
        }
      ]
    }
  ],
  "pageInfo": {
    "endCursor": "string",
    "hasNextPage": true
  }
}

POST/v1/orders

Create Order

Create a new fulfillment order. This will automatically create a new order in Roastify with a 'Created' status.

Authorization

x-api-key
Required
<token>

The API key to authenticate requests provided by Roastify. If you do not have an API key, please contact [email protected]

In: header

Request Body

retailCosts
Required
object

Retail costs

toAddress
Required
object

Recipient information

items
Required
array of object

List of items in the order

Status codeDescription
201Succesful order. Returns the orderId of the new order
400Returns an error
401Unauthorized
404Not Found
422Data Validation Error
500Internal Server Error
curl -X POST "https://api.roastify.app/v1/orders" \
  -d '{
  "retailCosts": {
    "currency": "usd",
    "subtotal": 2500,
    "discount": 100,
    "tax": 150,
    "total": 2900
  },
  "toAddress": {
    "name": "string",
    "company": "string",
    "street1": "string",
    "street2": "string",
    "city": "string",
    "state": "string",
    "country": "string",
    "zip": "string",
    "phone": "string",
    "email": "string"
  },
  "items": [
    {
      "sku": "COF-WHB-12O-COL-BOX",
      "artworkUrl": "https://acme-aws-s3.com/designs/12oz-coffee-box-artwork.png",
      "quantity": 3
    }
  ]
}'

{
  "orderId": "string"
}

GET/v1/orders/{orderId}

Get Order

Get an order by orderId

Authorization

x-api-key
Required
<token>

The API key to authenticate requests provided by Roastify. If you do not have an API key, please contact [email protected]

In: header

Path Parameters

orderId
Required
string

The Id of the order

Example: "1ef87e47-266e-466f-ab06-a64994aefbb0"Minimum length: 1
Status codeDescription
200Get an order by orderId
400Returns an error
401Unauthorized
404Not Found
422Data Validation Error
500Internal Server Error
curl -X GET "https://api.roastify.app/v1/orders/1ef87e47-266e-466f-ab06-a64994aefbb0"

{
  "orderId": "string",
  "createdAt": "string",
  "updatedAt": "string",
  "orderStatus": "Created",
  "isTest": false,
  "retailCosts": {
    "currency": "usd",
    "subtotal": 2500,
    "discount": 100,
    "tax": 150,
    "total": 2900
  },
  "toAddress": {
    "name": "string",
    "company": "string",
    "street1": "string",
    "street2": "string",
    "city": "string",
    "state": "string",
    "country": "string",
    "zip": "string",
    "phone": "string",
    "email": "string"
  },
  "items": [
    {
      "sku": "COF-WHB-12O-COL-BOX",
      "artworkUrl": "https://acme-aws-s3.com/designs/12oz-coffee-box-artwork.png",
      "quantity": 3
    }
  ]
}

PUT/v1/orders/{orderId}

Update Order

Update an Order by orderId

Authorization

x-api-key
Required
<token>

The API key to authenticate requests provided by Roastify. If you do not have an API key, please contact [email protected]

In: header

Request Body

retailCosts
Required
object

Retail costs

toAddress
Required
object

Recipient information

items
Required
array of object

List of items in the order

Path Parameters

orderId
Required
string

The Id of the order

Example: "1ef87e47-266e-466f-ab06-a64994aefbb0"Minimum length: 1
Status codeDescription
204Order updated successfully
400Returns an error
401Unauthorized
404Not Found
422Data Validation Error
500Internal Server Error
curl -X PUT "https://api.roastify.app/v1/orders/1ef87e47-266e-466f-ab06-a64994aefbb0" \
  -d '{
  "retailCosts": {
    "currency": "usd",
    "subtotal": 2500,
    "discount": 100,
    "tax": 150,
    "total": 2900
  },
  "toAddress": {
    "name": "string",
    "company": "string",
    "street1": "string",
    "street2": "string",
    "city": "string",
    "state": "string",
    "country": "string",
    "zip": "string",
    "phone": "string",
    "email": "string"
  },
  "items": [
    {
      "sku": "COF-WHB-12O-COL-BOX",
      "artworkUrl": "https://acme-aws-s3.com/designs/12oz-coffee-box-artwork.png",
      "quantity": 3
    }
  ]
}'

{
  "orderId": "string"
}

GET/v1/orders/{orderId}/events

Get Order Events

Get all order events by orderId

Authorization

x-api-key
Required
<token>

The API key to authenticate requests provided by Roastify. If you do not have an API key, please contact [email protected]

In: header

Path Parameters

orderId
Required
string

The Id of the order

Example: "1ef87e47-266e-466f-ab06-a64994aefbb0"Minimum length: 1
Status codeDescription
200Get all fulfillment order events by order Id
400Returns an error
401Unauthorized
404Not Found
422Data Validation Error
500Internal Server Error
curl -X GET "https://api.roastify.app/v1/orders/1ef87e47-266e-466f-ab06-a64994aefbb0/events"

Order events

{
  "status": "Created",
  "events": [
    {
      "time": "2020-01-01T00:00:00Z",
      "action": "Created",
      "affected_items": [
        "65cdd8c2a037fhna9c08471f",
        "62cdd3c6a037fhna9c084fnf"
      ]
    }
  ]
}

GET/v1/orders/{orderId}/shipping

Get Order Shipping

Get order shipping details by orderId

Authorization

x-api-key
Required
<token>

The API key to authenticate requests provided by Roastify. If you do not have an API key, please contact [email protected]

In: header

Path Parameters

orderId
Required
string

The Id of the order

Example: "1ef87e47-266e-466f-ab06-a64994aefbb0"Minimum length: 1
Status codeDescription
200Get order shipping details by order Id
400Returns an error
401Unauthorized
404Not Found
422Data Validation Error
500Internal Server Error
curl -X GET "https://api.roastify.app/v1/orders/1ef87e47-266e-466f-ab06-a64994aefbb0/shipping"

Order shipping details

{
  "status": "processed",
  "trackingNumber": "92346903470341000400704020",
  "trackingUrl": "https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=92346903470341000400704020",
  "estimatedDelivery": "2020-01-01T00:00:00Z",
  "shippingCarrier": "USPS",
  "shippingService": "First"
}