Atlas JavaScript SDK Core
This SDK covers the functionality provided by team Atlas' (aka Distributed Commerce) APIs, namely, Checkout, Guest Checkout, and Catalog APIs.
Those APIs, and in turn this SDK, provide our partners a more streamlined access the Zalando shopping platform to enable our customers to purchase wherever they are.
The purpose of this project is to provide low-level calls to API backend and response models for Zalando Checkout, Guest Checkout, and Catalog APIs in order to allow easily integrate and run Zalando Сheckout in minutes using your own UI solution.
If you want to access the APIs directly we recommend that you take a look at their documentation.
We use Promises a lot :)
Installation
npm install --save atlas-sdk-core es6-promise
On install we're transpiling the code for your convenience. You have access to two files under a lib/
folder, one for using in node and another for browser usages.
Warning
Because we are using Promises you must bring your own ES6 Promise compatible polyfill, e.g. es6-promise.
Local Development
If you want to contribute, please, read our Contributing guidelines first.
In order to start SDK development simply run
npm run tdd
Check existing codebase tests for test examples.
Configuration and Usage
You need to configure Atlas JavaScript SDK Core first and use configured instance variable to interact with AtlasSDK.
In order to configure AtlasSDK manually provide an object with 2 mandatory parameters client_id and sales_channel:
; AtlasSDK;
Since we are using Promises you can benefit from await/async:
; const sdk = await AtlasSDK;const article = await sdk;console;
API Reference
Modules
- AtlasSDK
AtlasSDK is a global namespace.
Classes
- AtlasSDKClient
AtlasSDK instance returned from AtlasSDK configure method.
- PickupPoint
- AddressSchema
Baseclass for Address model
- CheckoutAddressSchema
Baseclass for CheckoutAddress model
- NormalizedAddress
Baseclass for NormalizedAddress model
- CheckedAddress
Baseclass for CheckedAddress model
- Brand
Class for Brand model.
- Partner
Class for Partner model.
- PriceSchema
Class for Article Unit Price model.
- Unit
Class for Article Unit model.
- Attribute
Class for Article Unit Attribute model.
- EnrichmentAttribute
Class for Article Unit EnrichmentAttribute model.
- TargetGroups
Class for TargetGroups model.
- ArticleImage
Class for ArticleImage model.
- Media
Class for Media model.
- Item
Class for CartItem model
- ItemWithPrice
Class for CartItem model
- Payment
Class for Payment model
- Delivery
Class for Delivery model'
- ReviewRatingDistribution
Class for ReviewRatingDistribution.
- ReviewRating
Class for ReviewRating.
- ReviewRecommendations
Class for ReviewRecommendations.
- ReviewSummary
Class for ReviewSummary.
- ReviewEntry
Class for ReviewEntry.
- Reviews
Class for Article Reviews.
- Image
Class for Image model.
- Video
Class for Video model.
- Article
Class for Article model
- ArticleFamily
Class for ArticleFamily model
- DiscountSchema
Class for Discount model
- CheckoutCouponDiscount
Class for Checkout Discount model
- DeliveryRequest
Class for Delivery Request model
- CreateCartRequest
Class for Cart Request model
- SelectedPayment
Class for Selected Payment model
- Payment
Class for Payment model
- CheckoutCouponDetails
Class for Checkout Coupon Details model
- CartResponse
Class for Cart Response model
- CartsResponse
Class for Carts Response model
- CreateCheckoutRequest
Class for Checkout Request model
- CheckoutResponse
Class for Checkout Response model
- PutCheckoutRequest
Class for Put Checkout Request model
- CheckoutOrderRequest
Class for Checkout Order Request model
- SalesChannel
SalesChannel class struct
- Recommendations
Recommendations class struct
- Config
Config class struct
- GuestCustomer
Class for Guest Customer model
- CheckoutCustomer
Class for Guest Customer model
- Cart
Cart
- CreateOrderRequest
Class for CreateOrderRequest model
- CreateOrderResponse
Class for CreateOrderResponse model
- CreateOrderRedirectResponse
Class for CreateOrderRedirectResponse model
- GetCheckoutResponse
Class for GetCheckoutResponse model
- OrderResponse
Class for Order Response model
- CheckoutApiOrderResponseSchema
Class for Checkout Order Response model
- CheckoutOrder
Class for Guest Customer model
- RecommendedArticle
Class for Recommended Article model
Constants
- configCache
A temporary fix to handle the current high load capacity
Functions
- fetchEndpoint(endpoint) ⇒
Promise
Calls the given endpoint using fetch and intercepts the response via various operations
AtlasSDK
AtlasSDK is a global namespace.
Promise.<AtlasSDKClient>
AtlasSDK.configure(options) ⇒ Configure AtlasSDK. This is the main entry point to use the AtlasSDK.
Kind: static method of AtlasSDK
Returns: Promise.<AtlasSDKClient>
- a promise resolving with an AtlasSDKClient object
Access: public
Param | Type | Description |
---|---|---|
options | Object |
An object containing configiration data:
|
Example
const sdk = await AtlasSDK;
AtlasSDKClient
AtlasSDK instance returned from AtlasSDK configure method.
Kind: global class
- AtlasSDKClient
- new AtlasSDKClient(config)
- .getLocale() ⇒
String
- .getLanguage() ⇒
String
- .getCountryCode() ⇒
String
- .getConfig() ⇒
Object
- .getArticle(sku, [options]) ⇒
Article
- .getArticles(skus, [options]) ⇒
Array.<Article>
- .getArticleFamilies(sku, [options]) ⇒
Array.<ArticleFamily>
- .getGuestCheckout(checkoutId, token) ⇒
GetCheckoutResponse
- .createGuestOrder(checkoutId, token) ⇒
CreateOrderResponse
- .getRecommendations(sku, [options]) ⇒
Array.<RecommendedArticle>
- .createGuestCheckout(json) ⇒
CreateOrderRedirectResponse
- .getCheckoutCustomer(token) ⇒
CheckoutCustomer
- .getCheckoutAddresses(token) ⇒
CheckoutAddress
- .getCheckoutCarts(token, headers) ⇒
CartsResponse
- .createCheckoutCart(json, token, options) ⇒
CartResponse
- .getCheckoutCart(cartId, token) ⇒
CartResponse
- .putCheckoutcart(json, cartId, token, headers) ⇒
CartResponse
new AtlasSDKClient(config)
Creates an AtlasSDK instance from config provided by config-api
Param | Type | Description |
---|---|---|
config | Object |
config from config-api |
String
atlasSDKClient.getLocale() ⇒ Returns locale based on sales channel, e.g. 'de_DE'
Kind: instance method of AtlasSDKClient
Returns: String
- locale
String
atlasSDKClient.getLanguage() ⇒ Returns language based on sales channel, e.g. 'de'
Kind: instance method of AtlasSDKClient
Returns: String
- language
String
atlasSDKClient.getCountryCode() ⇒ Returns country code based on sales channel, e.g. 'DE'
Kind: instance method of AtlasSDKClient
Returns: String
- country code
Object
atlasSDKClient.getConfig() ⇒ Returns configuration from config-api
Kind: instance method of AtlasSDKClient
Returns: Object
- config
Article
atlasSDKClient.getArticle(sku, [options]) ⇒ Fetches an article based on a SKU.
Kind: instance method of AtlasSDKClient
Returns: Article
- return Article object
Access: public
Param | Type | Description |
---|---|---|
sku | String |
SKU of an article |
[options] | Object |
Configuration options:
{ media: { cdn: 'mosaic02', image_resolutions: ['thumbnail', 'medium'] } } |
Example
const sdk = await AtlasSDK;const article = await sdk;
Array.<Article>
atlasSDKClient.getArticles(skus, [options]) ⇒ Fetches multiple articles based on SKUs.
Kind: instance method of AtlasSDKClient
Returns: Array.<Article>
- return Article[] object
Access: public
Param | Type | Description |
---|---|---|
skus | String |
comma separated SKUs of multiple articles |
[options] | Object |
Configuration options:
{ media: { cdn: 'mosaic02', image_resolutions: ['thumbnail', 'medium'] } } |
Example
const sdk = await AtlasSDK;const articles = await sdk;
Array.<ArticleFamily>
atlasSDKClient.getArticleFamilies(sku, [options]) ⇒ Fetches article families based on SKU.
Kind: instance method of AtlasSDKClient
Returns: Array.<ArticleFamily>
- return ArticleFamily[] object
Access: public
Param | Type | Description |
---|---|---|
sku | String |
SKU of an article |
[options] | Object |
Configuration options:
{ media: { cdn: 'mosaic02', image_resolutions: ['thumbnail', 'medium'] } } |
Example
const sdk = await AtlasSDK;const article = await sdk;
GetCheckoutResponse
atlasSDKClient.getGuestCheckout(checkoutId, token) ⇒ Returns the complete details of the checkout: guest checkout object GetCheckoutResponse created using createGuestCheckout. Parameters checkoutId, token should be fetched from redirect URL after payment.
Kind: instance method of AtlasSDKClient
Returns: GetCheckoutResponse
- guest checkout object
Access: public
Param | Type | Description |
---|---|---|
checkoutId | String |
Id of guest checkout object |
token | String |
Token for checkout completion. |
CreateOrderResponse
atlasSDKClient.createGuestOrder(checkoutId, token) ⇒ Creates an order for the guest chekout object based on checkoutId, token.
Kind: instance method of AtlasSDKClient
Returns: CreateOrderResponse
- object with order information
Access: public
Param | Type | Description |
---|---|---|
checkoutId | String |
Id of guest checkout object |
token | String |
Array.<RecommendedArticle>
atlasSDKClient.getRecommendations(sku, [options]) ⇒ Fetches recommendations for an article based on a SKU.
Kind: instance method of AtlasSDKClient
Returns: Array.<RecommendedArticle>
- return array of RecommendedArticle[] objects
Access: public
Param | Type | Description |
---|---|---|
sku | String |
SKU of an article |
[options] | Object |
Configuration options:
{ reco_id: 'UUUID', tracking_string: 'SOME_TRACKING_STRING', reco_location: 'some_reco_location', media: { cdn: 'mosaic02', image_resolutions: ['thumbnail', 'medium'] }, filters: { '-filter_gender': 'FEMALE' 'brand_code': ['AN1', 'N12', 'PU1'], } } |
Example
const sdk = await AtlasSDK;const recos = await sdk;
CreateOrderRedirectResponse
atlasSDKClient.createGuestCheckout(json) ⇒ Creates guest checkout object with payload.
Kind: instance method of AtlasSDKClient
Returns: CreateOrderRedirectResponse
- response containing redirectURL
that should be used to go to the payment.
Access: public
Param | Type | Description |
---|---|---|
json | Object |
JSON payload |
CheckoutCustomer
atlasSDKClient.getCheckoutCustomer(token) ⇒ Returns customer object CheckoutCustomer. Parameters customer token needed to fetch customer object.
Kind: instance method of AtlasSDKClient
Returns: CheckoutCustomer
- customer object
Access: public
Param | Type | Description |
---|---|---|
token | String |
customer OAuth2 token |
CheckoutAddress
atlasSDKClient.getCheckoutAddresses(token) ⇒ Returns customer addresses CheckoutAddress. Parameters customer token needed to fetch customer object.
Kind: instance method of AtlasSDKClient
Returns: CheckoutAddress
- CheckoutAddress array
Access: public
Param | Type | Description |
---|---|---|
token | String |
customer OAuth2 token |
CartsResponse
atlasSDKClient.getCheckoutCarts(token, headers) ⇒ Returns a customer's cart(s)
Kind: instance method of AtlasSDKClient
Returns: CartsResponse
- - carts
Param | Type | Description |
---|---|---|
token | String |
|
headers | Object |
additional headers that will override the default ones |
CartResponse
atlasSDKClient.createCheckoutCart(json, token, options) ⇒ Creates Zalando customer cart
Kind: instance method of AtlasSDKClient
Returns: CartResponse
- - customer cart
Param | Type | Description |
---|---|---|
json | CreateCartRequest |
cart to create |
token | String |
customer OAuth2 token |
options | Object |
additional headers, rawResponse that will override the default ones |
CartResponse
atlasSDKClient.getCheckoutCart(cartId, token) ⇒ Returns a cart by id
Kind: instance method of AtlasSDKClient
Returns: CartResponse
- - cart
Param | Type | Description |
---|---|---|
cartId | String |
cart ID to get |
token | String |
CartResponse
atlasSDKClient.putCheckoutcart(json, cartId, token, headers) ⇒ Updates existing cart by id
Kind: instance method of AtlasSDKClient
Returns: CartResponse
- - updated cart
Param | Type | Description |
---|---|---|
json | CreateCartRequest |
cart object to update a cart with |
cartId | String |
id of the cart to be updated |
token | String |
|
headers | Object |
additional headers that will override the default ones |
PickupPoint
new PickupPoint(name, id, memberId)
Param | Type | Description |
---|---|---|
name | String |
name of the pick up point |
id | String |
id of the pickup point |
memberId | String |
member id of the pickpup point |
AddressSchema
Baseclass for Address model
new AddressSchema(email, gender, firstName, lastName, street, zip, city, countryCode, pickupPoint)
Param | Type | Description |
---|---|---|
String |
email of a customer. | |
gender | String |
gender of the customer (FEMALE / MALE) |
firstName | String |
first name of the customer |
lastName | String |
last name of the customer |
street | String |
street of the address |
zip | String |
zip code of the address |
city | String |
city of the address |
countryCode | String |
country of the address |
pickupPoint | PickupPoint |
pickup point of the address (Optional because only valid in shipping addresses) |
CheckoutAddressSchema
Baseclass for CheckoutAddress model
new CheckoutAddressSchema(customerNumber, email, gender, firstName, lastName, street, zip, city, countryCode, pickupPoint, defaultBilling, defaultShipping)
Param | Type | Description |
---|---|---|
customerNumber | String |
customer number |
String |
email of a customer. | |
gender | String |
gender of the customer (FEMALE / MALE) |
firstName | String |
first name of the customer |
lastName | String |
last name of the customer |
street | String |
street of the address |
zip | String |
zip code of the address |
city | String |
city of the address |
countryCode | String |
country of the address |
pickupPoint | PickupPoint |
pickup point of the address (Optional because only valid in shipping addresses) |
defaultBilling | Boolean |
is this address the default billing address |
defaultShipping | Boolean |
is this address the default shipping address |
NormalizedAddress
Baseclass for NormalizedAddress model
new NormalizedAddress(street, zip, city, countryCode)
Param | Type | Description |
---|---|---|
street | String |
street of the address |
zip | String |
zip code of the address |
city | String |
city of the address |
countryCode | String |
country of the address |
CheckedAddress
Baseclass for CheckedAddress model
new CheckedAddress(status, normalizedAddress)
Param | Type | Description |
---|---|---|
status | String |
status of the address check |
normalizedAddress | NormalizedAddress |
the normalized address |
Brand
Class for Brand model.
new Brand(name)
Param | Type | Description |
---|---|---|
name | String |
name of brand. |
Partner
Class for Partner model.
new Partner(id, name, detailURL)
Param | Type | Description |
---|---|---|
id | String |
id of partner. |
name | String |
name of partner. |
detailURL | String |
URL of partner. |
PriceSchema
Class for Article Unit Price model.
new PriceSchema(amount, currency)
Param | Type | Description |
---|---|---|
amount | number |
amount of price. |
currency | String |
currency of price. |
Unit
Class for Article Unit model.
new Unit(id, size, price, originalPrice, available, stock, partner, media)
Param | Type | Description |
---|---|---|
id | String |
id of article. |
size | String |
size of article. |
price | Price |
price of article. |
originalPrice | Price |
price of article. |
available | boolean |
whether the unit is available or not. |
stock | number |
|
partner | Partner |
|
media | Media |
Attribute
Class for Article Unit Attribute model.
new Attribute(name, category, subCategory, values)
Param | Type | Description |
---|---|---|
name | String |
name of attribute. |
category | String |
category of attribute. |
subCategory | String |
sub-category of attribute. |
values | Array.<String> |
values of attribute. |
EnrichmentAttribute
Class for Article Unit EnrichmentAttribute model.
new EnrichmentAttribute(key, value)
Param | Type | Description |
---|---|---|
key | String |
name of enrichment attribute. |
value | Array.<String> |
values of enrichment attribute. |
TargetGroups
Class for TargetGroups model.
new TargetGroups(gender, age, domain, ageRange)
Param | Type | Description |
---|---|---|
gender | Array.<String> |
The targeted gender group. Can be FEMALE or MALE. Unisex articles will have both. |
age | Array.<String> |
The targeted age group. Current values are: ADULT, BABY, KID, TEEN |
domain | Array.<String> |
The target domain. Can be: DEFAULT, GREEN, LIFESTYLE, MATERNITY, PREMIUM, OVERSIZE, SPORTS |
ageRange | Array.<String> |
Current values: Under 20, 20-29, 30-39, 40-49, Over 50 |
ArticleImage
Class for ArticleImage model.
new ArticleImage(order, catalog, catalogHD, detail, detailHD, large, largeHD)
Param | Type | Description |
---|---|---|
order | Number |
order number of image used for sorting. |
catalog | String |
URL of catalog image. |
catalogHD | String |
URL of HD catalog image. |
detail | String |
URL of details image. |
detailHD | String |
URL of HD details image. |
large | String |
URL of large image. |
largeHD | String |
URL of HD large image. |
Media
Class for Media model.
new Media(images)
Param | Type | Description |
---|---|---|
images | ArticleImage |
array of images. |
Item
Class for CartItem model
new Item(sku, quantity)
Param | Type | Description |
---|---|---|
sku | String |
SKU of item. |
quantity | Number |
Quantity of item. |
ItemWithPrice
Class for CartItem model
new ItemWithPrice(sku, configSku, quantity, price)
Param | Type | Description |
---|---|---|
sku | String |
SKU of item. |
configSku | String |
Config SKU of the item. |
quantity | Number |
Quantity of item. |
price | Price |
pirce of the item |
Payment
Class for Payment model
Kind: global class
new Payment(method, selectionPageUrl, metadata)
Param | Type | Description |
---|---|---|
method | String |
Payment Method type. |
selectionPageUrl | String |
URL of the payment selection page. |
metadata | Object |
Metadata for payment. |
new Payment(selected, selectionPageUrl)
Param | Type | Description |
---|---|---|
selected | SelectedPayment |
the selected payment. |
selectionPageUrl | String |
URL of the payment selection page. |
Delivery
Class for Delivery model'
new Delivery(service, cost, earliest, latest, options)
Param | Type | Description |
---|---|---|
service | String |
the delivery service. |
cost | Price |
the delivery cost. |
earliest | String |
Delivery earliest date. |
latest | String |
Delivery latest date. |
options | Array.<String> |
the delivery options. |
ReviewRatingDistribution
Class for ReviewRatingDistribution.
new ReviewRatingDistribution(count)
Param | Type | Description |
---|---|---|
level. | String |
|
count | Number |
count of reviews distribution. |
ReviewRating
Class for ReviewRating.
new ReviewRating(average, distribution)
Param | Type | Description |
---|---|---|
average | Number |
average rating of Article reviews. |
distribution | ReviewRatingDistribution |
distribution of reviews. |
ReviewRecommendations
Class for ReviewRecommendations.
new ReviewRecommendations(total, positive)
Param | Type | Description |
---|---|---|
total | Number |
total number of Article reviews. |
positive | Number |
number of positive reviews. |
ReviewSummary
Class for ReviewSummary.
new ReviewSummary(total, rating, recommendations)
Param | Type | Description |
---|---|---|
total | Number |
total number of Article reviews. |
rating | ReviewRating |
average rating of Article review. |
recommendations | ReviewRecommendations |
recommendations of Article review. |
ReviewEntry
Class for ReviewEntry.
new ReviewEntry(name, title, description, rating, recommends, created)
Param | Type | Description |
---|---|---|
name | String |
name of Article reviewer. |
title | String |
title of Article review. |
description | String |
description of Article review. |
rating | Number |
rating of Article review. |
recommends | Boolean |
boolean if the reviewer recommends or not. |
created | String |
created timestamp of Article review. |
Reviews
Class for Article Reviews.
new Reviews(summary, entries)
Param | Type | Description |
---|---|---|
summary | ReviewSummary |
summary of Article review. |
entries | Array.<ReviewEntry> |
entries of Article review. |
Image
Class for Image model.
new Image(type, mediaCharacter, resolutions)
Param | Type | Description |
---|---|---|
type | String |
Type of the media item, e.g. 'IMAGE', 'IMAGE_360' |
mediaCharacter | String |
Media Character descriptor with meta information about image, for example 'MODEL' image that indicates that this media item contains model image URL. |
resolutions | Object |
Requested resolutions of the media item. |
Video
Class for Video model.
new Video(type, mediaCharacter, url)
Param | Type | Description |
---|---|---|
type | String |
Type of the media item, e.g. 'VIDEO', 'VIDEO_HD', 'VIDEO_THUMBNAIL', 'VIDEO_SMALL' |
mediaCharacter | String |
Media Character descriptor with meta information about video, for example 'MODEL' image that indicates that this media item contains model image URL. |
url | String |
An absolute URL to the image |
Article
Class for Article model
new Article(id, name, color, silhouetteCode, supplierColor, productGroup, detailUrl, brand, units, images, videos, attributes, enrichmentAttributes, targetGroups, infos, review)
Param | Type | Description |
---|---|---|
id | String |
id of the article. |
name | String |
name of the article. |
color | String |
color of the article. |
silhouetteCode | String |
silhouette code of the article. |
supplierColor | String |
color of the article from supplier. |
productGroup | String |
product group of the article. |
detailUrl | String |
product detail url of the article. |
brand | Brand |
brand of the article. |
units | Array.<Unit> |
size, price and stock availability from the article. |
images | Array.<Image> |
Array of article images. |
videos | Array.<Video> |
Array of article videos. |
attributes | Array.<Attribute> |
characteristics of the article. |
enrichmentAttributes | Array.<EnrichmentAttributes> |
variable generic attributes. |
targetGroups | TargetGroups |
the targeted groups of the article. |
infos | Array.<String> |
generic article description. |
review | Array.<Reviews> |
article reviews. |
ArticleFamily
Class for ArticleFamily model
new ArticleFamily(id, color, supplierColor, lowestPrice, images)
Param | Type | Description |
---|---|---|
id | String |
id of the article. |
color | String |
color of the article. |
supplierColor | String |
color of the article from supplier. |
lowestPrice | Price |
lowestPrice of article. |
images | Array.<Image> |
Array of article images. |
DiscountSchema
Class for Discount model
new DiscountSchema(grossTotal, taxTotal)
Param | Type | Description |
---|---|---|
grossTotal | Price |
gross total of the discount. |
taxTotal | Price |
tax total of the discount. |
CheckoutCouponDiscount
Class for Checkout Discount model
new CheckoutCouponDiscount(remaining, gross, tax)
Param | Type | Description |
---|---|---|
remaining | Price |
remaining amount. |
gross | Price |
gross total of the discount. |
tax | Price |
tax total of the discount. |
DeliveryRequest
Class for Delivery Request model
new DeliveryRequest(service)
Param | Type | Description |
---|---|---|
service | String |
the delivery service. |
CreateCartRequest
Class for Cart Request model
new CreateCartRequest(items)
Param | Type | Description |
---|---|---|
items | Items |
a list of items. |
SelectedPayment
Class for Selected Payment model
new SelectedPayment(method, metadata, externalPayment)
Param | Type | Description |
---|---|---|
method | String |
Payment Method type. |
metadata | Object |
Metadata for payment. |
externalPayment | Boolean |
is an external payment provider used. |
Payment
Class for Payment model
Kind: global class
new Payment(method, selectionPageUrl, metadata)
Param | Type | Description |
---|---|---|
method | String |
Payment Method type. |
selectionPageUrl | String |
URL of the payment selection page. |
metadata | Object |
Metadata for payment. |
new Payment(selected, selectionPageUrl)
Param | Type | Description |
---|---|---|
selected | SelectedPayment |
the selected payment. |
selectionPageUrl | String |
URL of the payment selection page. |
CheckoutCouponDetails
Class for Checkout Coupon Details model
new CheckoutCouponDetails(coupon, warning, error, discount)
Param | Type | Description |
---|---|---|
coupon | String |
the coupon. |
warning | String |
warnings regardings coupons. |
error | String |
errors regardings coupons. |
discount | CheckoutCouponDiscount |
the discount. |
CartResponse
Class for Cart Response model
new CartResponse(id, items, itemsOutOfStock, delivery, grossTotal, taxTotal, totalDiscount)
Param | Type | Description |
---|---|---|
id | String |
the response id. |
items | ItemWithPrice |
the items with price. |
itemsOutOfStock | String |
a list of items that are out of stock. |
delivery | Delivery |
the delivery information. |
grossTotal | Price |
the gross total. |
taxTotal | Price |
the tax total. |
totalDiscount | DiscountSchema |
the total discount. |
CartsResponse
Class for Carts Response model
new CartsResponse(id, carts)
Param | Type | Description |
---|---|---|
id | String |
the response id. |
carts | Array.<CartResponse> |
the requested carts. |
CreateCheckoutRequest
Class for Checkout Request model
new CreateCheckoutRequest(id, billingAddressId, billingAddress, shippingAddressId, shippingAddress, delivery, coupons)
Param | Type | Description |
---|---|---|
id | String |
the cart id. |
billingAddressId | String |
the id of the billing address. |
billingAddress | Address |
the billing address. |
shippingAddressId | String |
the id of the shipping address. |
shippingAddress | Address |
the shipping address. |
delivery | DeliveryRequest |
the desired delivery type. |
coupons | String |
a coupon. |
CheckoutResponse
Class for Checkout Response model
new CheckoutResponse(id, customerNumber, cartId, billingAddress, shippingAddress, delivery, couponDetails, payment)
Param | Type | Description |
---|---|---|
id | String |
the response id. |
customerNumber | String |
the customer number. |
cartId | String |
the id of the cart id. |
billingAddress | Address |
the billing address. |
shippingAddress | Address |
the shipping address. |
delivery | Delivery |
the delivery information. |
couponDetails | CheckoutCouponDetails |
the coupon details. |
payment | Payment |
the payment selection. |
PutCheckoutRequest
Class for Put Checkout Request model
new PutCheckoutRequest(billingAddressId, billingAddress, shippingAddressId, shippingAddress, delivery, coupons)
Param | Type | Description |
---|---|---|
billingAddressId | String |
the id of the billing address. |
billingAddress | Address |
the billing address. |
shippingAddressId | String |
the id of the shipping address. |
shippingAddress | Address |
the shipping address. |
delivery | DeliveryRequest |
the desired delivery type. |
coupons | String |
a coupon. |
CheckoutOrderRequest
Class for Checkout Order Request model
new CheckoutOrderRequest(checkoutId)
Param | Type | Description |
---|---|---|
checkoutId | String |
the id of the checkout. |
SalesChannel
SalesChannel class struct
new SalesChannel(source)
Param | Type | Description |
---|---|---|
source | Object |
Initialisation object for SalesChannel |
Recommendations
Recommendations class struct
new Recommendations(source)
Param | Type | Description |
---|---|---|
source | Object |
Initialisation object for Recommendations |
Config
Config class struct
new Config(source)
Param | Type | Description |
---|---|---|
source | Object |
Initialisation object for Config |
Example
const source = catalog_api_url: 'https://catalog_api.com/api' checkout_api_url: 'https://checkout_api.com/api' oauth2_provider_url: 'https://oauth2_provider.com/api' sales_channel: locale: 'de_DE' channel: '11111111-1111-1111-1111-111111111111' toc_url: 'https://m.zalando.de/agb/' recommendations: location: 'my_app_pdp' type: 'similar' channel: 'myapp' ; const config = source;
GuestCustomer
Class for Guest Customer model
new GuestCustomer(email, subscribeNewsletter)
Param | Type | Description |
---|---|---|
String |
the id of the billing address. | |
subscribeNewsletter | Boolean |
subscribe to the newsletter. |
CheckoutCustomer
Class for Guest Customer model
new CheckoutCustomer(customerNumber, customerHash, gender, firstName, lastName, email)
Param | Type | Description |
---|---|---|
customerNumber | String |
the customer number. |
customerHash | String |
the customer hash. |
gender | String |
the gender. |
firstName | String |
the first name. |
lastName | String |
the last name. |
String |
the email address. |
Cart
Cart
new Cart(items, itemsOutOfStock, grossTotal, taxTotal)
Class for Cart model
Param | Type | Description |
---|---|---|
items | Array.<Item> |
Array of CartItem. |
itemsOutOfStock | Array.<String> |
Array of simple SKUs for CartItems which are out of stock. |
grossTotal | Price |
Gross Total Price. |
taxTotal | Price |
Tax Total Price. |
CreateOrderRequest
Class for CreateOrderRequest model
new CreateOrderRequest(customer, billingAddress, shippingAddress, cart, payment)
Param | Type | Description |
---|---|---|
customer | Customer |
Customer object. |
billingAddress | Address |
Billing GuestAddress of Order. |
shippingAddress | Address |
Shipping GuestAddress of Order. |
cart | Cart |
Cart of Order. |
payment | Payment |
Payment of Order. |
CreateOrderResponse
Class for CreateOrderResponse model
new CreateOrderResponse(orderNumber, customerNumber, billingAddress, shippingAddress, grossTotal, taxTotal, created, externalPaymentURL)
Param | Type | Description |
---|---|---|
orderNumber | String |
Order Number. |
customerNumber | String |
Customer Number. |
billingAddress | Address |
Billing GuestAddress of Order. |
shippingAddress | Address |
Shipping GuestAddress of Order. |
grossTotal | Price |
Gross Total Price. |
taxTotal | Price |
Tax Total Price. |
created | String |
Date/Time when the order was created. |
externalPaymentURL | String |
URL of Payment. |
CreateOrderRedirectResponse
Class for CreateOrderRedirectResponse model
new CreateOrderRedirectResponse(url)
Param | Type | Description |
---|---|---|
url | String |
Redirect URL. |
GetCheckoutResponse
Class for GetCheckoutResponse model
new GetCheckoutResponse(cart, billingAddress, shippingAddress, payment, delivery)
Param | Type | Description |
---|---|---|
cart | Cart |
Cart of Order. |
billingAddress | Address |
Billing GuestAddress of Order. |
shippingAddress | Address |
Shipping GuestAddress of Order. |
payment | Payment |
Payment of Order. |
delivery | Delivery |
the delivery information. |
OrderResponse
Class for Order Response model
new OrderResponse(orderNumber, billingAddress, shippingAddress, grossTotal, taxTotal, created, externalPaymentURL)
Param | Type | Description |
---|---|---|
orderNumber | String |
the order number. |
billingAddress | Address |
the billing address. |
shippingAddress | Address |
the shipping address. |
grossTotal | Price |
gross total of the discount. |
taxTotal | Price |
tax total of the discount. |
created | String |
creation date. |
externalPaymentURL | String |
the payment URL. |
CheckoutApiOrderResponseSchema
Class for Checkout Order Response model
new CheckoutApiOrderResponseSchema(customerNumber, orderNumber, billingAddress, shippingAddress, grossTotal, taxTotal, created, externalPaymentURL)
Param | Type | Description |
---|---|---|
customerNumber | String |
the customer number. |
orderNumber | String |
the order number. |
billingAddress | Address |
the billing address. |
shippingAddress | Address |
the shipping address. |
grossTotal | Price |
gross total of the discount. |
taxTotal | Price |
tax total of the discount. |
created | String |
creation date. |
externalPaymentURL | String |
the payment URL. |
CheckoutOrder
Class for Guest Customer model
new CheckoutOrder(orderNumber, customerNumber, grossTotal, created, detailUrl)
Param | Type | Description |
---|---|---|
orderNumber | String |
the order number. |
customerNumber | String |
the customer number. |
grossTotal | Price |
gross total of the discount. |
created | String |
creation date. |
detailUrl | String |
the details URL. |
RecommendedArticle
Class for Recommended Article model
new RecommendedArticle(id, tracking_string, name, lowestPrice, brand, images, videos, units)
Param | Type | Description |
---|---|---|
id | String |
id of article. |
tracking_string | String |
the tracking string to help with recommendations |
name | String |
name of article. |
lowestPrice | Price |
lowestPrice of article. |
brand | Brand |
brand of article. |
images | Array.<Image> |
Array of article images. |
videos | Array.<Video> |
Array of article videos. |
units | Array.<Unit> |
Array of article units. |
configCache
A temporary fix to handle the current high load capacity
Promise
fetchEndpoint(endpoint) ⇒ Calls the given endpoint using fetch and intercepts the response via various operations
Kind: global function
Returns: Promise
- Promise after resolving or rejecting the request.
Param | Type | Description |
---|---|---|
endpoint | Object |
endpoint object. |
Contact
For any inquiry, please contact Team Atlas via team-atlas@zalando.de
LICENSE
The MIT License (MIT) Copyright © 2016 Zalando SE, https://tech.zalando.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.