Skip to content

Transaction States

All transaction types share the same state codes.

State Reference

StateFinalDescription
-1NoNew transaction, not confirmed
0NoPending (processing)
1YesSuccessful
2YesFailed
3YesCancelled
4YesReplaced (manual action by support)
6NoPaused (contact support)

Final vs Non-Final States

Final States

When you receive a final state, the transaction is complete:

  • State 1 (Success) — Transaction completed successfully
  • State 2 (Failed) — Transaction failed, check error field for details
  • State 3 (Cancelled) — Transaction was cancelled
  • State 4 (Replaced) — Transaction was manually replaced by support

Non-Final States

When you receive a non-final state, you must keep polling /transaction/find:

  • State -1 (New) — Transaction reserved but not confirmed yet
  • State 0 (Pending) — Transaction is being processed
  • State 6 (Paused) — Transaction paused due to security reasons

Handling States

Best Practices

  1. Always poll for final state — Never assume a transaction is complete until you receive state 1, 2, 3, or 4.

  2. Handle pending states — If Confirm returns state 0 or 6, immediately start polling Find.

  3. Use exponential backoff — Start with 5-second intervals, increase to 60 seconds for long-pending transactions.

  4. Set timeouts — Don't poll indefinitely. Set a reasonable timeout (e.g., 1 hour) and contact support if exceeded.

  5. Log everything — Keep detailed logs of all responses for troubleshooting.

State Flow Diagram

Error Handling by State

StateAction
-1Call Confirm to proceed
0Poll Find until final state
1Success — display receipt to customer
2Failed — show transaction.error message
3Cancelled — inform customer
4Replaced — contact support for details
6Poll Find, contact support if persists

Paynet API Documentation