Merchant settings operating hours responses

The merchant settings operating hours API allows you to query and update the opening and closing hours of your store using the API.

Get merchant settings operating hours responses

GET /merchants/settings/locations/operating_hours

Status Meaning Description
200 OK Returns an object representing the operating hours of your store for each day of the week.
403 Forbidden Returned when the API key given doesn’t match a valid merchant account.

To perform this operation, you must authenticate with an authentication token.

Examples

Example responses when getting merchant settings operating hours

Successful get merchant settings operating hours responses

Returns an object representing the operating hours of your store for each day of the week:

{
  "working_days": [
    {
      "day": "monday",
      "beginning_of_workday": "09:00",
      "end_of_workday": "17:00",
      "is_open": true
    },
    {
      "day": "tuesday",
      "beginning_of_workday": "09:00",
      "end_of_workday": "17:00",
      "is_open": true
    },
    {
      "day": "wednesday",
      "beginning_of_workday": "09:00",
      "end_of_workday": "17:00",
      "is_open": true
    },
    {
      "day": "thursday",
      "beginning_of_workday": "09:00",
      "end_of_workday": "17:00",
      "is_open": true
    },
    {
      "day": "friday",
      "beginning_of_workday": "09:00",
      "end_of_workday": "17:00",
      "is_open": true
    },
    {
      "day": "saturday",
      "beginning_of_workday": "09:00",
      "end_of_workday": "17:00",
      "is_open": false
    },
    {
      "day": "sunday",
      "beginning_of_workday": "00:00",
      "end_of_workday": "17:00",
      "is_open": false
    }
  ]
}

Unsuccessful get merchant settings operating hours responses

Returned when the API key given doesn’t match a valid merchant account:

{
  "error": "invalid_merchant_account",
  "error_description": "An unknown error has occurred."
}

Update merchant operating hours responses

Given an object with the desired settings to update, updates the merchant operating hours settings on Shippit.

Status Meaning Description Schema
200 OK The updated merchant operating hours MerchantOperatingHours
400 Bad Request Returned when Shippit has a problem with the input parameters. Not all input errors result in this error. Depending on the request, the system may parse the error as an unknown error or include it in the response body. If returned as text or html, it’s blank. string
403 Forbidden Returned when the API key given doesn’t match a valid merchant account. GenericErrorResponse
500 Internal Server Error Returned when an unknown error occurs. Returned if Shippit has trouble with the combination of the input or merchant account configuration. GenericErrorResponse

Examples

Example responses for updating merchant operating hours

Successful update merchant operating hours responses

Returns the updated merchant operating hours details:

{
  "working_days": [
    {
      "day": "monday",
      "beginning_of_workday": "09:00",
      "end_of_workday": "17:00",
      "is_open": true
    },
    {
      "day": "tuesday",
      "beginning_of_workday": "09:00",
      "end_of_workday": "17:00",
      "is_open": true
    },
    {
      "day": "wednesday",
      "beginning_of_workday": "09:00",
      "end_of_workday": "17:00",
      "is_open": true
    },
    {
      "day": "thursday",
      "beginning_of_workday": "09:00",
      "end_of_workday": "17:00",
      "is_open": true
    },
    {
      "day": "friday",
      "beginning_of_workday": "09:00",
      "end_of_workday": "17:00",
      "is_open": true
    },
    {
      "day": "saturday",
      "beginning_of_workday": "09:00",
      "end_of_workday": "17:00",
      "is_open": false
    },
    {
      "day": "sunday",
      "beginning_of_workday": "00:00",
      "end_of_workday": "17:00",
      "is_open": false
    }
  ]
}

Unsuccessful update merchant operating hours responses

Returned when Shippit has a problem with the input parameters.

Not all input errors can result in this error. Depending on the request, the system may parse the error as an unknown error or include it in the response body.

If returned as text or html, it’s blank.

{
  "error": "bad_request",
  "error_description": "The data given to this server does not meet our criteria."
}

400 response

"string"

Returned when there is a missing field

{
  "errors": {
    "working_days": "field must be provided"
  }
}
{
  "errors": {
    "monday": {
      "is_open": "field must be provided"
    }
  }
}
{
  "errors": {
    "end_before_beginning": "In one of the weekdays, beginning_of_workday is later than end_of_workday"
  }
}

Returned when there is an invalid data or missing data

{
  "errors": {
    "all_weekdays_present": "All weekdays must be present in the following order: monday, tuesday, wednesday, thursday, friday, saturday, sunday"
  }
}
{
  "errors": {
    "wednesday": {
      "day": "must be one of the following: monday, tuesday, wednesday, thursday, friday, saturday, sunday"
    }
  }
}
{
  "errors": {
    "monday": {
      "beginning_of_workday": "does not have the format HH:MM"
    }
  }
}
{
  "errors": {
    "monday": {
      "beginning_of_workday": "must be a 30-minute increment (ending in :00 or :30)"
    }
  }
}
{
  "errors": {
    "monday": {
      "is_open": "is not a boolean value"
    }
  }
}
{
  "errors": {
    "monday": {
      "end_of_workday": "is not a string value"
    }
  }
}

Returned when the API key given doesn’t match a valid merchant account:

{
  "error": "invalid_merchant_account",
  "error_description": "An unknown error has occurred."
}