Skip to content

SOF26 - Update a service

Request

Call Frequency
Maximum usage: 60 per minute
Path
service_codestringrequired

Code of the service to update.

Query
shop_idinteger, (int64)

Use this parameter when your user has access to several shops. If not specified, the shop_id from your default shop will be used.

Bodyapplication/json
bookingobject
categoryobject

Service category

custom_attribute_valuesArray of objects

Service custom attributes values

date_availability_endstring, (date-time)

Date when the service ends being available. Set value to null to remove the date.

date_availability_startstring, (date-time)

Date when the service starts being available. Set value to null to remove the date.

descriptionstring, <= 2000 characters

Service description. Set value to null to remove the description.

inactive_reasonsArray of strings, [ 0 .. 1 ] items

Reason why the service is inactive. If equals to [] or null, then remove all reasons that are manually removable.

locationobject
modelobject

Service model

pricingobject
quantityobject
service_tax_codestring

Service tax code

titlestring, [ 3 .. 150 ] characters

Service title

curl -i -X PUT \
  'https://your-instance.mirakl.net/api/mms/services/{service_code}?shop_id=0' \
  -H 'Content-Type: application/json' \
  -d '{
    "booking": {
      "type": "NO_BOOKING"
    },
    "category": {
      "code": "MEALS_AND_DINNERS"
    },
    "custom_attribute_values": [
      {
        "code": "DISABLED_ACCESSIBILITY",
        "type": "BOOLEAN",
        "value": true
      },
      {
        "code": "AGE_MIN",
        "type": "INTEGER",
        "value": 18
      },
      {
        "code": "FOOD_SPECIALITY",
        "type": "VALUE_LIST",
        "value": [
          {
            "code": "FRENCH"
          },
          {
            "code": "CHINESE"
          }
        ]
      }
    ],
    "date_availability_end": "2022-05-31T10:15:00Z",
    "date_availability_start": "2017-03-15T10:15:00Z",
    "description": "You will be served a glass of Ruinart Brut champagne, a gastronomic four course dinner, four accompanying wines and coffee service with sweet delicacies.",
    "location": {
      "shop_locations": [
        {
          "id": "702c3e56-dcca-41e2-b6bd-72ba3fa809be"
        },
        {
          "id": "98a6f82d-2408-4609-b182-d1b80b8a9b55"
        }
      ],
      "type": "AT_SHOP_LOCATION"
    },
    "model": {
      "code": "FOOD"
    },
    "pricing": {
      "options": [
        {
          "code": "BRING_YOUR_OWN_MATERIAL",
          "type": "BOOLEAN",
          "values": [
            {
              "amount": 45.8,
              "value": true
            },
            {
              "amount": 0,
              "value": false
            }
          ]
        },
        {
          "code": "EQUIPT_TO_BRING",
          "type": "VALUE_LIST",
          "values": [
            {
              "amount": 45.8,
              "code": "HIKING_STICKS"
            },
            {
              "amount": 12,
              "code": "ADAPTED_OUTFIT"
            },
            {
              "amount": 22,
              "code": "BOOTS"
            }
          ]
        }
      ],
      "price_per_unit": 77,
      "type": "FIXED_PRICE"
    },
    "quantity": {
      "available": 12,
      "max_per_order": 1,
      "type": "LIMITED"
    },
    "service_tax_code": "SERVICE_TAX_CODE",
    "shop": {
      "id": 122
    },
    "title": "Alliance Royal Package Diner"
  }'

Responses

OK

Bodyapplication/json
bookingobjectrequired
categoryobjectrequired

Service category

codestringrequired

Service code

consumptionobjectrequired

Service consumption method: how will the service be consumed ?

custom_attribute_valuesArray of objectsrequired

Service custom attributes values

date_availability_endstring, (date-time)

Date when the service ends being available

date_availability_startstring, (date-time)

Date when the service starts being available

date_createdstring, (date-time)required

Service creation date

date_updatedstring, (date-time)required

Service update date

descriptionstring

Service description

inactive_reasonsArray of stringsrequired

List of reasons why the service is inactive. If the service is active, this list is empty

locationobjectrequired
mediasArray of objects

All the medias associated to a service

modelobjectrequired

Service model

pricingobjectrequired
quantityobjectrequired
service_tax_codestring

Service tax code

titlestringrequired

Service title

Response
{ "booking": { "type": "NO_BOOKING" }, "category": { "code": "MEALS_AND_DINNERS", "label": "Meals & Dinners" }, "code": "UEVT44VJXD", "consumption": { "type": "VOUCHER" }, "custom_attribute_values": [ { … }, { … }, { … } ], "date_availability_start": "2017-03-15T10:15:00Z", "date_created": "2017-03-29T13:52:37Z", "date_updated": "2017-03-29T13:52:37Z", "description": "You will be served a glass of Ruinart Brut champagne, a gastronomic four course dinner, four accompanying wines and coffee service with sweet delicacies.", "inactive_reasons": [ "MANUALLY_DISABLED" ], "location": { "shop_locations": [ … ], "type": "AT_SHOP_LOCATION" }, "medias": [ { … } ], "model": { "code": "FOOD", "title": "All services related to food" }, "pricing": { "max_price_per_unit": 202.6, "min_price_per_unit": 77, "options": [ … ], "price_per_unit": 77, "type": "FIXED_PRICE" }, "quantity": { "available": 12, "max_per_order": 1, "type": "LIMITED" }, "shop": { "currency_code": "EUR", "id": 122, "name": "Advansed Teksyztems" }, "title": "Alliance Royal Package Diner" }