Skip to content

Get countdown

API v2 is in public beta: endpoints and fields can change before general availability. See the changelog

GET/preorders/offers/{id}/countdown

Costs 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

Query parameters

  • localestring

    Language for translated text, such as fr or pt-BR. Omit for the shop's default language.

Returns

  • show_whenstring

    disabled hides the timer; before_launch counts down to the start, during_preorder to the end, both to the start and then the end.

    One of disabledbefore_launchduring_preorderboth
  • date_sourcestring

    schedule counts to the offer's schedule dates; custom to starts_at and ends_at.

    One of schedulecustom
  • starts_atnull

    Custom launch date, ISO 8601 in UTC. Used when date_source is custom; null when not set.

  • ends_atnull

    Custom deadline, ISO 8601 in UTC. Used when date_source is custom; null when not set.

  • starts_textnull

    Heading shown before launch. Null when not set.

  • ends_textnull

    Heading shown during the preorder. Null when not set.

  • labelsobject

    Unit labels shown on the timer.

    Show 4 child attributesHide child attributes
    • daysstring

      Days label.

    • hoursstring

      Hours label.

    • minutesstring

      Minutes label.

    • secondsstring

      Seconds label.

  • text_colorstring

    Timer text color, as hex.

  • background_colorstring

    Timer background color, as hex.

  • border_radiusinteger

    Timer corner radius in pixels.

  • unitsarray of strings

    Time units the timer shows, any of days, hours, minutes and seconds.

  • currentobject

    What 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_phasestring

      hidden when no timer shows now; before_launch while counting to the start; during_preorder while counting to the end.

      One of hiddenbefore_launchduring_preorder
    • target_atnull

      The moment the timer counts down to now, ISO 8601 in UTC. Null when hidden.

    • heading_textnull

      Heading shown above the timer now. Null when hidden or not set.

    • starts_atnull

      Start date the timer uses, from the schedule or the custom dates per date_source, ISO 8601 in UTC. Null when none.

    • ends_atnull

      End date the timer uses, from the schedule or the custom dates per date_source, ISO 8601 in UTC. Null when none.

Errors

404
not_found

The path is valid but nothing with that id exists in this store.

422
invalid_params

One or more fields failed the action's schema.

422
validation_failed

The 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.

GET/preorders/offers/{id}/countdown
curl "https://app.stoqapp.com/api/v2/external/preorders/offers/73a74948-2b57-4cc3-971f-2b441828c977/countdown" \
  -H "X-Auth-Token: $STOQ_API_KEY"
Response
{
  "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
  }
}