PHPackages                             snowio/magento2-idempotent-api - 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. [API Development](/categories/api)
4. /
5. snowio/magento2-idempotent-api

ActiveMagento2-module[API Development](/categories/api)

snowio/magento2-idempotent-api
==============================

v2.0.2(3y ago)4157.9k↓42.9%2[1 PRs](https://github.com/snowio/magento2-idempotent-api/pulls)MITPHPPHP ^7.4||^8.1

Since Jan 18Pushed 3y ago3 watchersCompare

[ Source](https://github.com/snowio/magento2-idempotent-api)[ Packagist](https://packagist.org/packages/snowio/magento2-idempotent-api)[ RSS](/packages/snowio-magento2-idempotent-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (11)Used By (0)

Magento 2 Idempotent API
========================

[](#magento-2-idempotent-api)

Description
-----------

[](#description)

Module that ensures all API operations are *idempotent*.

> **Idempotence** : From a RESTful service standpoint, for an operation (or service call) to be idempotent, clients can make that same call repeatedly while producing the same result. In other words, making multiple identical requests has the same effect as making a single request. Note that while idempotent operations produce the same result on the server (no side effects), the response itself may not be the same (e.g. a resource's state may change between requests).
>
> \--RestApiTutorial.com

Prerequisites
-------------

[](#prerequisites)

- PHP 7.4 or newer
- Composer ().
- `magento/framework` 103 or newer
- `snowio/magento2-lock` version 1 or newer.

### Magento Versions

[](#magento-versions)

- `= 2.4.x` use master

Installation
------------

[](#installation)

```
composer require snowio/magento2-idempotent-api
php bin/magento setup:upgrade
php bin/magento module:enable SnowIO_IdempotentAPI
php bin/magento setup:di:compile
php bin/magento cache:flush

```

Usage
-----

[](#usage)

### Request Headers

[](#request-headers)

#### X-Message-Group-ID

[](#x-message-group-id)

The `X-Message-Group-ID` request-header field specifies the message group of the request. If no `X-Message-Group-ID` is specified then the request will not be treated idempotently.

#### X-Message-Timestamp

[](#x-message-timestamp)

The `X-Message-Timestamp` request-header field corresponds to the time the message was created. If this field is not specified then this plugin uses `\time()` as the message timestamp, please note that the this is a **Unix Timestamp**.

### Error Response Codes

[](#error-response-codes)

##### 409 Conflict

[](#409-conflict)

This error occurs when 2 or more requests with the same `X-Message-Group-ID` are processed at the simultaneously one of the requests will result in a *409 CONFLICT* error response. The Idempotent API should ensure that the resource is not simultaneously updated.

##### 412 Precondition Failed

[](#412-precondition-failed)

This error occurs when a *late message* is received. Message **A** is a *late message***iff** message **B** (which has the same `X-Message-Group-ID`) was created in the source client after **A** (has a larger `X-Message-Timestamp` than message **A**) and was received **before** message **A**. Message **A** will try update the resource but fails as message **B** is more recent than message **A**. This ensures that **late messages** do not affect the state of the resource.

License
-------

[](#license)

This software is licensed under the MIT License. [View the license](LICENSE)

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~329 days

Recently: every ~278 days

Total

7

Last Release

1431d ago

Major Versions

1.x-dev → v2.0.02020-12-02

PHP version history (3 changes)v1.0.0PHP &gt;=7

v2.0.0PHP ^7.4

v2.0.2PHP ^7.4||^8.1

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/248c125feb1acc5c8932c06226dcd5086760736ff5fc9ec69be32a3aeae8a339?d=identicon)[chickenland](/maintainers/chickenland)

---

Top Contributors

[![meng-tian](https://avatars.githubusercontent.com/u/4396851?v=4)](https://github.com/meng-tian "meng-tian (11 commits)")[![realmtian](https://avatars.githubusercontent.com/u/4396851?v=4)](https://github.com/realmtian "realmtian (11 commits)")[![darryla](https://avatars.githubusercontent.com/u/12641702?v=4)](https://github.com/darryla "darryla (3 commits)")[![peekarboo](https://avatars.githubusercontent.com/u/39334796?v=4)](https://github.com/peekarboo "peekarboo (3 commits)")[![tr33m4n](https://avatars.githubusercontent.com/u/1771667?v=4)](https://github.com/tr33m4n "tr33m4n (1 commits)")

###  Code Quality

Static AnalysisRector

### Embed Badge

![Health badge](/badges/snowio-magento2-idempotent-api/health.svg)

```
[![Health](https://phpackages.com/badges/snowio-magento2-idempotent-api/health.svg)](https://phpackages.com/packages/snowio-magento2-idempotent-api)
```

###  Alternatives

[smile/elasticsuite

Magento 2 merchandising and search engine built on ElasticSearch

8044.5M33](/packages/smile-elasticsuite)[mollie/magento2

Mollie Payment Module for Magento 2

1121.6M10](/packages/mollie-magento2)[graycore/magento2-cors

A Magento 2 module that enables CORS on the GraphQL and REST Apis

99516.1k](/packages/graycore-magento2-cors)[elgentos/module-prismicio

Magento 2 - Prismic.io integration

39112.0k3](/packages/elgentos-module-prismicio)[zepgram/module-rest

Technical module to industrialize API REST call with dependency injection pattern using Guzzle library

1326.2k](/packages/zepgram-module-rest)

PHPackages © 2026

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