Using API

Get started

You're first call to test to retrieve activity

curl -X GET \
  https://api.decathlon.net/activities/v2/{identifier} \
  -H 'x-api-key: <api_key>'

identifier is an activity Id


Manage activities and timeslots

JWT Token

  1. Prerequisites

    • Ask login credentials to the team (CLIENT_ID and CLIENT_SECRET)

  2. Get your jwt_token

curl --location 'http://api-eu.preprod.decathlon.net/connect/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--form 'grant_type="client_credentials"' \
--form 'client_id="CLIENT_ID"' \
--form 'client_secret="CLIENT_SECRET"'

Manage Activities

Activity payload
Attribut type mandatory
type ActivityTypeEnum yes
name LocalizableBodyInterface[] yes
external_id (id in external system) string no
generateQrcode boolean no
bookableUntilTheEnd boolean no
sports number[] yes
description LocalizableBodyInterface[] yes
typicalAgeRange RangeInterface yes
proficiencyLevel ProficiencyLevelEnum[] yes
requiredEquipment LocalizableBodyInterface[] no
providedEquipment LocalizableBodyInterface[] no
indicativeMaximumAttendeeCapacity number no
indicativeMinimumAttendeeCapacity number no
startingPrice PriceInterface yes
validUntil string no
duration ISO8601 format (ex: PT3H30M) yes
location LocationBodyInterface yes
image string (URL) yes
accountabilityReference (payment provider account id) string yes
organizationIdentifier string yes
liveUrl string no
meta MetaInterface no
refundTimeLimit ISO8601 format(ex: P1D) no
noteForAttendees LocalizableBodyInterface[] no
indicativeOffers OfferBodyInterface[] yes
ecological boolean no


ActivityTypeEnum


LocalizableBodyInterface

{ locale: string value?: T }

Example :

"name": [
      {
        "locale": "en-EN",
        "value": "Dance Fit Class - All Levels"
      }
    ]


Retrive sports number

curl -X GET 'https://api-eu.decathlon.net/activities/v2/sports' \
--header 'x-api-key: API_KEY'


RangeInterface

{
  min: number | null
  max: number | null
}


ProficiencyLevelEnum values


PriceInterface

{
  amount: number
  currency: string
}


LocationBodyInterface

{
    address: {
        addressCountry: string | null,
        addressLocality: string | null,
        addressRegion: string | null,
        postalCode: string | null,
        streetAddress: string | null,
    },
    geo: {
        latitude: number,
        longitude: number,
    },
    mapsProvider: 'GOOGLE_MAPS',
    identifier: string,
    precision: string | null,
}


MetaInterface

{
[key: string]:
| string
| string[]
| MetaInterface
| MetaInterface[]
| number
| number[]
| boolean
}


OfferBodyInterface

{
    identifier: string
    price: number
    currency: string
    name: LocalizableBodyInterface<string>[] | null
    description: LocalizableBodyInterface<string>[] | null
    meta: MetaInterface | null
}


Activity upsert

