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 :)
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.
Because we are using Promises you must bring your own ES6 Promise compatible polyfill, e.g. es6-promise.
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.
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:
import AtlasSDK from 'atlas-sdk-core';
AtlasSDK.configure({
client_id: 'CLIENT_ID',
sales_channel: 'SALES_CHANNEL',
is_sandbox: true
}).then((sdk) => {
// sdk instance is ready to use
sdk.getArticle('AD112B0F6-A11').then((article) => {
console.log(`Article name: ${article.name}`);
});
}).catch((error) => {
console.error(`${error}`);
});
Since we are using Promises you can benefit from await/async:
import AtlasSDK from 'atlas-sdk-core';
const sdk = await AtlasSDK.configure({
client_id: 'CLIENT_ID',
sales_channel: 'SALES_CHANNEL'
});
const article = await sdk.getArticle('AD112B0F6-A11');
console.log(`Article name: ${article.name}`);
- AtlasSDK
AtlasSDK is a global namespace.
- 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
- configCache
A temporary fix to handle the current high load capacity
- fetchEndpoint(endpoint) ⇒
Promise
Calls the given endpoint using fetch and intercepts the response via various operations
AtlasSDK is a global namespace.
AtlasSDK.configure(options) ⇒ Promise.<AtlasSDKClient>
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.configure({
client_id: 'CLIENT_ID',
sales_channel: 'SALES_CHANNEL',
is_sandBox: true
});
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
Creates an AtlasSDK instance from config provided by config-api
Param | Type | Description |
---|---|---|
config | Object |
config from config-api |
Returns locale based on sales channel, e.g. 'de_DE'
Kind: instance method of AtlasSDKClient
Returns: String
- locale
Returns language based on sales channel, e.g. 'de'
Kind: instance method of AtlasSDKClient
Returns: String
- language
Returns country code based on sales channel, e.g. 'DE'
Kind: instance method of AtlasSDKClient
Returns: String
- country code
Returns configuration from config-api
Kind: instance method of AtlasSDKClient
Returns: Object
- config
atlasSDKClient.getArticle(sku, [options]) ⇒ Article
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.configure({
client_id: 'CLIENT_ID',
sales_channel: 'SALES_CHANNEL',
is_sandBox: true,
lang: 'en'
});
const article = await sdk.getArticle('AD112B0F6-A11', {
media: {
image_resolutions: ['thumbnail', 'medium']
}
});
atlasSDKClient.getArticles(skus, [options]) ⇒ Array.<Article>
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.configure({
client_id: 'CLIENT_ID',
sales_channel: 'SALES_CHANNEL',
is_sandBox: true,
lang: 'en'
});
const articles = await sdk.getArticles('AD112B0F6-A11,SO254C009-K12', {
media: {
image_resolutions: ['thumbnail', 'medium']
}
});
atlasSDKClient.getArticleFamilies(sku, [options]) ⇒ Array.<ArticleFamily>
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.configure({
client_id: 'CLIENT_ID',
sales_channel: 'SALES_CHANNEL',
is_sandBox: true,
lang: 'en'
});
const article = await sdk.getArticleFamilies('AD112B0F6-A11');
atlasSDKClient.getGuestCheckout(checkoutId, token) ⇒ GetCheckoutResponse
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. |
atlasSDKClient.createGuestOrder(checkoutId, token) ⇒ CreateOrderResponse
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 |
atlasSDKClient.getRecommendations(sku, [options]) ⇒ Array.<RecommendedArticle>
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.configure({
client_id: 'CLIENT_ID',
sales_channel: 'SALES_CHANNEL',
is_sandBox: true
});
const recos = await sdk.getRecommendations('AD112B0F6-A11', {
reco_id: 'UUID',
tracking_string: 'TRACK',
media: {
cdn: 'mosaic02',
image_resolutions: ['thumbnail', 'medium']
},
filters: {
'-filter_gender': 'FEMALE'
'brand_code': ['AN1', 'N12', 'PU1'],
}
});
atlasSDKClient.createGuestCheckout(json) ⇒ CreateOrderRedirectResponse
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 |
atlasSDKClient.getCheckoutCustomer(token) ⇒ CheckoutCustomer
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 |
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 |
atlasSDKClient.getCheckoutCarts(token, headers) ⇒ CartsResponse
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 |
atlasSDKClient.createCheckoutCart(json, token, options) ⇒ CartResponse
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 |
atlasSDKClient.getCheckoutCart(cartId, token) ⇒ CartResponse
Returns a cart by id
Kind: instance method of AtlasSDKClient
Returns: CartResponse
- - cart
Param | Type | Description |
---|---|---|
cartId | String |
cart ID to get |
token | String |
atlasSDKClient.putCheckoutcart(json, cartId, token, headers) ⇒ CartResponse
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 |
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 |
Baseclass for Address model
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) |
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 |
Baseclass for NormalizedAddress model
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 |
Baseclass for CheckedAddress model
Param | Type | Description |
---|---|---|
status | String |
status of the address check |
normalizedAddress | NormalizedAddress |
the normalized address |
Class for Brand model.
Param | Type | Description |
---|---|---|
name | String |
name of brand. |
Class for Partner model.
Param | Type | Description |
---|---|---|
id | String |
id of partner. |
name | String |
name of partner. |
detailURL | String |
URL of partner. |
Class for Article Unit Price model.
Param | Type | Description |
---|---|---|
amount | number |
amount of price. |
currency | String |
currency of price. |
Class for Article Unit model.
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 |
Class for Article Unit Attribute model.
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. |
Class for Article Unit EnrichmentAttribute model.
Param | Type | Description |
---|---|---|
key | String |
name of enrichment attribute. |
value | Array.<String> |
values of enrichment attribute. |
Class for TargetGroups model.
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 |
Class for ArticleImage model.
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. |
Class for Media model.
Param | Type | Description |
---|---|---|
images | ArticleImage |
array of images. |
Class for CartItem model
Param | Type | Description |
---|---|---|
sku | String |
SKU of item. |
quantity | Number |
Quantity of item. |
Class for CartItem model
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 |
Class for Payment model
Kind: global class
Param | Type | Description |
---|---|---|
method | String |
Payment Method type. |
selectionPageUrl | String |
URL of the payment selection page. |
metadata | Object |
Metadata for payment. |
Param | Type | Description |
---|---|---|
selected | SelectedPayment |
the selected payment. |
selectionPageUrl | String |
URL of the payment selection page. |
Class for Delivery model'
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. |
Class for ReviewRatingDistribution.
Param | Type | Description |
---|---|---|
level. | String |
|
count | Number |
count of reviews distribution. |
Class for ReviewRating.
Param | Type | Description |
---|---|---|
average | Number |
average rating of Article reviews. |
distribution | ReviewRatingDistribution |
distribution of reviews. |
Class for ReviewRecommendations.
Param | Type | Description |
---|---|---|
total | Number |
total number of Article reviews. |
positive | Number |
number of positive reviews. |
Class for ReviewSummary.
Param | Type | Description |
---|---|---|
total | Number |
total number of Article reviews. |
rating | ReviewRating |
average rating of Article review. |
recommendations | ReviewRecommendations |
recommendations of Article review. |
Class for ReviewEntry.
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. |
Class for Article Reviews.
Param | Type | Description |
---|---|---|
summary | ReviewSummary |
summary of Article review. |
entries | Array.<ReviewEntry> |
entries of Article review. |
Class for Image model.
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. |
Class for Video model.
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 |
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. |
Class for ArticleFamily model
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. |
Class for Discount model
Param | Type | Description |
---|---|---|
grossTotal | Price |
gross total of the discount. |
taxTotal | Price |
tax total of the discount. |
Class for Checkout Discount model
Param | Type | Description |
---|---|---|
remaining | Price |
remaining amount. |
gross | Price |
gross total of the discount. |
tax | Price |
tax total of the discount. |
Class for Delivery Request model
Param | Type | Description |
---|---|---|
service | String |
the delivery service. |
Class for Cart Request model
Param | Type | Description |
---|---|---|
items | Items |
a list of items. |
Class for Selected Payment model
Param | Type | Description |
---|---|---|
method | String |
Payment Method type. |
metadata | Object |
Metadata for payment. |
externalPayment | Boolean |
is an external payment provider used. |
Class for Payment model
Kind: global class
Param | Type | Description |
---|---|---|
method | String |
Payment Method type. |
selectionPageUrl | String |
URL of the payment selection page. |
metadata | Object |
Metadata for payment. |
Param | Type | Description |
---|---|---|
selected | SelectedPayment |
the selected payment. |
selectionPageUrl | String |
URL of the payment selection page. |
Class for Checkout Coupon Details model
Param | Type | Description |
---|---|---|
coupon | String |
the coupon. |
warning | String |
warnings regardings coupons. |
error | String |
errors regardings coupons. |
discount | CheckoutCouponDiscount |
the discount. |
Class for Cart Response model
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. |
Class for Carts Response model
Param | Type | Description |
---|---|---|
id | String |
the response id. |
carts | Array.<CartResponse> |
the requested carts. |
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. |
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. |
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. |
Class for Checkout Order Request model
Param | Type | Description |
---|---|---|
checkoutId | String |
the id of the checkout. |
SalesChannel class struct
Param | Type | Description |
---|---|---|
source | Object |
Initialisation object for SalesChannel |
Recommendations class struct
Param | Type | Description |
---|---|---|
source | Object |
Initialisation object for Recommendations |
Config class struct
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 = new Config(source);
Class for Guest Customer model
Param | Type | Description |
---|---|---|
String |
the id of the billing address. | |
subscribeNewsletter | Boolean |
subscribe to the newsletter. |
Class for Guest Customer model
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
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. |
Class for CreateOrderRequest model
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. |
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. |
Class for CreateOrderRedirectResponse model
Param | Type | Description |
---|---|---|
url | String |
Redirect URL. |
Class for GetCheckoutResponse model
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. |
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. |
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. |
Class for Guest Customer model
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. |
Class for Recommended Article model
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. |
A temporary fix to handle the current high load capacity
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. |
For any inquiry, please contact Team Atlas via team-atlas@zalando.de
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.