> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://dev.admoji.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://dev.admoji.com/_mcp/server.

# Idempotency

Every `POST` request to the Admoji API must include an `Idempotency-Key` header. Duplicate requests carrying the same key within 24 hours return the original result without re-executing the operation — protecting you from double-charges and duplicate records when a client retries after a transient error.

## Header format

```
Idempotency-Key: 3a2ebd06-e52f-47d2-92c4-66a107022f8e
```

Any unique string up to 48 characters is accepted. A UUID v4 is recommended.

> **Note**
>
> `GET`, `PUT`, and `DELETE` requests are idempotent by definition — the `Idempotency-Key` header is ignored on those methods.

## Why it matters

An API call is *idempotent* when applying it multiple times produces the same result as applying it once. Without an idempotency key, a client that retries a failed `POST /signup-transaction` may charge the card twice. With the same key on both attempts, the server recognizes the second request as a retry and returns the cached response of the original.

## Generating keys

Use your language's standard UUID generator. A short list:

| Language | Function                                                                            |
| -------- | ----------------------------------------------------------------------------------- |
| Ruby     | `SecureRandom.uuid`                                                                 |
| PHP      | `Ramsey\Uuid\Uuid::uuid4()`                                                         |
| Java     | `UUID.randomUUID()`                                                                 |
| Python   | `uuid.uuid4()`                                                                      |
| C#       | `Guid.NewGuid()`                                                                    |
| Node.js  | [`crypto.randomUUID()`](https://nodejs.org/api/crypto.html#cryptorandomuuidoptions) |

## Key lifecycle

* Keys expire **24 hours** after first use.
* Reusing a key **outside** the 24-hour window creates a new operation.
* Reusing a key **inside** the window with a **different** request payload returns an error — the idempotency layer verifies the payload matches the original request.

## Example

**`Signup transaction with idempotency`**

```shell title="Signup transaction with idempotency"
curl -X POST 'https://openapi.responsecrm.com/api/v2/open/signup-transaction' \
  -H "Authorization: ApiKey secret_492796e421a34666a5695d53cd311111" \
  -H "Idempotency-Key: 3a2ebd06-e52f-47d2-92c4-66a107022f8e" \
  -H "Content-Type: application/json" \
  -d '{ "customerID": 12345, "productID": 678 }'
```

Retry that exact request with the same header within 24 hours and you get the cached response of the first successful call — no double-charge, no duplicate order.

## Related

#### [Response codes](/errors)

Status values and rate limits

#### [API reference](/api-reference)

Full endpoint documentation