POST calls are idempotent capable when the primary token is set in the request object.
For example, if you send a POST request to create a resource and don’t receive a response because the card network timed out, you can reissue the same call, with identical content and primary token, and will receive a 201 success response.
The primary token
The primary token is thetoken field in the request body of the resource you are creating. For example, it is the token field in a POST /users or POST /cards request.
The primary token is the unique identifier of the new resource, not a separate idempotency key. After the Marqeta platform creates the resource, you use the same value to reference it in other API calls, such as GET /users/{token}.
On many Core API POST endpoints, such as POST /users and POST /cards, the token field is optional. If you do not include a token, the Marqeta platform generates one automatically. To make a POST request idempotent, set the token field yourself, and reuse that same value when you retry the request. On these endpoints, the token field accepts 1–36 characters and cannot be updated after the resource is created.