Remediation
Most stuck payments resolve in the checkout: the customer verifies through the Peer app or
extension, or contacts support from the page. To act from your backend instead, use one of
three actions on a payment attempt. Each is asynchronous: the request returns 202 with an
action id, Peer runs the action, and you poll until it ends.
| Action | Endpoint | Use it when |
|---|---|---|
| Recreate | POST /api/v1/merchants/me/orders/{orderId}/payments/{paymentId}/recreate | The attempt expired, was cancelled, or failed, and the customer paid (or will pay) the same recipient anyway |
| Extend | POST …/payments/{paymentId}/extend | The attempt is still open and the customer needs more time |
| Fulfill from a transaction id | POST …/payments/{paymentId}/fulfill-sar | You hold the customer's payment transaction id and the recipient supports automated release |
Poll with GET …/actions/{actionId}. Find the paymentId with
list payments for an order.
Before you start
- Authentication. Your API key, or a dashboard session with the Owner or Manager role.
Cashier sessions get
403withcode: "ROLE_NOT_ALLOWED". - Live only. A sandbox key gets
403withcode: "SANDBOX_NOT_SUPPORTED". Sandbox payments settle by simulation and need no remediation. - Fiat rails only. Crypto rails, and rails that are currently disabled, are rejected with
reason: "RAIL_NOT_SUPPORTED". - Availability. Peer can switch the actions off. While off, a new action returns
503withcode: "FEATURE_DISABLED"; polls and replays of an existingidempotencyKeykeep working. Extensions can be switched off on their own, so extend can return503while the other two work. - Rate limits. 30 actions and 120 reads (polls and per-order payment lists) per minute per merchant, on top of the global limit.
- Approval. Depending on your plan, an action may first wait for approval by Peer
(
PENDING_APPROVAL). An action not approved within 15 minutes endsBLOCKEDwithAPPROVAL_EXPIRED.
Failures carry a code in responseObject.code of the standard
envelope; see action errors. Validation failures
carry fieldErrors there instead.
Recreate
POST /api/v1/merchants/me/orders/{orderId}/payments/{paymentId}/recreate
X-API-Key: <your key>
Content-Type: application/json
{ "idempotencyKey": "order-42-recreate-1" }
Reopens a closed attempt with the same recipient: the payment returns to CREATED with a fresh
window, so a payment the customer sent after the window closed can still be verified. To do it
from the dashboard instead, see give a buyer more time.
| Requirement | reason when unmet |
|---|---|
| Fiat rail that is currently enabled | RAIL_NOT_SUPPORTED |
Payment EXPIRED, CANCELLED, or FAILED | PAYMENT_STATUS_NOT_ELIGIBLE |
Order CREATED or PARTIALLY_FULFILLED | ORDER_STATUS_NOT_ELIGIBLE |
The body is optional; see idempotency.
On Pro or Base, a recreate shares your
active payment limits. It is refused with
409 and code: "ACTIVE_PAYMENT_LIMIT_REACHED" when the order already has another payment that
is active or being recreated, or when your active payments plus your recreates still in progress
have reached the limit. Wait for a payment to finish, then send a new request. Concierge accounts
are held only to the abuse ceilings.
On success result.intentHash is the reopened attempt's new onchain identifier, and the same
payment row shows status: "CREATED", that value in railIdentifier, and the new
quoteExpiresAt. No webhook fires for the reopening; PAYMENT_SETTLED fires if it later
settles.
Extend
POST /api/v1/merchants/me/orders/{orderId}/payments/{paymentId}/extend
X-API-Key: <your key>
Content-Type: application/json
{ "idempotencyKey": "order-42-extend-1" }
Adds 24 hours to the attempt's window. The amount doesn't change. The dashboard's Extend +24h does the same without code; see give a buyer more time.
On Pro or Base you can extend a payment once. After an extension is accepted, another request
for the same payment is refused with 409 and code: "EXTENSION_LIMIT_REACHED", also after a
recreate; contact Peer support to extend it further. An extension that ended FAILED or
BLOCKED does not use it up. Concierge accounts can call again for another 24 hours once the
new expiry is within 6 hours, up to the abuse ceiling of 10 extensions per payment.
| Requirement | reason when unmet |
|---|---|
| Fiat rail that is currently enabled | RAIL_NOT_SUPPORTED |
Payment CREATED | PAYMENT_STATUS_NOT_ELIGIBLE |
Attempt is live onchain (railIdentifier set) | INTENT_HASH_MISSING |
quoteExpiresAt is at most 6 hours away | EXTEND_TOO_EARLY |
An attempt can be extended to at most 5 days after its creation. A request past that point is
accepted and then fails with FIVE_DAY_LIFETIME_EXCEEDED.
On success result.confirmedExpiryTime is the new expiry (ISO 8601). The payment's
quoteExpiresAt catches up within a few minutes, so read the result, not the payment, right
after success.
Fulfill from a transaction id
POST /api/v1/merchants/me/orders/{orderId}/payments/{paymentId}/fulfill-sar
X-API-Key: <your key>
Content-Type: application/json
{ "txId": "4123456789012345678", "idempotencyKey": "order-42-fulfill-1" }
Settles the attempt from the customer's payment transaction id, without the customer verifying
in the Peer app or extension. txId is the transaction or payment id on the customer's receipt
in their payment app, 1 to 256 characters. The attempt must have been created with
Seller Automated Release available, which
depends on the recipient and your plan.
| Requirement | reason when unmet |
|---|---|
| Fiat rail that is currently enabled | RAIL_NOT_SUPPORTED |
| Automated release is available | SAR_DISABLED |
| Not PayPal (PayPal release needs memo and name evidence a transaction id can't carry) | PAYPAL_NOT_SUPPORTED |
| Automated release is on for the rail | SAR_RAIL_DISABLED |
| Venmo, Cash App, Wise or X Money, and the attempt was created with automated release available | SAR_NOT_AVAILABLE |
Payment CREATED | PAYMENT_STATUS_NOT_ELIGIBLE |
Attempt is live onchain (railIdentifier set) | INTENT_HASH_MISSING |
On success result is { dispatchAttemptId, fulfillTxHash }, the payment is SETTLED, and
PAYMENT_SETTLED fires (then ORDER_FULFILLED once the order is covered). If the payment had
already settled when the action ran, result is { alreadyCompleted: true, fulfillTxHash } and
the action still SUCCEEDED. A wrong or unverifiable id ends the action FAILED with
REMEDIATION_FAILED: check the id against the customer's receipt and retry with a new key, or
contact Peer support with the action id.
Idempotency and conflicts
idempotencyKey (8 to 200 characters, optional on every action) makes a request safe to
retry. Keys are scoped to your merchant.
| Situation | Response |
|---|---|
Same key, same order, payment, action and txId | 200 with the existing action's id and current status, even after actions are switched off |
| Same key, anything else different | 422 with code: "IDEMPOTENCY_KEY_MISMATCH" |
| No key, or a new one, while an action of the same kind is still waiting, queued or running on the attempt | 409 with code: "ACTION_IN_PROGRESS" and the live action's actionId |
Reuse a key only to retry the same request after a timeout or a 502. After an action ends
FAILED or BLOCKED, send a new key (or none); the old key keeps returning the finished
action.
Action errors
The three actions share one error table. A 422 eligibility failure adds
responseObject.reason, and an ACTION_IN_PROGRESS 409 adds responseObject.actionId.
| Status | code | Cause |
|---|---|---|
400 | A path parameter or the body failed validation. Details in responseObject.fieldErrors | |
401 | Missing or invalid API key or dashboard session | |
403 | ROLE_NOT_ALLOWED | Dashboard session without the Owner or Manager role |
403 | SANDBOX_NOT_SUPPORTED | Sandbox key |
403 | ACTION_DENIED | Your plan doesn't allow this action. Contact support |
404 | The order is not yours, or the payment is not on it | |
409 | ACTION_IN_PROGRESS | A live action of the same kind exists; actionId is its id |
409 | ACTIVE_PAYMENT_LIMIT_REACHED | Recreate only. The recreate would exceed your active payment limits; message says which one |
409 | EXTENSION_LIMIT_REACHED | Extend only. On Pro or Base you already extended this payment once; on Concierge the payment reached the abuse ceiling of 10 extensions. Contact Peer support to extend it further. |
422 | PAYMENT_NOT_ELIGIBLE | reason is one of the reason codes listed under the action |
422 | IDEMPOTENCY_KEY_MISMATCH | The key was already used for a different request |
429 | Per-merchant or global rate limit exceeded | |
502 | SUPPORT_UNAVAILABLE | Peer did not answer in time, and the action may or may not have been recorded. Retry with the same idempotencyKey (a recorded action returns 200), or read the payment before sending a different request |
503 | FEATURE_DISABLED | Actions are switched off, or, for extend, extensions are |
Poll an action
GET /api/v1/merchants/me/orders/{orderId}/actions/{actionId}
X-API-Key: <your key>
Response
type MerchantAction = {
actionId: string;
actionName: 'RECREATE' | 'EXTEND' | 'FULFILL_SAR';
paymentId: string;
status: 'PENDING_APPROVAL' | 'QUEUED' | 'RUNNING' | 'SUCCEEDED' | 'BLOCKED' | 'FAILED';
error: { code: string; message: string } | null;
result: Record<string, unknown> | null;
payment: CheckoutPayment;
createdAt: string;
startedAt: string | null;
finishedAt: string | null;
};
| Status | Meaning |
|---|---|
PENDING_APPROVAL | Waiting for approval by Peer, for up to 15 minutes |
QUEUED | Accepted, not started |
RUNNING | In progress. A fulfil can stay here up to 30 minutes while its transaction is pending |
SUCCEEDED | Done. result is set |
BLOCKED | Never ran: rejected (APPROVAL_REJECTED), not approved in time (APPROVAL_EXPIRED), or cancelled by Peer (ACTION_CANCELED) |
FAILED | Ran and did not complete, or expired before running (ACTION_EXPIRED). error says why |
Terminal statuses never change. payment is always the attempt's current row, so after a
successful recreate it already shows the reopened attempt.
Error codes
error.code is one of these; anything else is reported as REMEDIATION_FAILED.
| Code | Actions | Meaning |
|---|---|---|
NEEDS_MANUAL_REVIEW | all | The action needs manual review. Peer support will follow up |
APPROVAL_REJECTED, APPROVAL_EXPIRED, ACTION_CANCELED | all | See BLOCKED above |
ACTION_EXPIRED | all | The action was not picked up in time |
FULFILL_FAILED | fulfil | The settlement transaction failed onchain. A new request retries |
FULFILL_TIMEOUT | fulfil | The settlement transaction was still pending at the deadline. Check the payment before retrying |
INTENT_ALREADY_EXPIRED, PAYMENT_NOT_OPEN | extend | The attempt expired or settled before the extension ran. Reread the payment; recreate only if it closed unpaid |
FIVE_DAY_LIFETIME_EXCEEDED | extend | The attempt has reached its 5-day lifetime |
UNSUPPORTED_INTENT_GUARDIAN | extend | This attempt can't be extended |
INSUFFICIENT_EXTENSION_TOKEN_BALANCE | extend | Extensions are temporarily unavailable on Peer's side. Retry later |
INTENT_EXTENSION_TRANSACTION_REVERTED | extend | The extension transaction reverted. A new request retries |
INTENT_NOT_LIVE | recreate | The reopened attempt was no longer live when checked |
DISPATCH_FAILED | recreate | The reopened attempt could not be started onchain. A new request retries |
MERCHANT_WALLET_NOT_DELEGATED, MERCHANT_SIGNING_UNAVAILABLE | recreate | Your account signs its own orders and its wallet isn't ready. Re-delegate the merchant wallet in the dashboard, or contact Peer support with the action id |
MERCHANT_SIGNER_NOT_READY | recreate | HTTP 503 (retryable). Peer Pay is setting up this merchant's signer. Try again in a minute. |
REMEDIATION_FAILED | all | Anything else. Contact Peer support with the action id |
Errors
| Status | Cause |
|---|---|
404 | No such action on a payment of this order |
502 | SUPPORT_UNAVAILABLE: Peer was unreachable. Retry with backoff |
The common errors also apply. Polls count toward the per-merchant read limit.
Example: settle from a transaction id and wait
Envelope<T> is the shared response envelope.
type Accepted = { actionId: string; status: string };
const BASE = 'https://api.pay.peer.xyz/api/v1/merchants/me/orders';
const headers = { 'X-API-Key': process.env.ZKPAY_API_KEY!, 'content-type': 'application/json' };
// `attemptKey` (8 to 200 characters) names one logical attempt on your side. Reuse it to retry
// a request that timed out; use a new one for a deliberate retry after FAILED or BLOCKED.
async function settleFromTxId(orderId: string, paymentId: string, txId: string, attemptKey: string): Promise<MerchantAction> {
const started = await fetch(`${BASE}/${orderId}/payments/${paymentId}/fulfill-sar`, {
method: 'POST',
headers,
body: JSON.stringify({ txId, idempotencyKey: attemptKey }),
signal: AbortSignal.timeout(15_000),
});
const accepted = (await started.json()) as Envelope<Accepted>;
if (!accepted.success || accepted.responseObject === null) {
throw new Error(`${accepted.statusCode}: ${accepted.message}`);
}
const deadline = Date.now() + 45 * 60 * 1000;
for (;;) {
const response = await fetch(`${BASE}/${orderId}/actions/${accepted.responseObject.actionId}`, {
headers,
signal: AbortSignal.timeout(15_000),
});
const body = (await response.json()) as Envelope<MerchantAction>;
if (!body.success || body.responseObject === null) {
throw new Error(`${body.statusCode}: ${body.message}`);
}
const action = body.responseObject;
if (action.status === 'SUCCEEDED' || action.status === 'FAILED' || action.status === 'BLOCKED') {
return action;
}
if (Date.now() > deadline) {
throw new Error(`action ${action.actionId} still ${action.status}`);
}
await new Promise((resolve) => setTimeout(resolve, 5_000));
}
}
Approval can take up to 15 minutes and a pending fulfil up to 30, so keep the overall deadline generous, and fall back to list payments for an order if you give up.
Notes
- Peer support sees the actions you take on an order, so they have the context if the customer contacts them.
- A fulfil still waiting for approval when you recreate the attempt runs against the reopened attempt, which keeps the same recipient.