Skip to content

Commit

Permalink
Update request headers
Browse files Browse the repository at this point in the history
  • Loading branch information
sushmangupta committed Nov 20, 2023
1 parent fc47888 commit b5930c7
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion guides/integrations-api/general-concepts/request-headers.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,35 @@ POST /api/search/product

## sw-skip-trigger-flow

Flows are an essential part of Shopware and are triggered by events like the creation of a customer. When migrating from another ecommerce platform to shopware, you might import hundreds of thousands of customers via the sync API. In that case, you don't want to trigger the `send email on customer creation` flow. To avoid this behavior, you can pass the `sw-skip-trigger-flow` header.
Flows are an essential part of Shopware and are triggered by events like the creation of a customer. When migrating from another e-commerce platform to shopware, you might import hundreds of thousands of customers via the sync API. In that case, you don't want to trigger the `send email on customer creation` flow. To avoid this behavior, you can pass the `sw-skip-trigger-flow` header.

```bash
POST /api/_action/sync
--header 'sw-skip-trigger-flow: 1'
```

## sw-access-token & sw-context-token

Refer to [Authentication & Authorization](https://shopware.stoplight.io/docs/store-api/8e1d78252fa6f-authentication-and-authorisation) section of Store API for more details on these headers.

## sw-currency-id

When making a request to the API, a client can include the `sw-currency-id` header to indicate the currency in which it wants to receive prices. For example, if the header is set to "USD," the API might respond with prices converted to U.S. dollars. This header is associated with the currency settings in the admin panel. It allows clients to dynamically switch between different currencies based on their preferences.

```bash
POST /api/_action/order/orderId
--header 'sw-currency-id'
```

## sw-include-seo-urls

This header indicates whether SEO-friendly URLs for products or categories should be included in the API response. If an API request is made and the `sw-include-seo-urls` header is set, the API response will include all the configured SEO URLs for the specified product. This can provide additional information to the client about the various SEO-friendly paths associated with the product, allowing for better SEO management or customization.

```bash
POST /store-api/product-listing/categoryId
--header 'sw-include-seo-urls'
```

## sw-app-integration-id

App integration enable seamless connection and data exchange between different software components. This header is required for correct permission checks performed by the backend when fetching or manipulating data. It overrides the default behavior and uses the privileges provided by the app. This is used in the Admin Extension SDK for the Repository Data Handling (https://shopware.github.io/admin-extension-sdk/docs/guide/api-reference/data/repository). But the developer itself doesn’t need to care about it because it is handled automatically by the admin.

0 comments on commit b5930c7

Please sign in to comment.