Składanie zamówienia¶
Wywołanie złożenia zamówienia następuje, gdy użytkownik potwierdzi zamówienie, a płatność zostanie pozytywynie autoryzowana przez OpenApp.
Wysłanie informacji o zamówieniu do sklepu widoczne jest na kroku 9 poniższego diagramu:
sequenceDiagram
autonumber
actor User
participant OpenApp
participant Merchant
Merchant->>User: Wyświetlenie widgetu OA
User->>User: Skan kodu QR
User->>+OpenApp: Pobranie koszyka
OpenApp->>+Merchant: Pobranie koszyka i opcji dostawy
Merchant->>-OpenApp: Zwrócenie koszyka i opcji dostawy
OpenApp->>-User: Zwrócenie koszyka
User->>+OpenApp: Płatność i złożenie zamówienia
OpenApp->>OpenApp: Autoryzacja płatności
OpenApp->>+Merchant: Potwierdzenie płatności i złożenie zamówienia
Merchant->>-OpenApp: Potwierdzenie złożenia zamówienia
OpenApp->>-User: Potwierdzenie zamówienia
Request¶
W takim przypadku OpenApp wykona POST HTTP do endpointu skonfigurowanego w panelu sprzedawcy, z informacją o zamówieniu w treści żądania.
Jeśli skonfigurowałeś jako URL składania zamówienia na https://shop.example.com/api/openapp/order
, żądanie do serwera będzie wyglądało tak:
W treści zapytania POST, OpenApp umieści wszystkie wymagane dane potrzebne do złożenia zamówienia. Właściwy zestaw danych zależny jest od wyboru metody dostawy przez klienta w aplikacji mobilnej.
Parametr oaOrderId jest unikalnym identyfikatorem zamówienia. Jeśli z jakiegoś powodu OpenApp nie otrzyma odpowiedzi podczas składania zamówienia w sklepie, wywołanie zostanie powtórzone, dlatego bardzo ważne jest, aby API sklepu obsługiwało żądania w sposób idempotentny (czyli dla zapytania powtórzonego kilka razy API zwraca ten sam rezultat w przypadku sukcesu, bez tworzenia zamówienia kilka razy).
Dostawa do automatu paczkowego (APM)¶
W poniższym przykładzie, użytkownik wybrał dostawę do skrytki automatu paczkowego. Request zawiera informacje o tym która maszyna została wybrana oraz informacje kontaktowe użytkownika aby przesłać mu kod odbioru przesyłki.
{
"description": "The data for an order placed through OpenApp.",
"title": "MerchantPlaceOrder#",
"additionalProperties": false,
"type": "object",
"properties": {
"oaOrderId": {
"description": "The unique ID of the order generated by OpenApp.",
"maxLength": 36,
"type": "string",
"title": "oaOrderId"
},
"basket": {
"$ref": "#/definitions/OpenPayOrderBasket",
"description": "The shopping basket",
"title": "basket"
},
"deliveryDetails": {
"$ref": "#/definitions/DeliveryDetails",
"description": "The details of delivery",
"title": "deliveryDetails"
},
"billingDetails": {
"description": "The details of invoice",
"$ref": "#/definitions/BillingDetails",
"title": "billingDetails"
},
"paymentDetails": {
"$ref": "#/definitions/PlaceOrderAmount",
"description": "The details of the payment",
"title": "paymentDetails"
},
"consents": {
"description": "The consents which the user agreed to",
"type": "array",
"items": {
"$ref": "#/definitions/OrderConsent"
},
"title": "consents"
}
},
"required": [
"basket",
"consents",
"deliveryDetails",
"oaOrderId",
"paymentDetails"
],
"definitions": {
"OpenPayOrderBasket": {
"title": "OpenPayOrderBasket",
"type": "object",
"properties": {
"id": {
"description": "The id of the shopping basket which is purchased",
"maxLength": 36,
"type": "string",
"title": "id"
},
"price": {
"$ref": "#/definitions/PlaceOrderPrice",
"description": "The basket price information",
"title": "price"
},
"products": {
"description": "The basket products",
"type": "array",
"items": {
"$ref": "#/definitions/BaseProduct"
},
"title": "products"
},
"loggedUser": {
"description": "The id of the user in the merchant store (if known)",
"type": "string",
"title": "loggedUser"
}
},
"required": [
"id",
"price",
"products"
]
},
"PlaceOrderPrice": {
"description": "The basket price information",
"title": "PlaceOrderPrice",
"type": "object",
"properties": {
"deliveryCost": {
"description": "The delivery cost. Price is expressed as the number (integer) of 1/100s of the price.",
"minimum": 0,
"type": "integer",
"title": "deliveryCost"
},
"currency": {
"type": "string",
"title": "currency"
},
"basketValue": {
"description": "The price of the basket. Price is expressed as the number (integer) of 1/100s of the price.",
"minimum": 0,
"type": "integer",
"title": "basketValue"
},
"discounts": {
"description": "Applied discounts",
"type": "array",
"items": {
"$ref": "#/definitions/BasketPriceDiscount"
},
"title": "discounts"
}
},
"required": [
"basketValue",
"currency",
"deliveryCost",
"discounts"
]
},
"BasketPriceDiscount": {
"title": "BasketPriceDiscount",
"type": "object",
"properties": {
"code": {
"description": "The discount code.",
"maxLength": 36,
"type": "string",
"title": "code"
},
"value": {
"description": "The value of the discount. Value is expressed as the number (integer) of 1/100s of the currency.",
"minimum": 0,
"type": "integer",
"title": "value"
},
"error": {
"description": "The error code of the discount",
"enum": [
"EXPIRED",
"INVALID",
"NOT_APPLICABLE",
"USED"
],
"type": "string",
"title": "error"
}
},
"required": [
"code",
"value"
]
},
"BaseProduct": {
"title": "BaseProduct",
"type": "object",
"properties": {
"ean": {
"description": "The ean (or other barcode on the product). Specifying this allows the user to search in his order history by scanning the barcode to do a re-purchase.",
"maxLength": 36,
"type": "string",
"title": "ean"
},
"id": {
"description": "The unique ID of the product.",
"maxLength": 36,
"type": "string",
"title": "id"
},
"quantity": {
"description": "The number of items in the purchase.",
"minimum": 0,
"type": "integer",
"title": "quantity"
},
"unitPrice": {
"description": "The price of a single product. Price is expressed as the number (integer) of 1/100s of the price.",
"type": "integer",
"title": "unitPrice"
},
"linePrice": {
"description": "The price of the products. Price is expressed as the number (integer) of 1/100s of the price.",
"type": "integer",
"title": "linePrice"
}
},
"required": [
"id",
"linePrice",
"quantity",
"unitPrice"
]
},
"DeliveryDetails": {
"title": "DeliveryDetails",
"anyOf": [
{
"type": "object",
"properties": {
"type": {
"description": "Delivery to a pickup point",
"type": "string",
"enum": [
"PICKUP"
],
"title": "type"
},
"subType": {
"$ref": "#/definitions/CheckoutDeliverySubtype",
"description": "The type of pickup point",
"title": "subType"
},
"method": {
"$ref": "#/definitions/MerchantDeliveryOptions",
"description": "The method",
"title": "method"
},
"name": {
"description": "The name of the pickup point",
"type": "string",
"title": "name"
},
"id": {
"description": "The code of the pickup point",
"type": "string",
"title": "id"
},
"lat": {
"description": "The lattitude of the pickup point",
"type": "number",
"title": "lat"
},
"lng": {
"description": "The longitude of the pickup point",
"type": "number",
"title": "lng"
},
"street": {
"description": "The street",
"type": "string",
"title": "street"
},
"streetNo": {
"description": "The number on the street",
"type": "string",
"title": "streetNo"
},
"apartmentNo": {
"description": "The appartment number",
"type": "string",
"title": "apartmentNo"
},
"postalCode": {
"description": "The postal code",
"type": "string",
"title": "postalCode"
},
"city": {
"description": "The city",
"type": "string",
"title": "city"
},
"country": {
"description": "The country",
"type": "string",
"enum": [
"PL"
],
"title": "country"
},
"phoneNumber": {
"description": "The phone number",
"type": "string",
"title": "phoneNumber"
},
"email": {
"description": "The email address",
"type": "string",
"title": "email"
}
},
"required": [
"city",
"country",
"email",
"id",
"method",
"name",
"postalCode",
"street",
"subType",
"type"
]
},
{
"type": "object",
"properties": {
"type": {
"description": "Delivery by courier",
"type": "string",
"enum": [
"COURIER"
],
"title": "type"
},
"method": {
"$ref": "#/definitions/MerchantDeliveryOptions",
"title": "method"
},
"street": {
"description": "The street",
"type": "string",
"title": "street"
},
"streetNo": {
"description": "The number on the street",
"type": "string",
"title": "streetNo"
},
"apartmentNo": {
"description": "The appartment number",
"type": "string",
"title": "apartmentNo"
},
"postalCode": {
"description": "The postal code",
"type": "string",
"title": "postalCode"
},
"city": {
"description": "The city",
"type": "string",
"title": "city"
},
"country": {
"description": "The country",
"type": "string",
"enum": [
"PL"
],
"title": "country"
},
"notes": {
"description": "Additional notes",
"type": "string",
"title": "notes"
},
"firstName": {
"description": "The first name",
"type": "string",
"title": "firstName"
},
"lastName": {
"description": "The last name",
"type": "string",
"title": "lastName"
},
"phoneNumber": {
"description": "The phone number",
"type": "string",
"title": "phoneNumber"
},
"companyName": {
"description": "The company name",
"type": "string",
"title": "companyName"
},
"email": {
"description": "The email address",
"type": "string",
"title": "email"
}
},
"required": [
"city",
"country",
"email",
"firstName",
"lastName",
"method",
"notes",
"phoneNumber",
"postalCode",
"street",
"streetNo",
"type"
]
},
{
"type": "object",
"properties": {
"type": {
"description": "Electronic delivery",
"type": "string",
"enum": [
"ELECTRONIC"
],
"title": "type"
},
"method": {
"$ref": "#/definitions/MerchantDeliveryOptions",
"title": "method"
},
"email": {
"description": "The email address",
"type": "string",
"title": "email"
}
},
"required": [
"email",
"method",
"type"
]
}
]
},
"CheckoutDeliverySubtype": {
"title": "CheckoutDeliverySubtype",
"enum": [
"APM",
"PICKUP_POINT",
"SHOP"
],
"type": "string"
},
"MerchantDeliveryOptions": {
"title": "MerchantDeliveryOptions",
"enum": [
"DHL_COURIER",
"DHL_PICKUP",
"DPD_COURIER",
"DPD_PICKUP",
"ELECTRONIC",
"FEDEX_COURIER",
"GEIS_COURIER",
"GLS_COURIER",
"INPOST_APM",
"INPOST_COURIER",
"INSTORE_PICKUP",
"ORLEN_APM",
"POCZTA_POLSKA_APM",
"POCZTEX_COURIER",
"UPS_COURIER"
],
"type": "string"
},
"BillingDetails": {
"title": "BillingDetails",
"type": "object",
"properties": {
"companyName": {
"description": "The name of the comapny for the invoice",
"type": "string",
"title": "companyName"
},
"taxId": {
"description": "The tax number",
"type": "string",
"title": "taxId"
},
"firstName": {
"description": "The first name",
"type": "string",
"title": "firstName"
},
"lastName": {
"description": "The last name",
"type": "string",
"title": "lastName"
},
"country": {
"description": "The country",
"type": "string",
"title": "country"
},
"city": {
"description": "The city",
"type": "string",
"title": "city"
},
"postalCode": {
"description": "The postal code",
"type": "string",
"title": "postalCode"
},
"street": {
"description": "The street",
"type": "string",
"title": "street"
},
"streetNo": {
"description": "The number on the street",
"type": "string",
"title": "streetNo"
},
"apartmentNo": {
"description": "The appartment number",
"type": "string",
"title": "apartmentNo"
},
"notes": {
"description": "Additional notes",
"type": "string",
"title": "notes"
}
},
"required": [
"city",
"country",
"notes",
"postalCode",
"street",
"streetNo"
]
},
"PlaceOrderAmount": {
"title": "PlaceOrderAmount",
"type": "object",
"properties": {
"amount": {
"description": "The total price for the order. Price is expressed as the number (integer) of 1/100s of the price.",
"minimum": 0,
"type": "integer",
"title": "amount"
},
"currency": {
"description": "The currency",
"maxLength": 3,
"type": "string",
"title": "currency"
}
},
"required": [
"amount",
"currency"
]
},
"OrderConsent": {
"title": "OrderConsent",
"type": "object",
"properties": {
"id": {
"description": "The ID of the consent as defined in the merchant panel",
"type": "string",
"title": "id"
},
"version": {
"description": "The version of the consent",
"type": "number",
"title": "version"
}
},
"required": [
"id",
"version"
]
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
Użytkownik nie zażądał faktury, więc tej informacji nie ma w requeście. Jak jest to widoczne na liście produktów, produkt kosztował oryginalnie 70.00zł lecz jego cena została obniżona do 60.00zł. Do zamówienia wykorzystano kod rabatowy o warotści 10.00zł, więc całkowita kwota do zapłaty to 110.00zł i taka kwota została pobrana od użytkownika.
Dostawa elektroniczna¶
Jeśli użytkownik wybrał dostawę elektroniczną, wymaganą daną jest adres email na który zostanie wykonana dostawa elektroniczna zakupionych produktów.
{
"description": "The data for an order placed through OpenApp.",
"title": "MerchantPlaceOrder#",
"additionalProperties": false,
"type": "object",
"properties": {
"oaOrderId": {
"description": "The unique ID of the order generated by OpenApp.",
"maxLength": 36,
"type": "string",
"title": "oaOrderId"
},
"basket": {
"$ref": "#/definitions/OpenPayOrderBasket",
"description": "The shopping basket",
"title": "basket"
},
"deliveryDetails": {
"$ref": "#/definitions/DeliveryDetails",
"description": "The details of delivery",
"title": "deliveryDetails"
},
"billingDetails": {
"description": "The details of invoice",
"$ref": "#/definitions/BillingDetails",
"title": "billingDetails"
},
"paymentDetails": {
"$ref": "#/definitions/PlaceOrderAmount",
"description": "The details of the payment",
"title": "paymentDetails"
},
"consents": {
"description": "The consents which the user agreed to",
"type": "array",
"items": {
"$ref": "#/definitions/OrderConsent"
},
"title": "consents"
}
},
"required": [
"basket",
"consents",
"deliveryDetails",
"oaOrderId",
"paymentDetails"
],
"definitions": {
"OpenPayOrderBasket": {
"title": "OpenPayOrderBasket",
"type": "object",
"properties": {
"id": {
"description": "The id of the shopping basket which is purchased",
"maxLength": 36,
"type": "string",
"title": "id"
},
"price": {
"$ref": "#/definitions/PlaceOrderPrice",
"description": "The basket price information",
"title": "price"
},
"products": {
"description": "The basket products",
"type": "array",
"items": {
"$ref": "#/definitions/BaseProduct"
},
"title": "products"
},
"loggedUser": {
"description": "The id of the user in the merchant store (if known)",
"type": "string",
"title": "loggedUser"
}
},
"required": [
"id",
"price",
"products"
]
},
"PlaceOrderPrice": {
"description": "The basket price information",
"title": "PlaceOrderPrice",
"type": "object",
"properties": {
"deliveryCost": {
"description": "The delivery cost. Price is expressed as the number (integer) of 1/100s of the price.",
"minimum": 0,
"type": "integer",
"title": "deliveryCost"
},
"currency": {
"type": "string",
"title": "currency"
},
"basketValue": {
"description": "The price of the basket. Price is expressed as the number (integer) of 1/100s of the price.",
"minimum": 0,
"type": "integer",
"title": "basketValue"
},
"discounts": {
"description": "Applied discounts",
"type": "array",
"items": {
"$ref": "#/definitions/BasketPriceDiscount"
},
"title": "discounts"
}
},
"required": [
"basketValue",
"currency",
"deliveryCost",
"discounts"
]
},
"BasketPriceDiscount": {
"title": "BasketPriceDiscount",
"type": "object",
"properties": {
"code": {
"description": "The discount code.",
"maxLength": 36,
"type": "string",
"title": "code"
},
"value": {
"description": "The value of the discount. Value is expressed as the number (integer) of 1/100s of the currency.",
"minimum": 0,
"type": "integer",
"title": "value"
},
"error": {
"description": "The error code of the discount",
"enum": [
"EXPIRED",
"INVALID",
"NOT_APPLICABLE",
"USED"
],
"type": "string",
"title": "error"
}
},
"required": [
"code",
"value"
]
},
"BaseProduct": {
"title": "BaseProduct",
"type": "object",
"properties": {
"ean": {
"description": "The ean (or other barcode on the product). Specifying this allows the user to search in his order history by scanning the barcode to do a re-purchase.",
"maxLength": 36,
"type": "string",
"title": "ean"
},
"id": {
"description": "The unique ID of the product.",
"maxLength": 36,
"type": "string",
"title": "id"
},
"quantity": {
"description": "The number of items in the purchase.",
"minimum": 0,
"type": "integer",
"title": "quantity"
},
"unitPrice": {
"description": "The price of a single product. Price is expressed as the number (integer) of 1/100s of the price.",
"type": "integer",
"title": "unitPrice"
},
"linePrice": {
"description": "The price of the products. Price is expressed as the number (integer) of 1/100s of the price.",
"type": "integer",
"title": "linePrice"
}
},
"required": [
"id",
"linePrice",
"quantity",
"unitPrice"
]
},
"DeliveryDetails": {
"title": "DeliveryDetails",
"anyOf": [
{
"type": "object",
"properties": {
"type": {
"description": "Delivery to a pickup point",
"type": "string",
"enum": [
"PICKUP"
],
"title": "type"
},
"subType": {
"$ref": "#/definitions/CheckoutDeliverySubtype",
"description": "The type of pickup point",
"title": "subType"
},
"method": {
"$ref": "#/definitions/MerchantDeliveryOptions",
"description": "The method",
"title": "method"
},
"name": {
"description": "The name of the pickup point",
"type": "string",
"title": "name"
},
"id": {
"description": "The code of the pickup point",
"type": "string",
"title": "id"
},
"lat": {
"description": "The lattitude of the pickup point",
"type": "number",
"title": "lat"
},
"lng": {
"description": "The longitude of the pickup point",
"type": "number",
"title": "lng"
},
"street": {
"description": "The street",
"type": "string",
"title": "street"
},
"streetNo": {
"description": "The number on the street",
"type": "string",
"title": "streetNo"
},
"apartmentNo": {
"description": "The appartment number",
"type": "string",
"title": "apartmentNo"
},
"postalCode": {
"description": "The postal code",
"type": "string",
"title": "postalCode"
},
"city": {
"description": "The city",
"type": "string",
"title": "city"
},
"country": {
"description": "The country",
"type": "string",
"enum": [
"PL"
],
"title": "country"
},
"phoneNumber": {
"description": "The phone number",
"type": "string",
"title": "phoneNumber"
},
"email": {
"description": "The email address",
"type": "string",
"title": "email"
}
},
"required": [
"city",
"country",
"email",
"id",
"method",
"name",
"postalCode",
"street",
"subType",
"type"
]
},
{
"type": "object",
"properties": {
"type": {
"description": "Delivery by courier",
"type": "string",
"enum": [
"COURIER"
],
"title": "type"
},
"method": {
"$ref": "#/definitions/MerchantDeliveryOptions",
"title": "method"
},
"street": {
"description": "The street",
"type": "string",
"title": "street"
},
"streetNo": {
"description": "The number on the street",
"type": "string",
"title": "streetNo"
},
"apartmentNo": {
"description": "The appartment number",
"type": "string",
"title": "apartmentNo"
},
"postalCode": {
"description": "The postal code",
"type": "string",
"title": "postalCode"
},
"city": {
"description": "The city",
"type": "string",
"title": "city"
},
"country": {
"description": "The country",
"type": "string",
"enum": [
"PL"
],
"title": "country"
},
"notes": {
"description": "Additional notes",
"type": "string",
"title": "notes"
},
"firstName": {
"description": "The first name",
"type": "string",
"title": "firstName"
},
"lastName": {
"description": "The last name",
"type": "string",
"title": "lastName"
},
"phoneNumber": {
"description": "The phone number",
"type": "string",
"title": "phoneNumber"
},
"companyName": {
"description": "The company name",
"type": "string",
"title": "companyName"
},
"email": {
"description": "The email address",
"type": "string",
"title": "email"
}
},
"required": [
"city",
"country",
"email",
"firstName",
"lastName",
"method",
"notes",
"phoneNumber",
"postalCode",
"street",
"streetNo",
"type"
]
},
{
"type": "object",
"properties": {
"type": {
"description": "Electronic delivery",
"type": "string",
"enum": [
"ELECTRONIC"
],
"title": "type"
},
"method": {
"$ref": "#/definitions/MerchantDeliveryOptions",
"title": "method"
},
"email": {
"description": "The email address",
"type": "string",
"title": "email"
}
},
"required": [
"email",
"method",
"type"
]
}
]
},
"CheckoutDeliverySubtype": {
"title": "CheckoutDeliverySubtype",
"enum": [
"APM",
"PICKUP_POINT",
"SHOP"
],
"type": "string"
},
"MerchantDeliveryOptions": {
"title": "MerchantDeliveryOptions",
"enum": [
"DHL_COURIER",
"DHL_PICKUP",
"DPD_COURIER",
"DPD_PICKUP",
"ELECTRONIC",
"FEDEX_COURIER",
"GEIS_COURIER",
"GLS_COURIER",
"INPOST_APM",
"INPOST_COURIER",
"INSTORE_PICKUP",
"ORLEN_APM",
"POCZTA_POLSKA_APM",
"POCZTEX_COURIER",
"UPS_COURIER"
],
"type": "string"
},
"BillingDetails": {
"title": "BillingDetails",
"type": "object",
"properties": {
"companyName": {
"description": "The name of the comapny for the invoice",
"type": "string",
"title": "companyName"
},
"taxId": {
"description": "The tax number",
"type": "string",
"title": "taxId"
},
"firstName": {
"description": "The first name",
"type": "string",
"title": "firstName"
},
"lastName": {
"description": "The last name",
"type": "string",
"title": "lastName"
},
"country": {
"description": "The country",
"type": "string",
"title": "country"
},
"city": {
"description": "The city",
"type": "string",
"title": "city"
},
"postalCode": {
"description": "The postal code",
"type": "string",
"title": "postalCode"
},
"street": {
"description": "The street",
"type": "string",
"title": "street"
},
"streetNo": {
"description": "The number on the street",
"type": "string",
"title": "streetNo"
},
"apartmentNo": {
"description": "The appartment number",
"type": "string",
"title": "apartmentNo"
},
"notes": {
"description": "Additional notes",
"type": "string",
"title": "notes"
}
},
"required": [
"city",
"country",
"notes",
"postalCode",
"street",
"streetNo"
]
},
"PlaceOrderAmount": {
"title": "PlaceOrderAmount",
"type": "object",
"properties": {
"amount": {
"description": "The total price for the order. Price is expressed as the number (integer) of 1/100s of the price.",
"minimum": 0,
"type": "integer",
"title": "amount"
},
"currency": {
"description": "The currency",
"maxLength": 3,
"type": "string",
"title": "currency"
}
},
"required": [
"amount",
"currency"
]
},
"OrderConsent": {
"title": "OrderConsent",
"type": "object",
"properties": {
"id": {
"description": "The ID of the consent as defined in the merchant panel",
"type": "string",
"title": "id"
},
"version": {
"description": "The version of the consent",
"type": "number",
"title": "version"
}
},
"required": [
"id",
"version"
]
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
Użytkownik dokonał zakupu jednego produktu kosztującego 60zł. Ponieważ w tym przypadkui nie ma żadnych kodów rabatowych, produkt zawiera tylko cenę jednostkową i cenę za pozycję (ilość produktów razy cena jednostkowa). Brak także pól previousUnitPrice czy previousLinePrice z uwagi na to że nie było na produkcie przeceny. Dodatkowo, warto zauważyć że użytkownik wyraził dwie zgody które zostały przesłane w obiekcie "consents".
Odbiór osobisty w sklepie¶
Jeśli użytkownik wybrał odbiór osobisty w sklepie, szczegóły dostawy zawierają zestaw danych adresowych, wzbogacony o identyfikator sklepu wybranego przez użytkownika w aplikacji mobilnej:
``` json title="Place order request schema" { "description": "The data for an order placed through OpenApp.", "title": "MerchantPlaceOrder#", "additionalProperties": false, "type": "object", "properties": { "oaOrderId": { "description": "The unique ID of the order generated by OpenApp.", "maxLength": 36, "type": "string", "title": "oaOrderId" }, "basket": { "\(ref": "#/definitions/OpenPayOrderBasket", "description": "The shopping basket", "title": "basket" }, "deliveryDetails": { "\)ref": "#/definitions/DeliveryDetails", "description": "The details of delivery", "title": "deliveryDetails" }, "billingDetails": { "description": "The details of invoice", "\(ref": "#/definitions/BillingDetails", "title": "billingDetails" }, "paymentDetails": { "\)ref": "#/definitions/PlaceOrderAmount", "description": "The details of the payment", "title": "paymentDetails" }, "consents": { "description": "The consents which the user agreed to", "type": "array", "items": { "\(ref": "#/definitions/OrderConsent" }, "title": "consents" } }, "required": [ "basket", "consents", "deliveryDetails", "oaOrderId", "paymentDetails" ], "definitions": { "OpenPayOrderBasket": { "title": "OpenPayOrderBasket", "type": "object", "properties": { "id": { "description": "The id of the shopping basket which is purchased", "maxLength": 36, "type": "string", "title": "id" }, "price": { "\)ref": "#/definitions/PlaceOrderPrice", "description": "The basket price information", "title": "price" }, "products": { "description": "The basket products", "type": "array", "items": { "\(ref": "#/definitions/BaseProduct" }, "title": "products" }, "loggedUser": { "description": "The id of the user in the merchant store (if known)", "type": "string", "title": "loggedUser" } }, "required": [ "id", "price", "products" ] }, "PlaceOrderPrice": { "description": "The basket price information", "title": "PlaceOrderPrice", "type": "object", "properties": { "deliveryCost": { "description": "The delivery cost. Price is expressed as the number (integer) of 1/100s of the price.", "minimum": 0, "type": "integer", "title": "deliveryCost" }, "currency": { "type": "string", "title": "currency" }, "basketValue": { "description": "The price of the basket. Price is expressed as the number (integer) of 1/100s of the price.", "minimum": 0, "type": "integer", "title": "basketValue" }, "discounts": { "description": "Applied discounts", "type": "array", "items": { "\)ref": "#/definitions/BasketPriceDiscount" }, "title": "discounts" } }, "required": [ "basketValue", "currency", "deliveryCost", "discounts" ] }, "BasketPriceDiscount": { "title": "BasketPriceDiscount", "type": "object", "properties": { "code": { "description": "The discount code.", "maxLength": 36, "type": "string", "title": "code" }, "value": { "description": "The value of the discount. Value is expressed as the number (integer) of 1/100s of the currency.", "minimum": 0, "type": "integer", "title": "value" }, "error": { "description": "The error code of the discount", "enum": [ "EXPIRED", "INVALID", "NOT_APPLICABLE", "USED" ], "type": "string", "title": "error" } }, "required": [ "code", "value" ] }, "BaseProduct": { "title": "BaseProduct", "type": "object", "properties": { "ean": { "description": "The ean (or other barcode on the product). Specifying this allows the user to search in his order history by scanning the barcode to do a re-purchase.", "maxLength": 36, "type": "string", "title": "ean" }, "id": { "description": "The unique ID of the product.", "maxLength": 36, "type": "string", "title": "id" }, "quantity": { "description": "The number of items in the purchase.", "minimum": 0, "type": "integer", "title": "quantity" }, "unitPrice": { "description": "The price of a single product. Price is expressed as the number (integer) of 1/100s of the price.", "type": "integer", "title": "unitPrice" }, "linePrice": { "description": "The price of the products. Price is expressed as the number (integer) of 1/100s of the price.", "type": "integer", "title": "linePrice" } }, "required": [ "id", "linePrice", "quantity", "unitPrice" ] }, "DeliveryDetails": { "title": "DeliveryDetails", "anyOf": [ { "type": "object", "properties": { "type": { "description": "Delivery to a pickup point", "type": "string", "enum": [ "PICKUP" ], "title": "type" }, "subType": { "\(ref": "#/definitions/CheckoutDeliverySubtype", "description": "The type of pickup point", "title": "subType" }, "method": { "\)ref": "#/definitions/MerchantDeliveryOptions", "description": "The method", "title": "method" }, "name": { "description": "The name of the pickup point", "type": "string", "title": "name" }, "id": { "description": "The code of the pickup point", "type": "string", "title": "id" }, "lat": { "description": "The lattitude of the pickup point", "type": "number", "title": "lat" }, "lng": { "description": "The longitude of the pickup point", "type": "number", "title": "lng" }, "street": { "description": "The street", "type": "string", "title": "street" }, "streetNo": { "description": "The number on the street", "type": "string", "title": "streetNo" }, "apartmentNo": { "description": "The appartment number", "type": "string", "title": "apartmentNo" }, "postalCode": { "description": "The postal code", "type": "string", "title": "postalCode" }, "city": { "description": "The city", "type": "string", "title": "city" }, "country": { "description": "The country", "type": "string", "enum": [ "PL" ], "title": "country" }, "phoneNumber": { "description": "The phone number", "type": "string", "title": "phoneNumber" }, "email": { "description": "The email address", "type": "string", "title": "email" } }, "required": [ "city", "country", "email", "id", "method", "name", "postalCode", "street", "subType", "type" ] }, { "type": "object", "properties": { "type": { "description": "Delivery by courier", "type": "string", "enum": [ "COURIER" ], "title": "type" }, "method": { "\(ref": "#/definitions/MerchantDeliveryOptions", "title": "method" }, "street": { "description": "The street", "type": "string", "title": "street" }, "streetNo": { "description": "The number on the street", "type": "string", "title": "streetNo" }, "apartmentNo": { "description": "The appartment number", "type": "string", "title": "apartmentNo" }, "postalCode": { "description": "The postal code", "type": "string", "title": "postalCode" }, "city": { "description": "The city", "type": "string", "title": "city" }, "country": { "description": "The country", "type": "string", "enum": [ "PL" ], "title": "country" }, "notes": { "description": "Additional notes", "type": "string", "title": "notes" }, "firstName": { "description": "The first name", "type": "string", "title": "firstName" }, "lastName": { "description": "The last name", "type": "string", "title": "lastName" }, "phoneNumber": { "description": "The phone number", "type": "string", "title": "phoneNumber" }, "companyName": { "description": "The company name", "type": "string", "title": "companyName" }, "email": { "description": "The email address", "type": "string", "title": "email" } }, "required": [ "city", "country", "email", "firstName", "lastName", "method", "notes", "phoneNumber", "postalCode", "street", "streetNo", "type" ] }, { "type": "object", "properties": { "type": { "description": "Electronic delivery", "type": "string", "enum": [ "ELECTRONIC" ], "title": "type" }, "method": { "\)ref": "#/definitions/MerchantDeliveryOptions", "title": "method" }, "email": { "description": "The email address", "type": "string", "title": "email" } }, "required": [ "email", "method", "type" ] } ] }, "CheckoutDeliverySubtype": { "title": "CheckoutDeliverySubtype", "enum": [ "APM", "PICKUP_POINT", "SHOP" ], "type": "string" }, "MerchantDeliveryOptions": { "title": "MerchantDeliveryOptions", "enum": [ "DHL_COURIER", "DHL_PICKUP", "DPD_COURIER", "DPD_PICKUP", "ELECTRONIC", "FEDEX_COURIER", "GEIS_COURIER", "GLS_COURIER", "INPOST_APM", "INPOST_COURIER", "INSTORE_PICKUP", "ORLEN_APM", "POCZTA_POLSKA_APM", "POCZTEX_COURIER", "UPS_COURIER" ], "type": "string" }, "BillingDetails": { "title": "BillingDetails", "type": "object", "properties": { "companyName": { "description": "The name of the comapny for the invoice", "type": "string", "title": "companyName" }, "taxId": { "description": "The tax number", "type": "string", "title": "taxId" }, "firstName": { "description": "The first name", "type": "string", "title": "firstName" }, "lastName": { "description": "The last name", "type": "string", "title": "lastName" }, "country": { "description": "The country", "type": "string", "title": "country" }, "city": { "description": "The city", "type": "string", "title": "city" }, "postalCode": { "description": "The postal code", "type": "string", "title": "postalCode" }, "street": { "description": "The street", "type": "string", "title": "street" }, "streetNo": { "description": "The number on the street", "type": "string", "title": "streetNo" }, "apartmentNo": { "description": "The appartment number", "type": "string", "title": "apartmentNo" }, "notes": { "description": "Additional notes", "type": "string", "title": "notes" } }, "required": [ "city", "country", "notes", "postalCode", "street", "streetNo" ] }, "PlaceOrderAmount": { "title": "PlaceOrderAmount", "type": "object", "properties": { "amount": { "description": "The total price for the order. Price is expressed as the number (integer) of 1/100s of the price.", "minimum": 0, "type": "integer", "title": "amount" }, "currency": { "description": "The currency", "maxLength": 3, "type": "string", "title": "currency" } }, "required": [ "amount", "currency" ] }, "OrderConsent": { "title": "OrderConsent", "type": "object", "properties": { "id": { "description": "The ID of the consent as defined in the merchant panel", "type": "string", "title": "id" }, "version": { "description": "The version of the consent", "type": "number", "title": "version" } }, "required": [ "id", "version" ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }
Dostawa kurierem¶
Jeśli użytkownik wybrał dostawę kurierem, szczegóły dostawy zawierają pełny zestaw danych adresowych:
{
"description": "The data for an order placed through OpenApp.",
"title": "MerchantPlaceOrder#",
"additionalProperties": false,
"type": "object",
"properties": {
"oaOrderId": {
"description": "The unique ID of the order generated by OpenApp.",
"maxLength": 36,
"type": "string",
"title": "oaOrderId"
},
"basket": {
"$ref": "#/definitions/OpenPayOrderBasket",
"description": "The shopping basket",
"title": "basket"
},
"deliveryDetails": {
"$ref": "#/definitions/DeliveryDetails",
"description": "The details of delivery",
"title": "deliveryDetails"
},
"billingDetails": {
"description": "The details of invoice",
"$ref": "#/definitions/BillingDetails",
"title": "billingDetails"
},
"paymentDetails": {
"$ref": "#/definitions/PlaceOrderAmount",
"description": "The details of the payment",
"title": "paymentDetails"
},
"consents": {
"description": "The consents which the user agreed to",
"type": "array",
"items": {
"$ref": "#/definitions/OrderConsent"
},
"title": "consents"
}
},
"required": [
"basket",
"consents",
"deliveryDetails",
"oaOrderId",
"paymentDetails"
],
"definitions": {
"OpenPayOrderBasket": {
"title": "OpenPayOrderBasket",
"type": "object",
"properties": {
"id": {
"description": "The id of the shopping basket which is purchased",
"maxLength": 36,
"type": "string",
"title": "id"
},
"price": {
"$ref": "#/definitions/PlaceOrderPrice",
"description": "The basket price information",
"title": "price"
},
"products": {
"description": "The basket products",
"type": "array",
"items": {
"$ref": "#/definitions/BaseProduct"
},
"title": "products"
},
"loggedUser": {
"description": "The id of the user in the merchant store (if known)",
"type": "string",
"title": "loggedUser"
}
},
"required": [
"id",
"price",
"products"
]
},
"PlaceOrderPrice": {
"description": "The basket price information",
"title": "PlaceOrderPrice",
"type": "object",
"properties": {
"deliveryCost": {
"description": "The delivery cost. Price is expressed as the number (integer) of 1/100s of the price.",
"minimum": 0,
"type": "integer",
"title": "deliveryCost"
},
"currency": {
"type": "string",
"title": "currency"
},
"basketValue": {
"description": "The price of the basket. Price is expressed as the number (integer) of 1/100s of the price.",
"minimum": 0,
"type": "integer",
"title": "basketValue"
},
"discounts": {
"description": "Applied discounts",
"type": "array",
"items": {
"$ref": "#/definitions/BasketPriceDiscount"
},
"title": "discounts"
}
},
"required": [
"basketValue",
"currency",
"deliveryCost",
"discounts"
]
},
"BasketPriceDiscount": {
"title": "BasketPriceDiscount",
"type": "object",
"properties": {
"code": {
"description": "The discount code.",
"maxLength": 36,
"type": "string",
"title": "code"
},
"value": {
"description": "The value of the discount. Value is expressed as the number (integer) of 1/100s of the currency.",
"minimum": 0,
"type": "integer",
"title": "value"
},
"error": {
"description": "The error code of the discount",
"enum": [
"EXPIRED",
"INVALID",
"NOT_APPLICABLE",
"USED"
],
"type": "string",
"title": "error"
}
},
"required": [
"code",
"value"
]
},
"BaseProduct": {
"title": "BaseProduct",
"type": "object",
"properties": {
"ean": {
"description": "The ean (or other barcode on the product). Specifying this allows the user to search in his order history by scanning the barcode to do a re-purchase.",
"maxLength": 36,
"type": "string",
"title": "ean"
},
"id": {
"description": "The unique ID of the product.",
"maxLength": 36,
"type": "string",
"title": "id"
},
"quantity": {
"description": "The number of items in the purchase.",
"minimum": 0,
"type": "integer",
"title": "quantity"
},
"unitPrice": {
"description": "The price of a single product. Price is expressed as the number (integer) of 1/100s of the price.",
"type": "integer",
"title": "unitPrice"
},
"linePrice": {
"description": "The price of the products. Price is expressed as the number (integer) of 1/100s of the price.",
"type": "integer",
"title": "linePrice"
}
},
"required": [
"id",
"linePrice",
"quantity",
"unitPrice"
]
},
"DeliveryDetails": {
"title": "DeliveryDetails",
"anyOf": [
{
"type": "object",
"properties": {
"type": {
"description": "Delivery to a pickup point",
"type": "string",
"enum": [
"PICKUP"
],
"title": "type"
},
"subType": {
"$ref": "#/definitions/CheckoutDeliverySubtype",
"description": "The type of pickup point",
"title": "subType"
},
"method": {
"$ref": "#/definitions/MerchantDeliveryOptions",
"description": "The method",
"title": "method"
},
"name": {
"description": "The name of the pickup point",
"type": "string",
"title": "name"
},
"id": {
"description": "The code of the pickup point",
"type": "string",
"title": "id"
},
"lat": {
"description": "The lattitude of the pickup point",
"type": "number",
"title": "lat"
},
"lng": {
"description": "The longitude of the pickup point",
"type": "number",
"title": "lng"
},
"street": {
"description": "The street",
"type": "string",
"title": "street"
},
"streetNo": {
"description": "The number on the street",
"type": "string",
"title": "streetNo"
},
"apartmentNo": {
"description": "The appartment number",
"type": "string",
"title": "apartmentNo"
},
"postalCode": {
"description": "The postal code",
"type": "string",
"title": "postalCode"
},
"city": {
"description": "The city",
"type": "string",
"title": "city"
},
"country": {
"description": "The country",
"type": "string",
"enum": [
"PL"
],
"title": "country"
},
"phoneNumber": {
"description": "The phone number",
"type": "string",
"title": "phoneNumber"
},
"email": {
"description": "The email address",
"type": "string",
"title": "email"
}
},
"required": [
"city",
"country",
"email",
"id",
"method",
"name",
"postalCode",
"street",
"subType",
"type"
]
},
{
"type": "object",
"properties": {
"type": {
"description": "Delivery by courier",
"type": "string",
"enum": [
"COURIER"
],
"title": "type"
},
"method": {
"$ref": "#/definitions/MerchantDeliveryOptions",
"title": "method"
},
"street": {
"description": "The street",
"type": "string",
"title": "street"
},
"streetNo": {
"description": "The number on the street",
"type": "string",
"title": "streetNo"
},
"apartmentNo": {
"description": "The appartment number",
"type": "string",
"title": "apartmentNo"
},
"postalCode": {
"description": "The postal code",
"type": "string",
"title": "postalCode"
},
"city": {
"description": "The city",
"type": "string",
"title": "city"
},
"country": {
"description": "The country",
"type": "string",
"enum": [
"PL"
],
"title": "country"
},
"notes": {
"description": "Additional notes",
"type": "string",
"title": "notes"
},
"firstName": {
"description": "The first name",
"type": "string",
"title": "firstName"
},
"lastName": {
"description": "The last name",
"type": "string",
"title": "lastName"
},
"phoneNumber": {
"description": "The phone number",
"type": "string",
"title": "phoneNumber"
},
"companyName": {
"description": "The company name",
"type": "string",
"title": "companyName"
},
"email": {
"description": "The email address",
"type": "string",
"title": "email"
}
},
"required": [
"city",
"country",
"email",
"firstName",
"lastName",
"method",
"notes",
"phoneNumber",
"postalCode",
"street",
"streetNo",
"type"
]
},
{
"type": "object",
"properties": {
"type": {
"description": "Electronic delivery",
"type": "string",
"enum": [
"ELECTRONIC"
],
"title": "type"
},
"method": {
"$ref": "#/definitions/MerchantDeliveryOptions",
"title": "method"
},
"email": {
"description": "The email address",
"type": "string",
"title": "email"
}
},
"required": [
"email",
"method",
"type"
]
}
]
},
"CheckoutDeliverySubtype": {
"title": "CheckoutDeliverySubtype",
"enum": [
"APM",
"PICKUP_POINT",
"SHOP"
],
"type": "string"
},
"MerchantDeliveryOptions": {
"title": "MerchantDeliveryOptions",
"enum": [
"DHL_COURIER",
"DHL_PICKUP",
"DPD_COURIER",
"DPD_PICKUP",
"ELECTRONIC",
"FEDEX_COURIER",
"GEIS_COURIER",
"GLS_COURIER",
"INPOST_APM",
"INPOST_COURIER",
"INSTORE_PICKUP",
"ORLEN_APM",
"POCZTA_POLSKA_APM",
"POCZTEX_COURIER",
"UPS_COURIER"
],
"type": "string"
},
"BillingDetails": {
"title": "BillingDetails",
"type": "object",
"properties": {
"companyName": {
"description": "The name of the comapny for the invoice",
"type": "string",
"title": "companyName"
},
"taxId": {
"description": "The tax number",
"type": "string",
"title": "taxId"
},
"firstName": {
"description": "The first name",
"type": "string",
"title": "firstName"
},
"lastName": {
"description": "The last name",
"type": "string",
"title": "lastName"
},
"country": {
"description": "The country",
"type": "string",
"title": "country"
},
"city": {
"description": "The city",
"type": "string",
"title": "city"
},
"postalCode": {
"description": "The postal code",
"type": "string",
"title": "postalCode"
},
"street": {
"description": "The street",
"type": "string",
"title": "street"
},
"streetNo": {
"description": "The number on the street",
"type": "string",
"title": "streetNo"
},
"apartmentNo": {
"description": "The appartment number",
"type": "string",
"title": "apartmentNo"
},
"notes": {
"description": "Additional notes",
"type": "string",
"title": "notes"
}
},
"required": [
"city",
"country",
"notes",
"postalCode",
"street",
"streetNo"
]
},
"PlaceOrderAmount": {
"title": "PlaceOrderAmount",
"type": "object",
"properties": {
"amount": {
"description": "The total price for the order. Price is expressed as the number (integer) of 1/100s of the price.",
"minimum": 0,
"type": "integer",
"title": "amount"
},
"currency": {
"description": "The currency",
"maxLength": 3,
"type": "string",
"title": "currency"
}
},
"required": [
"amount",
"currency"
]
},
"OrderConsent": {
"title": "OrderConsent",
"type": "object",
"properties": {
"id": {
"description": "The ID of the consent as defined in the merchant panel",
"type": "string",
"title": "id"
},
"version": {
"description": "The version of the consent",
"type": "number",
"title": "version"
}
},
"required": [
"id",
"version"
]
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
Z uwagi na to że dostawa kurierem nie jest darmowa, na szczegółach zamówienia znajduje się dodatkowa opłata 9.95 za dostawę dodana do całkowitej wartości zamówienia.
Response¶
W odpowiedzi, sklep musi przesłać potwierdzenie złożenia zamówienia.
Place order response | |
---|---|
{
"additionalProperties": false,
"type": "object",
"properties": {
"shopOrderId": {
"description": "The unique ID of the order.",
"maxLength": 36,
"type": "string",
"title": "shopOrderId"
},
"oaOrderId": {
"description": "The ID of the order as generated by OpenApp. Mandatory in case of an asynchronous connection through a queue in order to correlate the placed order with the response.",
"maxLength": 36,
"type": "string",
"title": "oaOrderId"
},
"returnPolicy": {
"$ref": "#/definitions/OrderReturnPolicy",
"description": "The policy for returning the order",
"title": "returnPolicy"
},
"shipments": {
"description": "The shipments for the order",
"type": "array",
"items": {
"$ref": "#/definitions/OrderShipmentMulti"
},
"title": "shipments"
}
},
"required": [
"returnPolicy",
"shopOrderId"
],
"definitions": {
"OrderReturnPolicy": {
"title": "OrderReturnPolicy",
"type": "object",
"properties": {
"maxReturnDays": {
"description": "The length of the allowed return period for the order.",
"minimum": 0,
"type": "integer",
"title": "maxReturnDays"
}
},
"required": [
"maxReturnDays"
]
},
"OrderShipmentMulti": {
"additionalProperties": false,
"title": "OrderShipmentMulti",
"type": "object",
"properties": {
"shipmentId": {
"description": "The id of the shipment",
"maxLength": 64,
"type": "string",
"title": "shipmentId"
},
"status": {
"$ref": "#/definitions/StoreDeliveryStatus",
"description": "The status of the shipment",
"title": "status"
},
"notes": {
"description": "Optional merchant notes on the shipment",
"maxLength": 64,
"type": "string",
"title": "notes"
},
"products": {
"description": "The products which will be in this shipment",
"type": "array",
"items": {
"$ref": "#/definitions/OrderShipmentProduct"
},
"title": "products"
},
"timing": {
"description": "The estimation of the delivery time, i.e. 'next business day' or 'July 18th'.",
"maxLength": 40,
"type": "string",
"title": "timing"
},
"operator": {
"description": "The operator of the shipment",
"maxLength": 64,
"type": "string",
"title": "operator"
},
"trackingCode": {
"description": "The tracking code.",
"maxLength": 64,
"type": "string",
"title": "trackingCode"
},
"trackingUrl": {
"description": "The tracking URL.",
"maxLength": 255,
"type": "string",
"title": "trackingUrl"
}
},
"required": [
"shipmentId",
"status"
]
},
"StoreDeliveryStatus": {
"title": "StoreDeliveryStatus",
"enum": [
"CANCELLED_MERCHANT",
"DELIVERED",
"FULFILLED",
"IN_DELIVERY",
"ORDERED",
"READY_FOR_PICKUP",
"SHIPPED"
],
"type": "string"
},
"OrderShipmentProduct": {
"additionalProperties": false,
"title": "OrderShipmentProduct",
"type": "object",
"properties": {
"id": {
"description": "The unique ID of the product.",
"maxLength": 36,
"type": "string",
"title": "id"
},
"quantity": {
"description": "The number of items in the purchase.",
"minimum": 0,
"type": "integer",
"title": "quantity"
}
},
"required": [
"id",
"quantity"
]
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
API sprzedawcy powinno odpowiedzieć na zapytanie w czasie poniżej 8 sekund.
Powyższy przykład reprezentuje bardzo prosty koszyk. Po pełny opis modelu koszyka sprawdź JSON schema koszyka