Skip to content

Commit

Permalink
docs: provide scayle mapping tables
Browse files Browse the repository at this point in the history
  • Loading branch information
Benj0s committed Jan 24, 2025
1 parent 52ff779 commit df64976
Showing 1 changed file with 75 additions and 3 deletions.
78 changes: 75 additions & 3 deletions docs/vendor/commerce/scayle.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,82 @@ How to get the "Shop ID" - [Scayle docs - Shop Country ID](https://scayle.dev/en

The "Tenant Space" can be picked from your Scayle panel URL e.g. `https://{{tenant-space}}.panel.scayle.cloud/`

## Sacyle API integration
## Scayle API integration

The integration middleware uses Scayle's [Storefront API](https://scayle.dev/en/api-guides/storefront-api) to request shop product and category data.

To retrieve product data the integration utilises [Storefront API - List Products](https://scayle.dev/en/api-guides/storefront-api/resources/products/list-products).
## How we map data

For category data the integration uses [Storefront API - List Categories](https://scayle.dev/en/api-guides/storefront-api/resources/categories/list-categories)
To maintain consistent response types we map data returned from Scayle APIs. The following documents what Scayle API proerties get mapped to their respective integration properties.

Example product integrations response item:

```json
{
"id": "1",
"slug": "LIJ0480001000004",
"name": "Liu Jo Sandale CAMELIA",
"shortDescription": "Liu Jo Sandale CAMELIA - short description",
"longDescription": "Liu Jo Sandale CAMELIA - long description",
"variants": [
{
"id": "40",
"images": [
{
"url": "https://dc-integration-middleware-test-demo.cdn.aboutyou.cloud/images/68bf124a0517bffaa5fe1dc7ac8707db.jpg"
}
],
"listPrice": "€329.90",
"salePrice": "€329.90",
"sku": "LIJ0480001000004_38",
"attributes": {}
}
],
"categories": []
}
```

Examples category response item:

```json
{
"id": "1",
"name": "Männer",
"slug": "maenner",
"children": [],
"products": [],
"showInMenu": true
}
```

### Product & Product Variants mapping

We use Scayles [Storefront API - List Products](https://scayle.dev/en/api-guides/storefront-api/resources/products/list-products) to map products:

| Integration product | Scayle product | Notes |
| --------------------- | ----------------------------------- | -------------------------------- |
| id | id | |
| slug | referenceKey | |
| name | attributes.name.values.label | |
| shortDescription | attributes.description.values.label | |
| longDescription | attributes.description.values.label | |
| variants | variants | |
| variants[].sku | variants[].referenceKey | |
| variants[].listPrice | variants[].price.withTax | |
| variants[].salePrice | variants[].price.withTax | |
| variants[].images | images[].hash | |
| variants[].attributes | {} | Not defined |
| categories | categories | See Category mapping for details |

### Category mapping

We use Scayle's [Storefront API - List Categories](https://scayle.dev/en/api-guides/storefront-api/resources/categories/list-categories) to map categories:

| Integration category | Scayle category | Notes |
| -------------------- | --------------- | ------------------------------------------------------------------------------------ |
| id | id | |
| name | name | |
| slug | slug | |
| children | children | |
| products | products | The products are done as a seperate lookup using the Scayle `list-products` endpoint |
| showInMenu | isHidden | We invert this boolean values |

0 comments on commit df64976

Please sign in to comment.