Canonical error object
All error responses follow this structure.Field descriptions
| Field | Type | Description |
|---|---|---|
name | string | Stable error code, for example, INVALID_REQUEST, AUTHENTICATION_FAILURE. |
message | string | Human-readable summary of the error. |
debug_id | string | Unique request identifier for support diagnostics. |
details | array | Field-level validation errors for 4xx responses. |
details[].field | string | JSON path to the problematic field. |
details[].issue | string | Specific validation issue, for example, INVALID_FORMAT, REQUIRED_FIELD. |
details[].description | string | Resolution guidance. |
links | array | Links to documentation or support resources. |
Error taxonomy
The following table lists all error codes, their HTTP status, and whether the request can be retried.| Status | Error code | Description | Retryable |
|---|---|---|---|
400 | INVALID_REQUEST | Malformed request body, missing required fields, or invalid field values. | No |
401 | AUTHENTICATION_FAILURE | Invalid or missing access token. The token may have expired. | Yes, after refreshing the token. |
403 | AUTHORIZATION_FAILURE | Valid token, but insufficient permissions for this operation. | No |
404 | NOT_FOUND | Invoice, template, or resource doesn’t exist. | No |
409 | CONFLICT | Operation conflicts with the current resource state, for example, invoice already sent or recipient changed twice in 72 hours. | No |
422 | UNPROCESSABLE_ENTITY | Request is well-formed but violates business rules, for example, payment amount exceeds invoice total. | No |
429 | RATE_LIMIT_EXCEEDED | Too many requests in the time window. | Yes, with exponential backoff. |
500 | INTERNAL_ERROR | Unexpected server error. | Yes, with exponential backoff. |
502 | TEMPORARILY_UNAVAILABLE | Service temporarily unavailable. | Yes, with exponential backoff. |
503 | SYSTEM_ERROR | Scheduled maintenance or service degradation. | Yes, with exponential backoff. Check the status page. |
Common error scenarios
The following scenarios show common errors and how to resolve them.Create an invoice with an invalid merchant account
Record a payment on a PayPal-processed invoice
If you try to record a payment on an invoice that PayPal has already processed, you receive the following error.GET. If the status is already PAID or PARTIALLY_PAID, PayPal automatically records the payment. Use the record payment endpoint only for offline payments received through channels other than PayPal.
Client handling guidance
The following guidance covers how to handle different error types in your integration.Retryable errors
For5xx and 429 errors, implement exponential backoff with jitter.
Non-retryable errors
For4xx errors other than 401 and 429, return the error to the user with the debug_id. Don’t retry. Use the details array to provide field-level feedback.
Authentication errors
For401 errors, refresh the access token and retry the request once. If the second attempt also returns 401, return the error to the user.
Alerting guidance
- Log all errors with
debug_idfor troubleshooting. - Alert on
5xxerrors that persist for more than 5 minutes. - Flag
403errors as a configuration issue and review your OAuth scopes. - Track
429patterns to understand API usage and adjust request rates.
Troubleshooting
Find solutions to common integration issues with the PayPal Invoicing API.
Quick start using Invoicing API
Create and send your first invoice using the PayPal Invoicing API.