> ## Documentation Index
> Fetch the complete documentation index at: https://developer.starpayethiopia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Error Codes

> Comprehensive guide to StarPay API error codes and error response handling.

## Overview

The StarPay API uses standard HTTP status codes together with application-specific error codes to indicate why a request failed. Each error includes a unique code that helps you quickly identify and resolve issues during integration.

***

## Error Reference

| HTTP Status | Error Code | Message                                                                                          |
| ----------- | ---------- | ------------------------------------------------------------------------------------------------ |
| 404         | TRDP\_001  | Merchant not found.                                                                              |
| 404         | TRDP\_002  | Payment not found.                                                                               |
| 400         | TRDP\_014  | USD card payment is not enabled for this merchant. Please contact support to enable usd payment. |
| 400         | TRDP\_003  | Failed to create payment order transaction.                                                      |

<Tip>
  **Best Practice:** Each error code represents a specific failure condition. Avoid reusing the same error code for different errors—this makes troubleshooting much easier for merchants integrating with your API.
</Tip>

***

## Error Response Format

All error responses follow a consistent structure for predictable error handling:

```json theme={null}
{
  "error": {
    "code": "TRDP_003",
    "message": "Failed to create payment order transaction."
  }
}
```

***

## Error Response Examples

<AccordionGroup>
  <Accordion title="404 - Merchant Not Found" icon="building">
    When the merchant account cannot be located.

    ```http theme={null}
    HTTP/1.1 404 Not Found
    ```

    ```json theme={null}
    {
      "error": {
        "code": "TRDP_001",
        "message": "Merchant not found."
      }
    }
    ```
  </Accordion>

  <Accordion title="404 - Payment Not Found" icon="search">
    When the payment record cannot be found in the system.

    ```http theme={null}
    HTTP/1.1 404 Not Found
    ```

    ```json theme={null}
    {
      "error": {
        "code": "TRDP_002",
        "message": "Payment not found."
      }
    }
    ```
  </Accordion>

  <Accordion title="400 - USD Payment Not Enabled" icon="credit-card">
    When USD payment processing has not been enabled for the merchant account.

    ```http theme={null}
    HTTP/1.1 400 Bad Request
    ```

    ```json theme={null}
    {
      "error": {
        "code": "TRDP_014",
        "message": "USD card payment is not enabled for this merchant. Please contact support to enable usd payment."
      }
    }
    ```
  </Accordion>
</AccordionGroup>

***

## Common Error Codes Reference

| Error Code | Meaning                 | Resolution                                                                                                                    |
| ---------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| TRDP\_001  | Merchant not found      | Verify that your merchant ID is correct and your account is active.                                                           |
| TRDP\_002  | Payment not found       | Check that the payment ID is valid and corresponds to an existing transaction.                                                |
| TRDP\_003  | Order creation failed   | Review the payment request parameters and ensure all required fields are valid.                                               |
| TRDP\_014  | USD payment not enabled | Contact support at [support@starpayethiopia.com](mailto:support@starpayethiopia.com) to enable USD payments for your account. |
