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 in order to get data with desired time offset. The default is *UTC. |
Order (shopping cart)¶
url | verb | request | response | description |
---|---|---|---|---|
/orders | POST | Order | OrderResponse | if the object is technically correct it is created even when there are validation errors |
/orders/{id} | PUT | Order | OrderResponse | if the object is technically correct it is updated even when there are validation errors |
/orders/{id} | GET | id (orderNumber) | OrderResponse | Can be used to poll the order state or to get other known orders |
/orders/{id} | DELETE | id (orderNumber) | 200: - error: OrderResponse |
depending on the state of the order it removes it from the database or sets the state to deleted or cancelled. |
If there are validation errors, http status code will be 400.
OrderResponse¶
Property | Type | Description |
---|---|---|
validationMessages | ValidationMessage[] | messages from the state machine |
terms | TermVersion[] | terms to accept in the TermVersionCheck objects of the order |
order | Order | json-ld: full url to load the object (based on orderNumber) |
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 state 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 (*) |
(*) 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 |
Last update: November 23, 2020 06:23:58