PHPackages                             shopgate/webcheckout-magento2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. shopgate/webcheckout-magento2

ActiveMagento2-module[Authentication &amp; Authorization](/categories/authentication)

shopgate/webcheckout-magento2
=============================

Helps SG connect/engage extensions with web checkout, auto-login, allows to add CSS for register/checkout pages

1.2.1(9mo ago)13.8k↓39.3%1proprietaryPHPPHP &gt;=8.1

Since Aug 9Pushed 9mo ago8 watchersCompare

[ Source](https://github.com/shopgate/magento2-webcheckout)[ Packagist](https://packagist.org/packages/shopgate/webcheckout-magento2)[ RSS](/packages/shopgate-webcheckout-magento2/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (3)Versions (12)Used By (0)

Shopgate WebCheckout
====================

[](#shopgate-webcheckout)

### Install via composer

[](#install-via-composer)

```
composer require shopgate/webcheckout-magento2
bin/magento module:enable Shopgate_WebCheckout
bib/magento setup:upgrade
```

### Configurations:

[](#configurations)

We suggest updating the `Services > Mage Web API > JWT Auth > Customer JWT Expires in` to a longer timeframe, otherwise the customer will be logged out every 60 minutes by default. This is not very user friendly.

### Endpoints

[](#endpoints)

#### Product ID to SKU mapping

[](#product-id-to-sku-mapping)

```
Anonymous & Customer

###
GET http://localhost/rest/default/V1/sgwebcheckout/products?ids[]=44&ids[]=2034&ids[]=2040
```

Result:

```
{
    "products": [
        {
            "sku": "24-WG02",
            "id": "44"
        },
        {
            "parent_sku": "WSH12",
            "sku": "WSH12-31-Green",
            "id": "2034"
        },
        {
            "sku": "WSH12",
            "id": "2040"
        }
    ]
}
```

#### Product SKU to ID mapping

[](#product-sku-to-id-mapping)

```
Anonymous & Customer

###
GET http://localhost/rest/default/V1/sgwebcheckout/productsBySku?skus[]=24-WG02&skus[]=MS-Champ-M&skus[]=MS-Champ
```

Result:

```
{
    "products": [
        {
            "sku": "24-WG02",
            "id": "44"
        },
        {
            "parent_sku": "WSH12",
            "sku": "WSH12-31-Green",
            "id": "2034"
        },
        {
            "sku": "WSH12",
            "id": "2040"
        }
    ]
}
```

#### Auto-login token

[](#auto-login-token)

```
Customer

###
POST http://localhost/rest/default/V1/sgwebcheckout/me/token
```

```
Guest user (with cart)

###
POST http://localhost/rest/default/V1/sgwebcheckout/:cartId/token
```

Result

```
{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expiration": 1722194685
}
```

```
Anonymous user (guest without cart)

###
POST http://localhost/rest/default/V1/sgwebcheckout/anonymous/token
```

Result

```
{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expiration": 1722194685
}
```

#### Custom WebCheckout log

[](#custom-webcheckout-log)

Note that you will need to enable the logging in the `Shopgate > WebCheckout` configuration for it to stop throwing 500 errors.

```
Admin

###
GET http://localhost/rest/default/V1/sgwebcheckout/log?page=1&lines=20
```

Result:

```
{
    "log": [
        "[2024-07-28T19:08:21.400242+00:00] shopgate_webc.ERROR: Could not find products by IDs: 99999 [] []\n",
        ""
    ]
}
```

#### Shopgate WebCheckout orders

[](#shopgate-webcheckout-orders)

```
Admin User / Integration

###
GET http://localhost/rest/default/V1/sgwebcheckout/orders?searchCriteria[currentPage]=1&searchCriteria[pageSize]=10&searchCriteria[filter_groups][0][filters][0][field]=increment_id&searchCriteria[filter_groups][0][filters][0][value]=000000051&searchCriteria[filter_groups][0][filters][0][condition_type]=eq
```

Result:

```
{
    "items": [
        {
            "entity_id": 51,
            "increment_id": "000000051",
            "items": [
                {
                }
            ]
        }
    ],
    "search_criteria": {
        "filter_groups": [
            {
                "filters": [
                    {
                        "field": "increment_id",
                        "value": "000000051",
                        "condition_type": "eq"
                    }
                ]
            }
        ],
        "page_size": 10,
        "current_page": 1
    },
    "total_count": 1
}
```

### Developer mode

[](#developer-mode)

When working with the frontend and trying to mimic the inApp, just append `?sgWebView=1` and load the page. This will allow you to work with CSS and see our JavaScript logic as if you loaded the page as inApp browser. Clear the cookie by setting `?sgWebView=0`.

Our logic, (at the time of writing only `sgwebcheckout/account/login` controller) has logging for easier debugging, however, you will need to enable it in the `Admin > Config > Shopgate WebCheckout` area **or** with command line:

```
bin/magento config:set shopgate_webcheckout/development/enable_logging 1
bin/magento cache:clear
```

Afterward, you can see the log in the `var/log/shopgate/webcheckout_debug.log` directory or use our API to query the logs. See postman for an example of how to use it.

### Errors

[](#errors)

- `Token has an invalid structure.` - this error can occur if there is a 302 redirect happening. Let's say you have a website test.com, but your `default` storeCode references test.com/en, calling `test.com/sgwebcheckout/login?token=...`will trigger a 302 redirect to `test.com/en/sgwebcheckout/login` without forwarding the token or any other parameter. Token will be empty &amp; you get this error message. Fix - make sure to use `test.com/en` as your domain.
- `The current user cannot perform operations on cart \"{MASKED_ID}\"` - this is an error that can happen if you are trying to addProducts to cart as guest, but a customer session cookie is set, it is called `PHPSESSID`. Fix - make sure the Cookie is not set before making API/GraphQL calls.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance56

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Recently: every ~50 days

Total

11

Last Release

295d ago

Major Versions

0.3.2 → 1.1.02025-04-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/d3f2154c032da9f97644b2bc9f2a44bd62aaac17444aa759006a56d8becd63af?d=identicon)[shopgate](/maintainers/shopgate)

---

Top Contributors

[![augsteyer](https://avatars.githubusercontent.com/u/844601?v=4)](https://github.com/augsteyer "augsteyer (84 commits)")[![andre-kraus](https://avatars.githubusercontent.com/u/15677786?v=4)](https://github.com/andre-kraus "andre-kraus (28 commits)")

### Embed Badge

![Health badge](/badges/shopgate-webcheckout-magento2/health.svg)

```
[![Health](https://phpackages.com/badges/shopgate-webcheckout-magento2/health.svg)](https://phpackages.com/packages/shopgate-webcheckout-magento2)
```

###  Alternatives

[mollie/magento2

Mollie Payment Module for Magento 2

1131.9M16](/packages/mollie-magento2)[loki/magento2-components

Core module for defining Alpine.js components with advanced AJAX features

1011.8k26](/packages/loki-magento2-components)[imi/magento2-friendly-captcha

Friendly Captcha integration for Magento2

19131.4k](/packages/imi-magento2-friendly-captcha)[buckaroo/magento2

Buckaroo Magento 2 extension

32420.3k8](/packages/buckaroo-magento2)[hryvinskyi/magento2-invisible-captcha

Magento 2 Google Invisible Captcha (Recaptcha) module

289.6k](/packages/hryvinskyi-magento2-invisible-captcha)[mage-os/module-inventory-reservations-grid

Add a grid with the list of inventory reservations.

1615.9k](/packages/mage-os-module-inventory-reservations-grid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
