B2B Marketplace service endpoints¶
- For general information see How to work with the B2B 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 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 |
Business trail¶
url | verb | request | response | description |
---|---|---|---|---|
/businesstrail | POST | BusinessTrail | empty | Creates a new Business-trail entry or returns BadRequest and validation messages |
Order (shopping cart)¶
name | url | verb | request | response | description |
---|---|---|---|---|---|
create order | /orders | POST | Order | OrderUpdateResponse | if the object is technically correct it is created even when there are validation errors |
update order | /orders/{id} | PUT | Order | OrderUpdateResponse | if the object is technically correct it is updated even when there are validation errors |
get a single order | /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[] | |
delete order | /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. |
create order-item | /orders/{id}/items | POST | id (orderNumber) OrderItem |
OrderItemUpdateResponse | add new order item to existing order |
update order-item | /orders/{id}/items/{itemId} | PUT | id (orderNumber) itemId (orderItemNumber) OrderItem |
OrderItemUpdateResponse | update existing order item in the order |
get order-item | /orders/{id}/items/{itemId} | GET | id (orderNumber) itemId (orderItemNumber) OrderItem |
OrderItemUpdateResponse | get existing order item in the order |
remove order-item | /orders/{id}/items/{itemId} | DELETE | id (orderNumber) itemId (orderItemNumber) OrderItem |
200: - error: OrderItemUpdateResponse |
delete existing order item in the order |
get all additional properties | /orders/{id}/additionalproperty | GET | id (orderNumber) | PropertyValueUpdateResponse | get all additional properties in the order |
get additional property | /orders/{id}/additionalproperty/{propertyId} | GET | id (orderNumber) propertyId |
PropertyValueUpdateResponse | get existing additional property in the order |
create additional property | /orders/{id}/additionalproperty | POST | id (orderNumber) PropertyValue |
PropertyValueUpdateResponse | add new additional property to existing order |
update order-item | /orders/{id}/additionalproperty/{propertyId} | PUT | id (orderNumber) propertyId PropertyValue |
PropertyValueUpdateResponse | update existing additional property in the order |
remove order-item | /orders/{id}/additionalproperty/{propertyId} | DELETE | id (orderNumber) propertyId |
200: - error: PropertyValueUpdateResponse |
delete existing additional property in the order |
find offers | /orders/{id}/offers | POST | id (orderNumber) ProductConfiguration |
FindOfferResponse | returns list of the offer bundles for provided product configurations |
place order | /orders/{id}/place | PUT | id (orderNumber) | OrderUpdateResponse | moves the order forward to placed and goes through all statuses |
init order pay | /orders/{id}/payment | PUT | PaymentRequest | 200: - PaymentResponse |
|
cancel order | /orders/{id}/cancel | DELETE | id (orderNumber) |
200: - error: OrderUpdateResponse |
cancel all orderItems which is possible to cancel |
update customer | /orders/{id}/customer | PUT | id (orderNumber) Person |
OrderUpdateResponse | updates the order with the person provided in the body |
update billing address | /orders/{id}/billingaddress | PUT | id (orderNumber) FullAddress |
OrderUpdateResponse | updates the order billing address with address provided in the body |
update shipping address | /orders/{id}/shippingaddress | PUT | id (orderNumber) FullAddress |
OrderUpdateResponse | updates the order shipping address with address provided in the body |
delete billing address | /orders/{id}/billingaddress | DELETE | id (orderNumber) | OrderUpdateResponse | removes the order billing address |
delete shipping address | /orders/{id}/shippingaddress | DELETE | id (orderNumber) | OrderUpdateResponse | removes the order shipping address |
Note
If there are validation errors, http status code will be 400.
Product¶
name | url | verb | request | response |
---|---|---|---|---|
List Products | /products | GET | ProductListRequest | BaseListResponse<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 |
ProductListRequest¶
Property | Type | Description |
---|---|---|
project | string | related project |
updatedSince | string | |
additionalType | string | |
category | string | |
select | string | |
identifiers | string | |
сontinuationToken | string | used for pagination |
top | int | number of items in result |
includeCount | bool | if there is total items count in response |
partner | string |
PaymentRequest¶
Property | Type | Description |
---|---|---|
reference | string | Any description. It would be set in payment details of the order |
PaymentResponse¶
Property | Type | Description |
---|---|---|
validationMessages | ValidationMessage[] | messages from the state machine |
PaymentData | OrderPaymentDetailsResponse | The resulting object in the state before the order is processed. With set paymentType and reference |
OrderPaymentDetailsResponse¶
Property | Type | Description |
---|---|---|
PaymentType | string | Type of payment. (B2B) |
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.
Last update:
January 27, 2023 14:37:03