curl --location --request POST '/bms/activities/_bulk_upsert'
--header 'x-api-key: <api_key>'
--header 'Content-Type: application/json'
--header 'Authorization: <jwt_token>'
--data-raw '{
   [ {
    "description": [
      {
        "locale": "string",
        "value": "string"
      }
    ],
    "duration": [
      "PT3H30M : activity lasts three hours and a half.",
      "P2D : activity lasts two days.",
      "P1DT12H : activity lasts one day and a half."
    ],
    "external_id": "string",
    "image": "string",
    "indicativeMaximumAttendeeCapacity": 0,
    "indicativeMinimumAttendeeCapacity": 0,
    "indicativeOffers": [
      {
        "currency": "string",
        "description": [
          {
            "locale": "string",
            "value": "string"
          }
        ],
        "identifier": "string",
        "meta": {
          "awesomeMetadata": "hello",
          "isAwesome": true
        },
        "name": [
          {
            "locale": "string",
            "value": "string"
          }
        ],
        "price": 0
      }
    ],
    "liveUrl": "string",
    "location": {
      "address": {
        "addressCountry": "string",
        "addressLocality": "string",
        "addressRegion": "string",
        "postalCode": "string",
        "streetAddress": "string"
      },
      "geo": {
        "latitude": 0,
        "longitude": 0
      },
      "identifier": "string",
      "mapsProvider": {},
      "precision": [
        {
          "locale": "string",
          "value": "string"
        }
      ]
    },
    "meta": {
      "some": "metadata"
    },
    "name": [
      {
        "locale": "string",
        "value": "string"
      }
    ],
    "noteForAttendees": [
      {
        "locale": "string",
        "value": "string"
      }
    ],
    "organizationIdentifier": "string",
    "proficiencyLevel": [
      5
    ],
    "providedEquipment": [
      {
        "locale": "string",
        "value": [
          "string"
        ]
      }
    ],
    "refundTimeLimit": [
      "PT3H30M : no refund if booking cancelled three hours and a half before it starts.",
      "P2D : no refund if booking cancelled two days before it starts.",
      "P1DT12H : no refund if booking cancelled one day and a half before it starts."
    ],
    "requiredEquipment": [
      {
        "locale": "string",
        "value": [
          "string"
        ]
      }
    ],
    "sports": [
      0
    ],
    "startingPrice": {
      "amount": 0,
      "currency": "string"
    },
    "type": "GROUP_LESSON",
    "typicalAgeRange": {
      "max": 0,
      "min": 0
    },
    "validUntil": [
      "PT3H30M : activity cancelled three hours and a half before it starts.",
      "P2D : activity cancelled two days before it starts.",
      "P1DT12H : activity cancelled one day and a half before it starts."
    ]
  } ]
    }'

Activity delete

curl --location --request POST '/activities/_bulk_delete'
--header 'Content-Type: application/json'
--data-raw '{
        [
            {
                "identifier": "string"
            }
        ]
    }'

Manage timeslots

Timeslot payload
Attribut type mandatory
maximumAttendeeCapacity number yes
startDate Date yes
startDateTimezone number yes
endDate string yes
endDateTimezone number yes
liveUrl string no
noteForAttendees string no
offers OfferInterface[] yes
status TimeslotStatusEnum yes
tenantName string yes
meta MetaInterface no

=> tenantName string : activities_{Country Alpha-3 code} Example activities_FRA


TimeslotStatusEnum

DRAFT
PUBLISHED
CANCELED

Timeslot upsert

curl --location --request POST '/activities/{identifier}/timeslots/_bulk_upsert'
--header 'Content-Type: application/json'
--data-raw '{
[
  {
    "endDate": [
      "2020-01-01T12:34:56Z",
      "2021-02-02T22:33:44+0100",
      "2022-03-03T11:22:33-1100"
    ],
    "identifier": "string",
    "liveUrl": "string",
    "maximumAttendeeCapacity": 0,
    "meta": {
      "some": "metadata"
    },
    "minimumAttendeeCapacity": 0,
    "noteForAttendees": [
      {
        "locale": "string",
        "value": "string"
      }
    ],
    "offers": [
      {
        "currency": "string",
        "description": [
          {
            "locale": "string",
            "value": "string"
          }
        ],
        "identifier": "string",
        "meta": {
          "awesomeMetadata": "hello",
          "isAwesome": true
        },
        "name": [
          {
            "locale": "string",
            "value": "string"
          }
        ],
        "price": 0
      }
    ],
    "startDate": [
      "2020-01-01T12:34:56Z",
      "2021-02-02T22:33:44+0100",
      "2022-03-03T11:22:33-1100"
    ]
  }
]
    }'

Timeslot delete

curl --location --request POST '/activities/{identifier}/timeslots/_bulk_delete'
--header 'Content-Type: application/json'
--data-raw '{
        [
            {
                "identifier": "string"
            }
        ]
    }'