Plexy
Pay API
Gate APISDKDashboard
Pay API
Gate APISDKDashboard
  1. Server Integration
  • Overview
  • Authorization
  • Webhooks
  • API Errors
  • Test Scenarios
  • Ecommerce Plugins
  • API
    • Payments
      • Overview
      • Transaction Errors
      • Payment Links
        • Create Payment Link
        • List Payment Links
        • Retrieve Payment Link by Order Reference
        • Cancel Payment Link
        • Retrieve Payment Link
        • Update Payment Link Expiration
        • Retrieve Payment Links Statistics
      • Reccurent Payments
        • Create Merchant-Initiated Payment
      • Direct Payments
        • Get Keys
        • Create Host-to-Host Payment
      • Transaction Management
        • Find Transaction's History by ID
        • Find Transaction by Payment Link ID
        • Find Transaction by ID
        • Find Transaction by Order reference
      • Payment Management
        • Cancel Payment
        • Capture Payment
        • Process Refund
      • Split Requests
        • Create
        • List
        • Update
        • Get By Id
        • Delete
    • Payouts
      • Retrieve Payout Transactions
      • Process Payout
      • Save Card for Payouts
    • Customers
      • Get Customer's Card Tokens
      • List Customers
      • Create Customer
      • Get Customer by ID
      • Get Customer's Transactions
    • Merchants
      • Payment Beneficiary
        • Create
        • Update
        • Gey By Id
        • List
        • Transfer from beneficiary balance to merchant balance
        • Create manual settlement for beneficiary
      • Retrieve Merchant's Details
    • Wallet
      • Authorize
      • Сapture
      • Refund
      • Cancel
    • Payment Methods
      • Google Pay™ Integration
    • Invoice
      • List Bank Invoices
      • Create Bank Invoice
      • Get Bank Invoice
    • Distributions
      • Create distribution
      • List distributions
      • Get distribution by ID
      • Get distributions balance
  • Client SDK
    • SDK Overview
    • Wallet
      • Apple Pay
      • Google Pay
    • Android
      • Android Components
      • Android SDK
      • Android Drop-in
      • Android Customization
    • React Native
      • React Native SDK
    • Flutter
      • Flutter SDK
    • iOS
      • iOS Components
      • iOS Drop-in
      • iOS Customization
      • iOS SDK
    • Server Integration
      • Overview
      • Sessions Flow
      • Advanced Flow
      • Authentication
      • Result Codes and Errors
      • Payment Methods and Checkout Settings
      • Test and Live Payments
      • API Reference
      • Payment Methods
        • Get a list of available payment methods
      • Payments
        • Start a transaction
        • Submit details for a payment
      • Sessions
        • Create a payment session
        • Get the result of a payment session
    • Web
      • Web SDK
      • Web Customization
      • Web Drop-in
      • Web Components
  • Schemas
    • Schemas
      • response.TransactionList
      • entity.SplitRequest
      • entity.PaymentBeneficiary
      • request.CreatePaymentBeneficiary
      • entity.SettlementPaymentOrder
      • entity.PayoutRequest
      • entity.PayoutRequestRowData
      • entity.UserProfile Copy
      • entity.Store
      • request.AssignStoreToUser
      • request.RemoveStoreFromUser
      • entity.AccountExternalSystem
      • response.AssignStoreToUser
      • request.CreateStore
      • response.Store
      • response.UserList
      • request.WalletAuthorizeRequest
      • entity.ShortWalletTransaction
      • response.WalletAuthorizeResponse
      • request.WalletCapture
      • response.RemoveStoreFromUser
      • command.HandleThreeDResult
      • domain.Report
      • entity.CardSaveSessionCustomer
      • entity.Permission
      • entity.UserProfile
      • entity.UserRole
      • git_plexypay_com_ecom_back_api_internal_domain_view.Page-domain_Report
      • git_plexypay_com_ecom_back_api_internal_domain_view.Page-entity_UserProfile
      • models.CSVApiRequest
      • models.CreateBussinessDetails
      • models.KeyResponse
      • models.OnboardingRequest
      • models.Transaction
      • paymentcore.Address
      • paymentcore.CustomerDetails
      • request.AuthorizePayment
      • request.BrowserDetails
      • request.CardData
      • request.ChangeUserRole
      • request.ContinueThreeDS
      • request.CreateCardSaveSession
      • request.CreateInviteSession
      • request.CreatePaymentLink
      • request.CreatePaymentLinkMetadata
      • request.HandlePayout
      • request.MerchantInitiatedPayment
      • request.PasswordRequest
      • request.Recurring
      • request.RefundPayment
      • request.SaveCard
      • request.SaveOneCustomer
      • request.TwoStepAuthorizePayment
      • request.UpdateMerchantSettingsRequest
      • request.UpdatePaymentLink
      • response.AcquirerResponseThreeDSecure
      • response.AuthorizeAndCapturePayment
      • response.AuthorizePayment
      • response.CancelPaymentResponse
      • response.CapturePaymentResponse
      • response.ContinueThreeDS
      • response.Currency
      • response.Customer
      • response.CustomerTransaction
      • response.CustomerTransactions
      • response.Customers
      • response.Merchant
      • response.MerchantInitiatedPayment
      • response.MerchantSettings
      • response.PaymentLink
      • response.PaymentLinkInfo
      • response.PaymentLinkMetadata
      • response.PaymentLinksInfo
      • response.PaymentLinksStatistics
      • response.PaymentLinksStatisticsItem
      • response.Payout
      • response.Permission
      • response.RefundPaymentResponse
      • response.Report
      • response.SavedCard
      • response.Session
      • response.Settlement
      • response.SettlementTransaction
      • response.Store
      • response.Stores
      • response.Transaction
      • response.TransactionDetails
      • response.TransactionEvents
      • response.TransactionHistoryEvent
      • response.TransactionHistoryEventData
      • response.TransactionResponse
      • response.TransactionWebhookDetails
      • response.Transactions
      • response.UpdateMerchantSettingsResponse
      • response.UserProfile
      • value.PaymentMethod
    • receipt
    • Error
    • response.BankInvoice
    • DistributionStatus
    • LivenessResponse
    • DecimalAmount
    • errors.Source
    • Currency
    • AmountDto
    • ProductType
    • errors.Message
    • DistributionRecipient
    • PaymentMethodsRequestDto
    • ProductCategory
    • request.CreateBankInvoice
    • DistributionCreateRequest
    • PaymentMethodDto
    • Product
    • git_plexypay_com_ecom_back_api_internal_platform_errors.Code
    • DistributionBase
    • StoredPaymentMethodDto
    • response.Error
    • Order
    • DistributionCreatedResponse
    • PaymentMethodsResponseDto
    • AgentBalance
    • response.BankInvoiceList
    • DistributionDetailResponse
    • CreatePaymentDto
    • AgentDeposit
    • errors.Type
    • DistributionListItem
    • AdditionalDataDto
    • TopupRequest
    • DistributionListResponse
    • ActionDto
    • CreateOrderRequest
    • DistributionBalanceResponse
    • CreatePaymentResponseDto
    • PaymentDetailsDto
    • PaymentDetailsRequestDto
    • PaymentActionDto
    • FraudResultDto
    • ResponsePaymentMethodDto
    • PaymentDetailsResponseDto
    • ApplePayMerchantValidationRequestDto
    • ApplePayMerchantSessionResponseDto
    • ApplePaySessionRequestDto
    • ApplePaySessionResponseDto
    • GooglePayDecodeRequestDto
    • GooglePayPaymentMethodDetails
    • GooglePayDecryptedData
    • GooglePayDecodeSuccessResponseDto
    • RiskDataDto
    • GooglePayPaymentMethodDto
    • BrowserInfoDto
    • GooglePayPaymentRequestDto
    • EncryptedCardDataDto
    • GooglePayPaymentResponseDto
    • GooglePayPaymentErrorResponseDto
    • LineItemDto
    • AddressDto
    • CreateCheckoutSessionRequestDto
    • CreateCheckoutSessionResponseDto
    • PaymentDto
    • SessionResultResponseDto
    • EncryptedSessionDataDto
    • DecryptPaymentRequestDto
    • DecryptPaymentResponseDto
    • ThreeDSDetailsDto
    • SessionPaymentDetailsRequestDto
    • SessionPaymentDetailsResponseDto
    • CardDetailsRequestDto
    • CardBrandDetailsDto
    • CardDetailsResponseDto
    • PublicKeyResponseDto
  1. Server Integration

