Payezydevelopers
Sandbox

Journeys

Failure lab: what goes wrong, and how to recover

Trigger the errors integrations hit most - the tenancy boundary, duplicates, missing scopes, idempotency, limits, screening and a failed payout - and see how each one tells you what to do.

7 stages, about 15 minutes. Run the platform journey first; this one reuses Acme and its key.

Each stage expects an error, and the stage passes when you get it. Read the console's explanation each time: the code is what your code should branch on.

1

Call a customer with your platform credential

Why

The most common platform bug: calling a customer's routes with the platform's own credential. Payezy answers not_found, the same as for an organization you have never heard of, so ids cannot be probed.

Do it

  1. GETList accounts and balances

Done when the call is refused with not_found

What happened

Use a customer key for customer routes, and your platform credential for /v1/platforms/... routes.

2

Create the same customer twice

Why

Imports get retried. Because Acme already has external_ref: acme-001, a second create is refused and tells you the existing customer's id.

Do it

  1. POSTCreate a platform customer

Done when the duplicate is refused

What happened

details.customer_id is the customer you already have. Treat this as success in an import and carry on with that id.

3

Use a key without the scope

Why

Keys get only the scopes you grant, and they cannot change later. Mint a read-only key (no scopes means the read-only set), then try to add a recipient with it.

Do it

  1. POSTMint a customer API key
  2. POSTAdd a recipient

Done when the key is refused for lack of scope

What happened

scope_not_held names the missing scope. Mint a new key with it; do not widen reporting keys.

4

Reuse an Idempotency-Key with a different payment

Why

An Idempotency-Key belongs to one intended payment. The first call succeeds; the second sends the same key with a different amount and is refused.

Do it

  1. POSTSend a payment
  2. POSTSend a payment

Done when the second call is refused

What happened

Generate one key per intended payment and store it with your own record. Retry with the same key and identical body; a changed payment gets a new key.

5

Go over the single-transfer limit

Why

Every organization has single-transfer and daily limits set by Payezy. getPaymentLimits shows them; going over returns a specific code.

Do it

  1. GETGet payment limits
  2. POSTSend a payment

Done when the payment is refused

What happened

Show the limit to the person before they submit. Only Payezy staff can change limits.

6

Pay a blocked recipient

Why

Recipients are screened. In the sandbox a name containing "Blocked" is blocked. Adding it works; paying it does not.

Do it

  1. POSTAdd a recipient
  2. POSTSend a payment

Done when the payment is refused

What happened

Check screening_status when you add a recipient and keep blocked recipients out of your pay flow.

7

Watch a payout fail

Why

Some failures happen after the money leaves - the receiving bank says the account is closed. In the sandbox an account number ending in 0002 fails.

Do it

  1. POSTAdd a recipient
  2. POSTSend a payment
  3. POSTAdvance a sandbox paymentProposed

Done when the payment failed

What happened

payment.updated arrived with status: failed; the reserved 40.40 USD went back to the available balance. getPayment shows failure with the reason to show your customer.

✓

Finished

You have seen the errors that cause most integration support tickets, and how each one tells you what to do. The error reference lists every code.