Skip to main content

API Reference

Complete reference for all Prism API services, request/response types, and error handling.

Overview

Prism provides a unified gRPC API for payment processing across 100+ payment processors. The API is organized into services that handle different aspects of the payment lifecycle.

Services

ServiceDescriptionKey Operations
Payment ServiceCore payment lifecycleAuthorize, Capture, Void, Refund, CreateOrder
Refund ServiceRefund operationsGet refund status
Recurring Payment ServiceStored payment methodsCharge, Revoke mandate
Dispute ServiceChargeback handlingAccept, Defend, SubmitEvidence
Event ServiceWebhook processingHandle connector events
Customer ServiceCustomer managementCreate customer
Payment Method ServicePayment method storageTokenize
Payment Method Authentication Service3DS authenticationPre-authenticate, Authenticate, Post-authenticate
Merchant Authentication ServiceSession managementCreateAccessToken, CreateSessionToken, CreateSdkSessionToken

Error Object

All API errors return a structured ErrorInfo object with detailed information about what went wrong.

ErrorInfo Fields

FieldTypeDescription
unified_detailsUnifiedErrorDetailsMachine-readable unified error code and user-facing message
issuer_detailsIssuerErrorDetailsCard issuer-specific error information (scheme, network details)
connector_detailsConnectorErrorDetailsConnector-specific error code and message from the PSP

UnifiedErrorDetails Fields

FieldTypeDescription
codestringMachine-readable error code (e.g., INSUFFICIENT_FUNDS)
messagestringHuman-readable error message
descriptionstringDetailed explanation of the error
user_guidance_messagestringUser-facing message with guidance on next steps

IssuerErrorDetails Fields

FieldTypeDescription
codestringCard scheme code (e.g., VISA, MASTERCARD)
messagestringHuman-readable message from the issuer
network_detailsNetworkErrorDetailsNetwork-specific error details (advice code, decline code)

NetworkErrorDetails Fields

FieldTypeDescription
advice_codestringNetwork advice code for retry logic
decline_codestringCard scheme decline code
error_messagestringNetwork-specific error details

ConnectorErrorDetails Fields

FieldTypeDescription
codestringConnector-specific error code (e.g., Stripe's card_declined)
messagestringHuman-readable message from the connector
reasonstringDetailed explanation of why the error occurred

Error Response Example

{
"error": {
"unified_details": {
"code": "INSUFFICIENT_FUNDS",
"message": "Your card has insufficient funds.",
"description": "The payment was declined because the card does not have sufficient available credit or balance to complete the transaction.",
"user_guidance_message": "Please try a different payment method or contact your bank."
},
"connector_details": {
"code": "card_declined",
"message": "Your card was declined.",
"reason": "insufficient_funds"
},
"issuer_details": {
"code": "VISA",
"message": "Decline",
"network_details": {
"advice_code": "01",
"decline_code": "51",
"error_message": "Insufficient funds"
}
}
}
}

Domain Schema

See Domain Schema for complete documentation of all data types, enums, and structures used across the API.

Proto Files

The API is defined in Protocol Buffer files located at:

  • backend/grpc-api-types/proto/payment.proto - Core payment types and errors
  • backend/grpc-api-types/proto/sdk_config.proto - SDK and network error types
  • backend/grpc-api-types/proto/services.proto - Service definitions