API Calls

Making API Calls

API Calls can be made to the endpoint api.shedsforsale.com and can be used to access the live, production API.


Authentication

To authenticate via the API, you must provide your partner API key in the headers as x-api-key. In addition, a valid API key and Secret key are required to authenticate against the customer account. Keep these keys secure. Please contact us at dev@shedsforsale.com in order to get a partner, access, and secret keys assigned to be able to connect to the API.

Creating and updating products

Creating and updating products are both accomplished by calling the same endpoint. You are required to send an ID (externalId) that is unique the product that you are sending. The purpose of this ID is to decide whether to create a new product or update an existing product.

A location and manufacturer are both required for all products. API endpoints are provided to receive an account's available locations and manufacturers. However, you may find it easier to direct users to limit an API key set to a particular location and manufacturer. If a location and manufacturer are set, it will override whatever is sent to the API and the product will be set to have that location and/or manufacturer.

In order to require that your users do this, we provide an option to require it. Just send requireLocation: true and/or requireManufacturer: true and an error will be thrown if the API key set does not have those options enabled.

Limits

Only 100 products can be sent in one request. If you'd like to send more than 100 products, please break them into chunks.

Request example

axios({
  method: 'put',
  auth: {
    username: 'CUSTOMER_API_KEY_HERE',
    password: 'CUSTOMER_SECRET_KEY_HERE',
  },
  headers: {
    'x-api-key': 'PARTNER_API_KEY_HERE',
  },
  url: '/integration/products',
  data: {
    requireLocation: boolean,
    requireManufacturer: boolean,
    products: Array<Product>,
  },
})
Types
type Product = {
  externalId: string
  model: string
  title: string
  price: number
  description: string
  sku: string
  active: boolean
  manufacturer: number
  monthlyPayment: number
  width: number
  length: number
  colorMain: Color
  colorTrim: Color
  colorRoof: Color
  location: number
  roofingType: RoofingType
  sidingType: SidingType
  doors: number
  windows: number
  warranty: string
  specialFeatures: string
  specialFeatures2: string
  specialFeatures3: string
  specialFeatures4: string
  type: ShedType
  sold: boolean
  externalUrl: string
  style: Array<ShedStyle>
  roofStyle: RoofStyle
  freeDeliveryRange: number
  deliveryInstructions: string
  colorMainSpecific: string
  colorTrimSpecific: string
  colorRoofSpecific: string
  reducedPrice: number
  images: Array<string>
}

type RoofingType = 'metal' | 'shingle' | 'tile'

type SidingType = 'metal' | 'painted' | 'urethane' | 't111' | 'vinyl'

type ShedStyle = 'shed' | 'garage' | 'living' | 'animal structure' | 'gazebo' | 'greenhouse' | 'other'

type RoofStyle = 'aframe' | 'gambrel' | 'other'

type ShedType = 'preowned' | 'new' | 'builttoorder'

type Color =
  | 'black'
  | 'blue'
  | 'brown'
  | 'burgandy'
  | 'charcoal'
  | 'clay'
  | 'driftwood'
  | 'gold'
  | 'gray'
  | 'green'
  | 'honey'
  | 'mahogany'
  | 'natural'
  | 'orange'
  | 'purple'
  | 'red'
  | 'tan'
  | 'weatherwood'
  | 'white'
  | 'yellow'

Response

Response body will be empty upon a successful (200) operation.

Previous
Getting started