Result Codes and Errors

Result Codes#

When you make a payment request, Plexy returns a resultCode that indicates the outcome. Understanding these codes is essential for providing a good customer experience and correctly handling payment states.

Quick Reference#

Result CodeMeaningAction Required
AuthorisedPayment successfulFulfill the order
RefusedPayment declinedShow decline message
PendingAwaiting final resultWait for webhook
ReceivedPayment initiatedWait for webhook
ErrorTechnical errorRetry or investigate
CancelledCustomer cancelledReturn to checkout
RedirectShopperRedirect requiredRedirect the customer
IdentifyShopper3DS device fingerprintPerform 3DS fingerprint
ChallengeShopper3DS challenge requiredShow 3DS challenge
PresentToShopperShow voucher/QRDisplay payment info

Successful Payment#

Authorised#

The payment was successfully authorized. The funds have been reserved on the customer's account (or captured, depending on your configuration).
What to do:
Mark the order as paid
Trigger order fulfillment (shipping, access, etc.)
Send confirmation email to customer
Info
If you have separate authorization and capture, the payment is only reserved. You'll need to capture it later to receive the funds.

Declined Payments#

Refused#

The payment was declined by the card issuer, payment provider, or Plexy's risk system.
What to do:
Display a customer-friendly message
Suggest trying a different payment method
Do not store the card details for retry
Common Refusal Reason Codes#
CodeReasonCustomer Message
2RefusedTry a different payment method
3ReferralContact bank for approval
4Acquirer ErrorTechnical issue, retry later
5Blocked CardCard is blocked by issuer
6Expired CardCard has expired
7Invalid AmountAmount issue, contact support
8Invalid Card NumberCheck card number
9Issuer UnavailableBank unavailable, retry later
10Not SupportedCard type not accepted
113D Secure FailedAuthentication failed
12Not Enough BalanceInsufficient funds
14FraudPayment declined
15CancelledCustomer cancelled
16Shopper CancelledCustomer cancelled
17Invalid PinIncorrect PIN
20Fraud - RiskDeclined by risk system
21Not SubmittedProcessing error
22Fraud - CVVCVV check failed
23Transaction Not PermittedNot allowed for this card
24CVC DeclinedCVV check failed
25Restricted CardCard restricted
26RevocationAuthorization revoked
27Declined Non-GenericContact bank
28Withdrawal Amount ExceededOver withdrawal limit
29Withdrawal Count ExceededToo many withdrawals
31Fraud - RawFraud detected
32AVS DeclinedAddress verification failed
33Card requires online PINOnline PIN required
34No checking accountAccount not found
35No savings accountAccount not found
36Mobile PIN requiredPIN required
37Contactless fallbackUse chip instead
38Authentication requiredAdditional auth needed

