Skip to main content

Overview

Pix Automatic depends on asynchronous webhooks sent by the acquirer (mandate approvals, scheduled charges, settlements, failures). In the Sandbox, PayMee exposes a simulator that produces those exact webhooks and feeds them to the same handlers used in production, so you can exercise the entire recurrence lifecycle end to end without a real payer. All simulator endpoints live under:
https://apisandbox.paymee.com.br/v1.1/pix-automatic/sandbox/sim
These endpoints exist only in the Sandbox. They authenticate with the same x-api-key and x-api-token as the rest of the API and act only on recurrences that belong to your test merchant.

Authentication

Every simulator call requires both headers:
x-api-key: <your-sandbox-key>
x-api-token: <your-sandbox-token>
Content-Type: application/json

Typical end-to-end flow

1

Create a plan

POST /v1.1/pix-automatic/plans — defines the frequency and amount of the recurrence.
2

Create the recurrence (checkout)

POST /v1.1/checkout/pix-automatic — returns an idRec for the new authorization, which starts in CREATED.
3

Authorize the mandate

POST /sandbox/sim/mandate/{idRec}/approved — drives the approval and moves the recurrence to APPROVED. A RECURRENCE_AUTHORIZED webhook is emitted.
4

Generate the due charge

POST /sandbox/sim/recurrence/{idRec}/run-due — generates the next scheduled collection (a sale) for recurrences whose next charge falls within the due window.
5

Settle or fail the charge

POST /sandbox/sim/collection/{txId}/concluded to settle, or POST /sandbox/sim/collection/{txId}/reject/{code} to fail with a reason code.
Each individual mandate action drives the full prerequisite sequence automatically. Calling .../mandate/{idRec}/approved on a recurrence still in CREATED first drives APPROVING and then APPROVED, so the action works from any starting state.

Mandate (authorization) endpoints

EndpointEffect
POST /sandbox/sim/mandate/{idRec}/approvingMarks the authorization as in progress (APPROVING).
POST /sandbox/sim/mandate/{idRec}/approvedApproves the mandate (APPROVED).
POST /sandbox/sim/mandate/{idRec}/rejectedRejects the authorization (REJECTED).
POST /sandbox/sim/mandate/{idRec}/expiredExpires the authorization request (EXPIRED).
POST /sandbox/sim/mandate/{idRec}/cancellingStarts cancellation (CANCELLING).
POST /sandbox/sim/mandate/{idRec}/cancelledCompletes cancellation (CANCELLED).

Collection (charge) endpoints

EndpointEffect
POST /sandbox/sim/recurrence/{idRec}/run-dueGenerates the next due collection (sale) for the recurrence.
POST /sandbox/sim/collection/{txId}/activeMarks the collection as active/scheduled.
POST /sandbox/sim/collection/{txId}/concludedSettles the collection and credits the merchant balance.
POST /sandbox/sim/collection/{txId}/failedFails the collection (insufficient funds).
POST /sandbox/sim/collection/{txId}/canceledCancels the collection.
POST /sandbox/sim/collection/{txId}/reject/{code}Rejects the collection with a specific reason code (see below).
POST /sandbox/sim/collection/{txId}/retryTriggers the retry sweep for failed collections (3R/7D policy).

One-shot scenarios

For convenience, composite scenarios drive a whole sequence in a single call:
POST /v1.1/pix-automatic/sandbox/sim/recurrence/{idRec}/scenario/{name}
nameSequence driven
approve-and-settleApprove the mandate, generate the first charge, settle it and conclude.
no-funds-3xApprove, then fail the charge repeatedly to exercise the retry policy.
approve-rejectApprove the request, then reject it.
cancel-by-payerApprove the mandate, then cancel it on the payer’s side.

Failure reason codes

Use these codes with .../collection/{txId}/reject/{code} (or .../recurrence/{idRec}/fail/{code}):
CodeMeaning
FAIL / AM04Insufficient funds in the payer’s account
AC06Payer’s account is blocked
AC03 / AC01Invalid payer account
MD01Authorization missing or revoked
SL02Pix Automatic limit exceeded
AG03Operation not allowed for the account
AB09Failure at the payer’s PSP
SLCRCancellation requested
The due window for run-due is [now + 2 days, now + 10 days]. A freshly created recurrence whose next charge date is outside this window will not generate a collection until its next cycle approaches; the approve-and-settle scenario handles the first charge for you.

Webhook Notifications

See the Pix Automatic (Recurrence) notification payloads emitted during these flows.