Get countdown
API v2 is in public beta: endpoints and fields can change before general availability. See the changelog
/preorders/offers/{id}/countdownCosts 1 rate-limit point · Rate limits
Read the countdown timer settings of a preorder offer.
show_when is worked out from the timer's dates, not stored. With date_source schedule the timer counts to the offer's schedule and the top-level starts_at and ends_at (the custom dates) are unused; current.starts_at and current.ends_at are always the dates it counts to. current is what shoppers see now: visible_phase hidden, before_launch or during_preorder, with target_at and heading_text. The timer is hidden while the offer is off. Edit with PATCH /preorders/offers/:id/countdown.
Also searched asget countdownshow timerview countdown timerview timer settingscountdown settings
Path parameters
idstringRequiredThe offer's ID, from
GET /preorders/offers.
Query parameters
localestringLanguage for translated text, such as fr or pt-BR. Omit for the shop's default language.
Returns
show_whenstringdisabled hides the timer; before_launch counts down to the start, during_preorder to the end, both to the start and then the end.
One ofdisabledbefore_launchduring_preorderbothdate_sourcestringschedule counts to the offer's schedule dates; custom to starts_at and ends_at.
One ofschedulecustomstarts_atnullCustom launch date, ISO 8601 in UTC. Used when date_source is custom; null when not set.
ends_atnullCustom deadline, ISO 8601 in UTC. Used when date_source is custom; null when not set.
starts_textnullHeading shown before launch. Null when not set.
ends_textnullHeading shown during the preorder. Null when not set.
labelsobjectUnit labels shown on the timer.
Show 4 child attributesHide child attributes
daysstringDays label.
hoursstringHours label.
minutesstringMinutes label.
secondsstringSeconds label.
text_colorstringTimer text color, as hex.
background_colorstringTimer background color, as hex.
border_radiusintegerTimer corner radius in pixels.
unitsarray of stringsTime units the timer shows, any of days, hours, minutes and seconds.
currentobjectWhat the timer shows right now, worked out from the settings, the dates and the offer's status. Read-only.
Show 5 child attributesHide child attributes
visible_phasestringhidden when no timer shows now; before_launch while counting to the start; during_preorder while counting to the end.
One ofhiddenbefore_launchduring_preordertarget_atnullThe moment the timer counts down to now, ISO 8601 in UTC. Null when hidden.
heading_textnullHeading shown above the timer now. Null when hidden or not set.
starts_atnullStart date the timer uses, from the schedule or the custom dates per date_source, ISO 8601 in UTC. Null when none.
ends_atnullEnd date the timer uses, from the schedule or the custom dates per date_source, ISO 8601 in UTC. Null when none.
Errors
not_foundThe path is valid but nothing with that id exists in this store.
invalid_paramsOne or more fields failed the action's schema.
validation_failedThe request failed validation.
Any request can also fail with auth_invalid (401) or rate_limited (429).
Every error has the same shape: see Errors and the list of error codes.
curl "https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/countdown" \
-H "X-Auth-Token: $STOQ_API_KEY"const res = await fetch("https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/countdown", {
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/countdown",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/countdown")
req = Net::HTTP::Get.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"])
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)curl "https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/countdown?locale=fr" \
-H "X-Auth-Token: $STOQ_API_KEY"const res = await fetch("https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/countdown?locale=fr", {
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/countdown?locale=fr",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/countdown?locale=fr")
req = Net::HTTP::Get.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"])
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body){
"show_when": "disabled",
"date_source": "schedule",
"starts_at": null,
"ends_at": null,
"starts_text": null,
"ends_text": null,
"labels": {
"days": "string",
"hours": "string",
"minutes": "string",
"seconds": "string"
},
"text_color": "string",
"background_color": "string",
"border_radius": 1,
"units": [
"string"
],
"current": {
"visible_phase": "hidden",
"target_at": null,
"heading_text": null,
"starts_at": null,
"ends_at": null
}
}{
"errors": [
"Invalid API key"
],
"code": "auth_invalid",
"details": [
{
"code": "auth_invalid",
"message": "Invalid API key",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"Offer not found"
],
"code": "not_found",
"details": [
{
"code": "not_found",
"message": "Offer not found",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"name is required"
],
"code": "validation_failed",
"details": [
{
"code": "validation_failed",
"message": "name is required",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"Rate limit exceeded"
],
"code": "rate_limited",
"details": [
{
"code": "rate_limited",
"message": "Rate limit exceeded",
"path": null,
"value": null,
"expected": null
}
]
}