Skip to content

Update order

To update the whole order with a single request, then it is advised to use the update order endpoint.

Update order with/without OrderItemNumber

To keep orderItem it is necessary to specify orderItemNumber in the request.

To replace orderItem with a new one it is necessary not to specify orderItemNumber in the request. (orderItems which existed in the order but were skipped in the update request, will be removed, and orderItems in the updated request without orderItemNumber will be saved with new-generated orderItemNumbers)

In the next example instead of providing full product configurations only the offerBundleId was provided

{
    "orderStatus": "Placed",
    "priceCurrency": "CHF",
    "orderedItem": [
        {
            "orderQuantity": 1,
            "orderedItem": {
                "product": {
                    "identifier": "nova_zurichcard24"
                },
                "validFrom": "2021-10-15T11:00:00",
                "traveler": [
                    {
                        "identifier":"a",
                        "gender": "Female",
                        "givenName": "Ursula",
                        "familyName": "Vetsch",
                        "birthDate": "2000-02-18T15:00:00"
                    }
                ]
            }
        },
        {
            "orderQuantity": 1,
            "orderItemNumber": "21-102000-1",
            "offerBundleId": "d7d54e5b-706b-4d26-bfde-f6bb5f5e20d5"
        }
    ],
    "term": [
         {
        "termCode": "DS-AGB-guest",
        "accepted": true
        },
        {
        "termCode": "ZHT-AGB|ZHT-DPP",
        "accepted": true
        }
    ]
}
PUT https://api.discover.swiss/test/market/v1/orders/21-102000
{
    "order": {
        "orderNumber": "21-101969",
        "orderDate": "2021-10-11T14:34:21.8608007+00:00",
        "customer": {
            "profileId": "a23a4be8-8f4f-4a53-ae29-917349c11df4",
            "additionalName": "Remark",
            "address": {
                "addressCountry": "CH",
                "addressLocality": "Werdenberg",
                "addressRegion": "SG",
                "postalCode": "9472",
                "streetAddress": "Dorf 1"
            },
            "email": "harry.phoenix@test.in",
            "familyName": "Phoenix",
            "gender": "Male",
            "givenName": "Harry",
            "nationality": "CH",
            "birthDate": "2000-12-07",
            "displayName": "Harry Phoenix",
            "isGuest": "True",
            "passport": "ccxxx",
            "maritalStatus": "Single",
            "mobilePhone": "079 365 45 88",
            "salutation": "Mr",
            "preferredLanguage": "de",
            "hasProfileImage": false,
            "dataGovernance": {
                "origin": [
                    {
                        "datasource": "some_datasource",
                        "created": "2021-09-27T06:15:00.6913204-06:00",
                        "lastModified": "2021-10-10T02:43:41.8015455-06:00",
                        "provider": {
                            "acronym": "some_acronym"
                        },
                        "source": {
                            "acronym": "some_acronym"
                        },
                        "author": {
                            "identifier": "a23a4be8-8f4f-4a53-ae29-917349c11df4"
                        }
                    }
                ]
            },
            "createdDateTime": "2021-09-27T06:15:00.6924683-06:00",
            "lastModified": "2021-10-10T02:43:41.8021602-06:00",
            "lastModifiedBy": "a23a4be8-8f4f-4a53-ae29-917349c11df4",
            "createdBySubscription": "some_subscription",
            "lastModifiedBySubscription": "some_subscription"
        },
        "orderStatus": "Placed",
        "priceCurrency": "CHF",
        "totalAmount": 46.0,
        "totalAmountCHF": 46.0,
        "totalTaxCHF": 3.542,
        "language": "en",
       "orderedItem": [
            {
                "orderItemNumber": "21-102000-3",
                "orderItemStatus": "Placed",
                "orderQuantity": 1,
                "orderedItem": {
                    "product": {
                        "identifier": "nova_zurichcard24",
                        "productIdentifier": "nova_zurichcard",
                        "sku": "895",
                        "name": "ZVV Zürich Card, ZVV Zürich Card 24 hours",
                        "dataGovernance": {
                            "provider": {
                                "acronym": "sbb"
                            },
                            "term": {
                                "code": "ZHT-AGB|ZHT-DPP"
                            },
                            "source": {
                                "acronym": "zht"
                            }
                        },
                        "priceList": [
                            {
                                "priceCHF": 19.0,
                                "maxAllowedAge": 15,
                                "minAllowedAge": 5
                            },
                            {
                                "priceCHF": 27.0,
                                "maxAllowedAge": 2500,
                                "minAllowedAge": 15
                            }
                        ],
                        "taxRate": 0.077
                    },
                    "validFrom": "2021-10-15T11:00:00+00:00",
                    "traveler": [
                        {
                            "priceCHF": 27.0,
                            "identifier": "a",
                            "gender": "Female",
                            "givenName": "Ursula",
                            "familyName": "Vetsch",
                            "birthDate": "2000-02-18T00:00:00"
                        }
                    ]
                },
                "orderDelivery": "e-ticket",
                "amount": 27.0,
                "amountCHF": 27.0,
                "taxCHF": 2.079,
                "ticket": [],
                "offerBundleId": "ef8980df-31a6-47e4-a3d5-e6cbbd98515e"
            },
            {
                "orderItemNumber": "21-102000-1",
                "orderItemStatus": "Placed",
                "orderQuantity": 1,
                "orderedItem": {
                    "product": {
                        "identifier": "nova_zurichcard24",
                        "productIdentifier": "nova_zurichcard",
                        "sku": "895",
                        "name": "ZVV Zürich Card, ZVV Zürich Card 24 hours",
                        "dataGovernance": {
                            "provider": {
                                "acronym": "sbb"
                            },
                            "term": {
                                "code": "ZHT-AGB|ZHT-DPP"
                            },
                            "source": {
                                "acronym": "zht"
                            }
                        },
                        "priceList": [
                            {
                                "priceCHF": 19.0,
                                "maxAllowedAge": 15,
                                "minAllowedAge": 5
                            },
                            {
                                "priceCHF": 27.0,
                                "maxAllowedAge": 2500,
                                "minAllowedAge": 15
                            }
                        ],
                        "taxRate": 0.077
                    },
                    "validFrom": "2021-10-19T00:00:00+00:00",
                    "traveler": [
                        {
                            "priceCHF": 19.0,
                            "identifier": "07016f05-5ef0-c386-541f-50b6b97af07b",
                            "givenName": "Alex",
                            "familyName": "Enrike",
                            "birthDate": "2014-09-14T00:00:00"
                        }
                    ]
                },
                "orderDelivery": "e-ticket",
                "amount": 19.0,
                "amountCHF": 19.0,
                "taxRate": 1.463,
                "taxCHF": 1.463,
                "ticket": [],
                "offerBundleId": "d7d54e5b-706b-4d26-bfde-f6bb5f5e20d5"
            }
        ],
        "term": [
            {
                "termCode": "ZHT-AGB|ZHT-DPP",
                "accepted": true,
                "acceptedDate": "2021-10-11T14:34:22.2501345+00:00",
                "termVersions": [
                    {
                        "@id": "{{ infoUrl }}/termversions/ZHT-AGB-2.0",
                        "code": "ZHT-AGB-2.0",
                        "name": "Allgemeine Geschäftsbedingungen von Zürich Tourismus",
                        "partnerName": "Zurich Tourism",
                        "termDocument": "https://www.zuerich.com/gtc",
                        "validFrom": "2018-08-29T00:00:00+00:00",
                        "termCode": "ZHT-AGB"
                    },
                    {
                        "@id": "{{ infoUrl }}/termversions/ZHT-DPP-2019-10-28",
                        "code": "ZHT-DPP-2019-10-28",
                        "name": "Datenschutzerklärung von Zürich Tourismus",
                        "partnerName": "Zurich Tourism",
                        "termDocument": "https://www.zuerich.com/datenschutz",
                        "validFrom": "2019-10-28T00:00:00+00:00",
                        "termCode": "ZHT-DPP"
                    }
                ]
            }
        ],
        "partnerAcronym": "ds",
        "profileId": "a23a4be8-8f4f-4a53-ae29-917349c11df4",
        "@id": "https://api.discover.swiss/test/market/v1/orders/21-102000",
        "dataGovernance": {
            "origin": [
                {
                    "datasource": "christian-postman",
                    "created": "2021-10-11T14:32:45.5581359+00:00",
                    "lastModified": "2021-10-11T14:34:24.6574226+00:00",
                    "provider": {
                        "acronym": "provider_acronym"
                    },
                    "source": {
                        "acronym": "source_acronym"
                    },
                    "author": {
                        "identifier": "a23a4be8-8f4f-4a53-ae29-917349c11df4"
                    }
                }
            ]
        },
        "createdDateTime": "2021-10-11T14:32:45.5581623+00:00",
        "lastModified": "2021-10-11T14:34:24.6574344+00:00",
        "lastModifiedBy": "a23a4be8-8f4f-4a53-ae29-917349c11df4",
        "createdBySubscription": "some_subscription",
        "lastModifiedBySubscription": "some_subscription"
    },
    "validationMessages": []
}

Information

you must provide the same travelers identifiers that sent in the request to get the offer or offerBundle and attached with the offerBundleId in orderItem. Read more

Information

Since the state machine runs through all not Placed(Checkout or below) ordered items. The updating of an order item returns all validation messages including the one related to the order and to the different order items.

Update order OrderStatus

To update the status of an order, it is necessary to provide OrderStatus property in the request with desired status. It can be New, Checkout or Placed.

Order can also be moved to placed status using place endpoint. Read more


Last update: February 1, 2024 17:37:15