Cancelled#

The customer cancelled the payment before completion. This typically happens when:
Customer clicks "back" or closes the payment page
Customer cancels on a redirect page (e.g., bank authentication)
Session times out
What to do:
Return customer to the cart/checkout page
Keep the order in "pending" state
Allow retry with same or different payment method

Error#

A technical error occurred during payment processing. This could be due to:
Network issues
Service unavailability
Invalid request data
Configuration issues
What to do:
Log the error for investigation
Display a generic error message
Offer retry option
Alert your team if errors persist

Pending States#

Pending#

The payment result is not yet known. This is common for:
Bank transfers
Asynchronous payment methods
Manual review
What to do:
Mark the order as "awaiting payment"
Wait for webhook notification with final result
Show appropriate status to customer
Warning
Never fulfill orders with Pending status until you receive a webhook confirming the payment was successful.

Received#

Similar to Pending, but specifically indicates that Plexy has received the payment request. The final result will come via webhook.
What to do:
Same as Pending
Common for payment methods like Boleto, iDEAL, or bank transfers

Action Required#

These result codes indicate that additional steps are needed to complete the payment.

RedirectShopper#

The customer must be redirected to an external page to complete authentication or authorization (e.g., bank login, payment app).
What to do:
Store relevant state (order ID) for when customer returns
Redirect to the URL in the action object
Handle the return URL callback

