Coupons

Coupons

3.4.0OAS 3.0

This API allows to retrieve all existing Coupons and UCBs including their metadata like image URLs and marketing texts. It also provides special metadata for POS-Coupons to be used by the Avanta cash registers.

It doesn’t matter whether you send parameters as query parameter or as x-www-form-urlencoded in the body.

The response language is determined by the Accept-Language HTTP header or by a dedicated lang query parameter. If neither is given “de” is used. Coupons are available in German, French and Italian. There’s experimental support for English (excl. POSCoupons and UCBs). Note that English translations are generated by AI and may vary in quality and style and are thus not production ready!

Some background details on Coupons can be found here.

Images are available on the Migros CDN which is based on Rokka. Most image URLs are templates containing {stack} which you MUST replace with the Rokka stack you want to use. The stack original returns the image in its original dimensions. One more stack is 2017-custom/resize-height-{H}-width-{W} which allows to limit image dimensions to a maximum of W×H. The image format is determined by the filename extension (e.g. ‘.jpg’ or ‘.png’). The URLs have a suitable extension, but you are free to replace e.g. .png with .avif if needed.

Two audit routes serve human consumable HTML data for troubleshooting data problems. Generally no access is given to these routes.

HTTP status codes conform to RFC 7231 and are not documented on each route individually. The response body of all non-200 responses doesn’t contain information to be consumed (or even acted on) by machines. Machines should work on HTTP status codes and HTTP headers only.

In addition to the standard semantics the following codes are used:

  • 404 Not found: If a Coupon or UCB is not charged (=issued, attributed)
    to the given Cumulus number.

  • 409 Conflict: If the maximum number of Coupons or UCBs (currently 50)
    has been activated already.

  • 410 Gone: If a Coupon or UCB has been redeemed already.

  • 502 Bad Gateway: In case of unspecific ReTi errors (i.e. ReTi result
    with id==99).

  • 503 Service Unavailable: If the circuit breaker guarding ReTi is open.
    You may retry the request but it makes no sense to do it immediately
    as the circuit breaker will still be open. Wait a few seconds at least.
    Waiting longer helps even better.

  • 504 Gateway Timeout: If the request to ReTi timed out.
    You may retry the request. Waiting a bit before doing it should
    be obvious.

The breaking changes are documented here

API Base URL
  • Server 1:https://api-qual.migros.ch

    URL of upstream

Security
Basic-Auth (http)

Kong basic-auth authentication

Kong-Api-Key (apiKey)

Kong key-auth authentication

Static-Data

Provides translations for common texts

Key-translation-pairs for common texts used around Coupons and UCBs. These values are provided as a convenience for clients that do not maintain their own internationalisations.

These do not change frequently and if they do it doesn’t matter much if an ‘outdated’ one is used for some time. Clients are expected to cache the response of this endpoint for some hours to days.

To prevent requesting these translations without client side caching this endpoint eploys strict rate limiting of a few request per minute per consumer.

get
https://api-qual.migros.ch/migros/customers/coupons/v3/i18n

Query Parameters

langstring

Override Accept-Language header

Allowed values:defritexperimental_en

Response

application/json

Object with key-value pairs

object
get/migros/customers/coupons/v3/i18n
 
application/json

Data for the three UCBs (CHF 5, 10 and 20).

Data for the three UCBs (CHF 5, 10 and 20).

get
https://api-qual.migros.ch/migros/customers/coupons/v3/ucbs

Query Parameters

langstring

Override Accept-Language header

Allowed values:defrit

Response

application/json

The UCB data

Static data of an UCB (Blauer Bon/Coupon Bon).

descriptionstring

Example:Bon Wert Fr. 5

idstringrequired

This ID just identifies the value (5, 10, 20 CHF) only. The individual physical UCB is identified by a UCB-ID that equals the number/barcode printed on the UCB.

Example:980500100000

imagestringrequired

Example:https://image.migros.ch/coupons/{stack}/40187ac745c07f16a184508f17f3a3cb255d4537.jpg

image_appstringrequired

Example:https://image.migros.ch/coupons/{stack}/76a605b12f8ad8586c70b3a0a920836bcb5f94d8.png

image_app_inactivestringrequired

Example:https://image.migros.ch/coupons/{stack}/4a67aeb0ff88b07cc2cd4b4cd2b0272759f74779.png

image_inactivestringrequired

Example:https://image.migros.ch/coupons/{stack}/6c8cf3ca90d107207ca6760e8eb4e554d67c438d.jpg

languagestringrequired

Example:de

valueinteger(int32)required

Example:5

get/migros/customers/coupons/v3/ucbs
 
application/json

Coupon-Data