Marketplace service endpoints¶
- For general information see How to work with the marketplace service.
- Technical definitions of each API, sample code, test UI and Open API definitions to download you can find in the developer portal.
-> developer.discover.swiss/apis
General headers¶
Header Name | Type | Description |
---|---|---|
Ocp-Apim-Subscription-Key | string | Appropriate subscription key you can get in the developer portal |
Accept-Timezone | string | Supply a TimeZone id property acquired from Infocenter /timezones route or IANA code in order to get data with desired time offset. The default is UTC. |
Content-Type | string | default: application/json;charset=UTF-8 Use a different charset if your application is not sending the data in utf-8. for example: application/json;charset=ISO-8859-1 |
Order (shopping cart)¶
url | verb | request | response | description |
---|---|---|---|---|
/orders | POST | Order | OrderUpdateResponse | if the object is technically correct it is created even when there are validation errors |
/orders/{id} | PUT | Order | OrderUpdateResponse | if the object is technically correct it is updated even when there are validation errors |
/orders/{id} | GET | id (orderNumber) | OrderUpdateResponse | Can be used to poll the order status or to get other known orders |
get all ticket from the order | /orders/{id}/tickets | GET | id (orderNumber) | Ticket[] |
/orders/{id} | DELETE | id (orderNumber) | 200: - error: OrderUpdateResponse |
depending on the status of the order it removes it from the database or sets the status to deleted or cancelled. |
/orders/{id}/items | POST | id (orderNumber) OrderItem |
OrderItemUpdateResponse | add new order item to existing order |
/orders/{id}/items/{itemId} | PUT | id (orderNumber) itemId (orderItemNumber) OrderItem |
OrderItemUpdateResponse | update existing order item in the order |
/orders/{id}/items/{itemId} | GET | id (orderNumber) itemId (orderItemNumber) OrderItem |
OrderItemUpdateResponse | get existing order item in the order |
/orders/{id}/items/{itemId} | DELETE | id (orderNumber) itemId (orderItemNumber) OrderItem |
200: - error: OrderItemUpdateResponse) |
delete existing order item in the order |
/orders/{id}/additionalproperty | GET | id (orderNumber) | PropertyValueUpdateResponse | get all additional properties in the order |
/orders/{id}/additionalproperty/{propertyId} | GET | id (orderNumber) propertyId |
PropertyValueUpdateResponse | get existing additional property in the order |
/orders/{id}/additionalproperty | POST | id (orderNumber) PropertyValue |
PropertyValueUpdateResponse | add new additional property to existing order |
/orders/{id}/additionalproperty/{propertyId} | PUT | id (orderNumber) propertyId PropertyValue |
PropertyValueUpdateResponse | update existing additional property in the order |
/orders/{id}/additionalproperty/{propertyId} | DELETE | id (orderNumber) propertyId |
200: - error: PropertyValueUpdateResponse |
delete existing additional property in the order |
/orders/{id}/offers | POST | id (orderNumber) ProductConfiguration |
FindOfferResponse | returns list of the offer bundles for provided product configurations |
/orders/{id}/customer | PUT | id (orderNumber) | OrderUpdateResponse | updates the order with the person in the profile |
/orders/{id}/billingaddress | PUT | id (orderNumber) FullAddress |
OrderUpdateResponse | updates the order billing address with address provided in the body |
/orders/{id}/shippingaddress | PUT | id (orderNumber) FullAddress |
OrderUpdateResponse | updates the order shipping address with address provided in the body |
/orders/{id}/billingaddress | DELETE | id (orderNumber) | OrderUpdateResponse | removes the order billing address |
/orders/{id}/shippingaddress | DELETE | id (orderNumber) | OrderUpdateResponse | removes the order shipping address |
/orders/{id}/place | PUT | id (orderNumber) | OrderUpdateResponse | moves the order forward to placed and goes through all statuses |
If there are validation errors, http status code will be 400.
Product¶
name | url | verb | request | response |
---|---|---|---|---|
Get product | /products/{id} | GET | id | Product |
List of product availabilities | /productavailability | POST | ProductAvailabilityRequest | ProductAvailabilityResponse |
List of product variant availabilities | /productvariantavailability | POST | ProductVariantAvailabilityRequest | ProductVariantAvailabilityResponse |
Note
Whenever possible we try to supply information for the next 60 days. If there is no entry in the result for a specific day for the requested product or variant it means that we do not have any availability information, if there is an entry and the count=0, then the product is not available that day.
ProductAvailabilityRequest¶
Property | Type | Description |
---|---|---|
dateFrom | DateTime? | starting date of the period to query |
dateUntil | DateTime? | end date of the period to query |
availableDatesOnly | bool | true in the result are only entries with availabilities (with Count more than 0) |
product | string[] | list of products to query |
сontinuationToken | string | used for pagination |
top | int | number of items in result |
includeCount | bool | if there is total items count in response |
partner | string |
ProductVariantAvailabilityRequest¶
Property | Type | Description |
---|---|---|
dateFrom | DateTime? | starting date of the period to query |
dateUntil | DateTime? | end date of the period to query |
availableDatesOnly | bool | true in the result are only entries with availabilities (with Count more than 0) |
ProductVariant | string[] | list of product variants to query |
сontinuationToken | string | used for pagination |
top | int | number of items in result |
includeCount | bool | if there is total items count in response |
partner | string |
ProductAvailabilityResponse¶
Property | Type | Description |
---|---|---|
productIdentifier | string | |
@product | string | full url to load the product |
date | DateTime | the date of the availability |
count | int | count of available seats - an entry with count 0 means no availability - no entry in the database or result means no information |
service | string | the service identifier |
ProductVariantAvailabilityResponse¶
Property | Type | Description |
---|---|---|
productIdentifier | string | |
ProductVariantIdentifier | string | |
@product | string | full url to load the product |
@productVariant | string | full url to load the product variant |
date | DateTime | the date of the availability |
count | int | count of available seats - an entry with count 0 means no availability - no entry in the database or result means no information |
service | string | the service identifier |
OrderUpdateResponse¶
Property | Type | Description |
---|---|---|
validationMessages | ValidationMessage[] | validation messages occured during the order processing |
order | Order | order object and terms to accept |
itemOffers | ItemOfferResponse |
OrderItemUpdateResponse¶
Property | Type | Description |
---|---|---|
validationMessages | ValidationMessage[] | validation messages occured during the order processing |
orderItem | OrderItem | order item object |
itemOffers | ItemOfferResponse |
PropertyValueUpdateResponse¶
Property | Type | Description |
---|---|---|
validationMessages | ValidationMessage[] | validation messages occured during the order processing |
propertyValues | PropertyValue[] | additional property objects |
FindOfferResponse¶
Property | Type | Description |
---|---|---|
validationMessages | ValidationMessage[] | messages from the state machine |
offerBundle | OfferBundle[] | offers to order items if there must be something chosen by the client |
Accept terms¶
To accept the terms and conditions inside the order and any time during the process.
This endpoint is using the same objects like the terms-endpoint in the profile service.
url | verb | request | response |
---|---|---|---|
/orders/{id}/terms/{termCode} | PUT | TermVersionCheckRequest | TermVersionCheck |
Info
Accepting the terms by using this call does not change the status of the order.
Initialize payment¶
This creates a checkout session - to use the web checkout - or a PaymentIntent - to proceed with a client api from Stripe - and returns everything which is needed to start the payment process on client side.
url | verb | request | response |
---|---|---|---|
/orders/{id}/payment | PUT | InitPaymentDataRequest | InitPaymentDataResponse |
InitPaymentDataRequest¶
Property | Type | Description |
---|---|---|
CreateCheckoutSession | string | true: creates a web checkout session see https://stripe.com/en-ch/payments/checkout false: creates a payment intent (default) https://stripe.com/docs/payments/payment-intents |
SuccessUrl | string | url to redirect after successful checkout (*) |
ErrorUrl | string | url to return on error during the check out procedure at stripe (*) |
Reference | string | any small text you want to appear in our/your invoice. For example you session-id or your order-number |
PaymentRequestType | PaymentRequestType | Type of property is enum with values B2b - 0, Stripe - 1, B2cEmpty - 2 |
(*) only if web checkout session was requested
InitPaymentDataResponse¶
Property | Type | Description |
---|---|---|
validationMessages | ValidationMessage[] | messages from the state machine |
InitPaymentData | InitPaymentData | terms to accept in the TermVersionCheck objects of the order |
InitPaymentData¶
Property | Type | Description |
---|---|---|
SessionId | string | Payment session id (third-party payment system) only if web checkout session was requested |
ClientSecret | string | important for native client integration with stripe api's only if web a payment intent was requested |
PaymentApiKey | string | client api key |
Result | bool | true if successful |
Product¶
url | verb | request | response |
---|---|---|---|
/products/{id} | GET | identifier | Product |
Partner¶
url | verb | request | response |
---|---|---|---|
/partners/current | GET | Partner |