IdentifyShopper#

3D Secure 2 device fingerprinting is required. This is the first step of 3DS2 authentication.
What to do:
Use the Plexy 3DS SDK to perform fingerprinting
Submit the result to /v2/payments/details
Handle the next result code

ChallengeShopper#

3D Secure 2 challenge is required. The customer needs to authenticate with their bank (e.g., enter OTP, approve in banking app).
What to do:
Display the 3DS challenge UI
Submit the challenge result to /v2/payments/details

PresentToShopper#

Payment information needs to be shown to the customer (e.g., voucher, QR code, bank transfer details).
What to do:
Display the provided payment information
Wait for webhook notification of payment completion
Some methods have expiration times

Comprehensive Result Handler#

Here's a complete example handling all result codes:
JavaScript
Python

Webhook Event Types#

Each result code maps to webhook events you should handle:
Result CodeWebhook Event
Authorisedpayment.authorised
Refusedpayment.refused
Cancelledpayment.cancelled
Errorpayment.error
Pending → Successpayment.authorised
Pending → Failurepayment.refused or payment.expired
Received → Successpayment.authorised
Received → Failurepayment.refused or payment.expired

Best Practices#

1.
Always verify via webhooks - Don't rely solely on the synchronous response. Webhooks provide the authoritative payment status.
2.
Map to your order states - Create a clear mapping between Plexy result codes and your internal order states.
3.
Log all results - Keep detailed logs of payment results for debugging and support.
4.
Show appropriate messages - Use customer-friendly messages for declines. Avoid exposing raw error codes.
5.
Handle edge cases - Plan for network failures, timeouts, and unexpected result codes.
6.
Verify all scenarios - Simulate different result codes before going live.

Next Steps#

Handle 3D Secure authentication flows
Set up webhooks for reliable notifications
Verify the full payment lifecycle before enabling customer traffic

HTTP Status Codes#

The Plexy API uses standard HTTP status codes to indicate request outcomes.

Success codes#

CodeDescription
200 OKRequest succeeded
201 CreatedResource created successfully
204 No ContentRequest succeeded, no response body

Client error codes#

CodeDescriptionAction
400 Bad RequestInvalid request parametersCheck request body
401 UnauthorizedInvalid or missing API keyVerify API credentials
403 ForbiddenInsufficient permissionsCheck API key permissions
404 Not FoundResource doesn't existVerify resource ID
405 Method Not AllowedInvalid HTTP methodCheck endpoint documentation
409 ConflictIdempotency conflictRequest already processed
422 Unprocessable EntityValid request but cannot processCheck business logic

Server error codes#

CodeDescriptionAction
500 Internal Server ErrorUnexpected server errorRetry with backoff
502 Bad GatewayUpstream service errorRetry with backoff
503 Service UnavailableService temporarily downRetry with backoff
504 Gateway TimeoutRequest timed outRetry with backoff

Handling responses#

Check the HTTP status code of every response. Successful operations return 2xx; errors return 4xx or 5xx with an error object in the body:
Status rangeMeaningAction
2xxSuccessProcess the response
400Bad requestFix request parameters
401UnauthorizedVerify API key
5xxServer errorRetry with exponential backoff

Retry strategy#

For 500, 502, 503, and 504 responses, retry the request with exponential backoff and the same Idempotency-Key:

See also#

Error Codes
API Idempotency

Error Codes#

Understand and handle errors returned by the Plexy API.

Error structure#

{
  "error": {
    "type": "invalid_request_error",
    "code": "parameter_missing",
    "message": "Missing required parameter: amount",
    "param": "amount",
    "request_id": "req_abc123"
  }
}
FieldDescription
typeError category
codeSpecific error code
messageHuman-readable description
paramParameter that caused error (if applicable)
request_idUnique request identifier

