Skip to main content

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.

ActionEndpointUse it when
RecreatePOST /api/v1/merchants/me/orders/{orderId}/payments/{paymentId}/recreateThe attempt expired, was cancelled, or failed, and the customer paid (or will pay) the same recipient anyway
ExtendPOST …/payments/{paymentId}/extendThe attempt is still open and the customer needs more time
Fulfill from a transaction idPOST …/payments/{paymentId}/fulfill-sarYou 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 403 with code: "ROLE_NOT_ALLOWED".
  • Live only. A sandbox key gets 403 with code: "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 503 with code: "FEATURE_DISABLED"; polls and replays of an existing idempotencyKey keep working. Extensions can be switched off on their own, so extend can return 503 while 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 ends BLOCKED with APPROVAL_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.

Requirementreason when unmet
Fiat rail that is currently enabledRAIL_NOT_SUPPORTED
Payment EXPIRED, CANCELLED, or FAILEDPAYMENT_STATUS_NOT_ELIGIBLE
Order CREATED or PARTIALLY_FULFILLEDORDER_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.

Requirementreason when unmet
Fiat rail that is currently enabledRAIL_NOT_SUPPORTED
Payment CREATEDPAYMENT_STATUS_NOT_ELIGIBLE
Attempt is live onchain (railIdentifier set)INTENT_HASH_MISSING
quoteExpiresAt is at most 6 hours awayEXTEND_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.

Requirementreason when unmet
Fiat rail that is currently enabledRAIL_NOT_SUPPORTED
Automated release is availableSAR_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 railSAR_RAIL_DISABLED
Venmo, Cash App, Wise or X Money, and the attempt was created with automated release availableSAR_NOT_AVAILABLE
Payment CREATEDPAYMENT_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.

SituationResponse
Same key, same order, payment, action and txId200 with the existing action's id and current status, even after actions are switched off
Same key, anything else different422 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 attempt409 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.

StatuscodeCause
400A path parameter or the body failed validation. Details in responseObject.fieldErrors
401Missing or invalid API key or dashboard session
403ROLE_NOT_ALLOWEDDashboard session without the Owner or Manager role
403SANDBOX_NOT_SUPPORTEDSandbox key
403ACTION_DENIEDYour plan doesn't allow this action. Contact support
404The order is not yours, or the payment is not on it
409ACTION_IN_PROGRESSA live action of the same kind exists; actionId is its id
409ACTIVE_PAYMENT_LIMIT_REACHEDRecreate only. The recreate would exceed your active payment limits; message says which one
409EXTENSION_LIMIT_REACHEDExtend 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.
422PAYMENT_NOT_ELIGIBLEreason is one of the reason codes listed under the action
422IDEMPOTENCY_KEY_MISMATCHThe key was already used for a different request
429Per-merchant or global rate limit exceeded
502SUPPORT_UNAVAILABLEPeer 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
503FEATURE_DISABLEDActions 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;
};
StatusMeaning
PENDING_APPROVALWaiting for approval by Peer, for up to 15 minutes
QUEUEDAccepted, not started
RUNNINGIn progress. A fulfil can stay here up to 30 minutes while its transaction is pending
SUCCEEDEDDone. result is set
BLOCKEDNever ran: rejected (APPROVAL_REJECTED), not approved in time (APPROVAL_EXPIRED), or cancelled by Peer (ACTION_CANCELED)
FAILEDRan 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.

CodeActionsMeaning
NEEDS_MANUAL_REVIEWallThe action needs manual review. Peer support will follow up
APPROVAL_REJECTED, APPROVAL_EXPIRED, ACTION_CANCELEDallSee BLOCKED above
ACTION_EXPIREDallThe action was not picked up in time
FULFILL_FAILEDfulfilThe settlement transaction failed onchain. A new request retries
FULFILL_TIMEOUTfulfilThe settlement transaction was still pending at the deadline. Check the payment before retrying
INTENT_ALREADY_EXPIRED, PAYMENT_NOT_OPENextendThe attempt expired or settled before the extension ran. Reread the payment; recreate only if it closed unpaid
FIVE_DAY_LIFETIME_EXCEEDEDextendThe attempt has reached its 5-day lifetime
UNSUPPORTED_INTENT_GUARDIANextendThis attempt can't be extended
INSUFFICIENT_EXTENSION_TOKEN_BALANCEextendExtensions are temporarily unavailable on Peer's side. Retry later
INTENT_EXTENSION_TRANSACTION_REVERTEDextendThe extension transaction reverted. A new request retries
INTENT_NOT_LIVErecreateThe reopened attempt was no longer live when checked
DISPATCH_FAILEDrecreateThe reopened attempt could not be started onchain. A new request retries
MERCHANT_WALLET_NOT_DELEGATED, MERCHANT_SIGNING_UNAVAILABLErecreateYour 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_READYrecreateHTTP 503 (retryable). Peer Pay is setting up this merchant's signer. Try again in a minute.
REMEDIATION_FAILEDallAnything else. Contact Peer support with the action id

Errors​

StatusCause
404No such action on a payment of this order
502SUPPORT_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.