Error types#

api_error#

Server-side errors. Usually temporary - retry with backoff.
CodeDescription
api_errorGeneral API error

invalid_request_error#

Client-side request errors. Fix the request and retry.
CodeDescription
parameter_missingRequired parameter not provided
parameter_invalidParameter value is invalid
parameter_unknownUnrecognized parameter
resource_missingReferenced resource doesn't exist
idempotency_errorIdempotency key reused with different params

authentication_error#

API key or authentication problems.
CodeDescription
api_key_invalidInvalid API key
api_key_expiredAPI key has expired
api_key_revokedAPI key was revoked

card_error#

Payment card issues. Display message to customer.
CodeDescription
card_declinedCard was declined
expired_cardCard has expired
incorrect_cvcCVC is incorrect
incorrect_numberCard number is incorrect
insufficient_fundsCard has insufficient funds
processing_errorError processing card

Handling errors#

The API always returns an error object in the response body for non-2xx responses. Check the HTTP status code first, then inspect error.type and error.code:
Example error response:
{
  "error": {
    "type": "card_error",
    "code": "card_declined",
    "message": "Your card was declined.",
    "request_id": "req_abc123"
  }
}
HTTP statuserror.typeAction
402card_errorShow error.message to the customer
400invalid_request_errorFix the request parameters
401authentication_errorCheck your API key configuration
500–503api_errorRetry with exponential backoff

Customer-facing messages#

Map error codes to user-friendly messages:
CodeCustomer Message
card_declined"Your card was declined. Please try a different card."
expired_card"Your card has expired. Please use a valid card."
incorrect_cvc"The security code is incorrect. Please check and try again."
insufficient_funds"Your card has insufficient funds. Please try a different card."
processing_error"An error occurred processing your card. Please try again."

See also#

Refusal Reasons
HTTP Status Codes

Refusal Reasons#

When a payment is declined, the response includes a decline code indicating the reason.

Common decline codes#

CodeDescriptionRecoverable
generic_declineCard declined for unspecified reasonMaybe
insufficient_fundsNot enough funds availableYes
lost_cardCard reported lostNo
stolen_cardCard reported stolenNo
expired_cardCard has expiredNo
incorrect_cvcCVC verification failedYes
incorrect_numberCard number is incorrectYes
processing_errorProcessing error occurredYes
do_not_honorIssuer declined without reasonMaybe
pickup_cardCard should be retainedNo

Decline response#

{
  "id": "pay_abc123",
  "status": "failed",
  "failure_code": "insufficient_funds",
  "failure_message": "The card has insufficient funds.",
  "outcome": {
    "type": "issuer_declined",
    "reason": "insufficient_funds",
    "ripr_level": "normal",
    "seller_message": "The card has insufficient funds to complete the purchase."
  }
}

Handling declines#

Recoverable declines#

For recoverable errors, prompt the customer to:
Use a different payment method
Enter correct card details
Contact their bank

Non-recoverable declines#

For permanent declines, advise the customer to use a different payment method:

Customer messaging#

Decline CodeRecommended Message
generic_decline"Your payment was declined. Please try a different card or contact your bank."
insufficient_funds"Your card has insufficient funds. Please try a different card."
lost_card"This card cannot be used. Please use a different payment method."
expired_card"Your card has expired. Please update your card details."
incorrect_cvc"The security code is incorrect. Please check and try again."
incorrect_number"The card number is incorrect. Please check and try again."
do_not_honor"Your bank declined the payment. Please contact your bank or try a different card."

Retry recommendations#

CategoryAction
Card details wrongLet customer retry with correct details
Insufficient fundsSuggest different card
Fraud-relatedDon't retry, suggest different method
Bank declinedSuggest contacting bank

Reduce declines#

1.
Collect complete billing address - Improves AVS matching
2.
Request CVC - Reduces fraud declines
3.
Use 3D Secure - Shifts liability, improves approval
4.
Update stored cards - Use Account Updater for subscriptions

See also#

Error Codes
Modified at 2026-07-07 10:25:45
Previous
Authentication
Next
Payment Methods and Checkout Settings
Built with