# Testing
source: https://developer.mastercard.com/bill-payment-validator/documentation/testing/index.md

This page is the single testing hub for the Bill Payment Validator API. It covers the recommended testing workflow, sandbox test data for positive and negative scenarios, tool options, and how to interpret results.

## Testing Overview {#testing-overview}

|           Tool            |               Best For               |                                                          Guide                                                          |
|---------------------------|--------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
| Postman                   | Manual exploration, one-off calls    | [Postman Collection](https://developer.mastercard.com/bill-payment-validator/documentation/postman-collection/index.md) |
| SDK Code Sample           | Automated testing, CI/CD integration | [SDK Reference](https://developer.mastercard.com/bill-payment-validator/documentation/sdk-reference/index.md)           |
| Direct curl / HTTP client | Scripted or command-line testing     | [Quick Start Guide](https://developer.mastercard.com/bill-payment-validator/documentation/getting-started/index.md)     |

**Auth prerequisite:** All sandbox calls require **OAuth 1.0a** authentication. See [API Basics](https://developer.mastercard.com/bill-payment-validator/documentation/api-basics/index.md) for credential setup.

**Sandbox URL:** `https://sandbox.api.mastercard.com/billpayAPI/v1/isRoutingValid`

## Recommended Testing Workflow {#recommended-testing-workflow}

Follow these steps for a complete Bill Payment Validator test cycle:

1. **Set up your project** --- Create a Mastercard Developers project and download your Sandbox Consumer Key and `.p12` Signing Key (see [Quick Start Guide](https://developer.mastercard.com/bill-payment-validator/documentation/getting-started/index.md))
2. **Configure OAuth 1.0a** --- Set up the Mastercard OAuth library with your Consumer Key, `.p12` file, key alias, and key password (see [API Basics](https://developer.mastercard.com/bill-payment-validator/documentation/api-basics/index.md))
3. **Choose your testing tool** --- Postman for manual testing or the SDK sample for code-based testing
4. **Run a positive test** --- Submit the successful validation scenario from the table below; verify `"ResponseString": "Successful"`
5. **Run negative tests** --- Submit error scenarios from the table below; verify the expected `ResponseString` for each
6. **Resolve failures** --- Use [Code and Formats](https://developer.mastercard.com/bill-payment-validator/documentation/code-and-formats/index.md) to interpret error codes and fix request data

## Single-Endpoint Test: POST /isRoutingValid {#single-endpoint-test-post-isroutingvalid}

Bill Payment Validator has a single endpoint. A complete test cycle for this endpoint is:

1. **Positive test** --- Submit valid RPPS credentials; expect `"ResponseString": "Successful"` with HTTP 200
2. **Negative test (RPPSID validation)** --- Submit an invalid or missing RPPSID; expect the corresponding error `ResponseString`
3. **Negative test (BillerID validation)** --- Submit an invalid or inactive BillerID; expect the corresponding error `ResponseString`
4. **Negative test (AccountNumber validation)** --- Submit an account number that fails masking or check digit; expect the corresponding error `ResponseString`
5. **Negative test (Amount validation)** --- Submit a transaction amount exceeding the biller limit; expect `"Transaction Amount exceeds BillerID maximum"`

## Positive Testing {#positive-testing}

|     Test Scenario     |  RppsId  |  BillerId  | AccountNumber | TransactionAmount | Expected ResponseString |
|-----------------------|----------|------------|---------------|-------------------|-------------------------|
| Successful Validation | 99887761 | 9998887771 | 1234567890    | 250.00            | `Successful`            |

**What success looks like:** HTTP 200 response with `"ResponseString": "Successful"`. The response body echoes all submitted fields plus the `ResponseString`.

```json
{
  "BillPayAccountValidation": {
    "RppsId": "99887761",
    "BillerId": "9998887771",
    "AccountNumber": "1234567890",
    "TransactionAmount": "250.00",
    "ResponseString": "Successful"
  }
}
```

## Negative Testing {#negative-testing}

Each scenario below triggers a specific validation failure. The `ResponseString` in the HTTP 200 response will contain the error description instead of `"Successful"`.

|          Test Scenario          |  RppsId   |  BillerId  |      AccountNumber      | TransactionAmount |                    Expected ResponseString                     | Error Code |
|---------------------------------|-----------|------------|-------------------------|-------------------|----------------------------------------------------------------|------------|
| RPPSID Required                 | *(empty)* | 9998887771 | 1234567890              | 250.00            | `RPPSID is required`                                           | OA001      |
| Invalid RPPSID                  | 00000000  | 9998887770 | 1234567890              | 250.00            | `Invalid RPPSID`                                               | OA012      |
| Inactive RPPSID                 | 99887760  | 9998887770 | 1234567890              | 250.00            | `RPPSID is not active`                                         | OA013      |
| RPPSID is Not an Originator     | 99887762  | 9998887770 | 1234567890              | 250.00            | `RPPSID is not an Originator`                                  | OA008      |
| No Access to Biller             | 99887761  | 9998887770 | 1234567890              | 250.00            | `RPPSID does not have access to BillerID`                      | OA009      |
| BillerID Required               | 99887761  | *(empty)*  | 1234567890              | 250.00            | `BillerID is required`                                         | OA002      |
| Invalid BillerID                | 99887761  | 0000000000 | 1234567890              | 250.00            | `Invalid BillerID`                                             | OA010      |
| Inactive BillerID               | 99887761  | 9998887772 | 1234567890              | 250.00            | `BillerID is not active`                                       | OA011      |
| Invalid Account --- Masking     | 99887761  | 9998887771 | 12345                   | 250.00            | `Account Number did not match BillerID masks`                  | OA004      |
| Invalid Account --- Check Digit | 99887761  | 9998887771 | 1234567891              | 250.00            | `Account Number failed on a check digit`                       | OA005      |
| Invalid Account Length          | 99887761  | 9998887771 | 12345678901234567890123 | 250.00            | `Invalid Account Number`                                       | OA019      |
| BillerID Won't Accept Account   | 99887761  | 9998887773 | 1234567890              | 250.00            | `BillerID will not accept transactions for the Account Number` | OA018      |
| Exceeds Transaction Amount      | 99887761  | 9998887771 | 1234567890              | 5000.00           | `Transaction Amount exceeds BillerID maximum`                  | OA017      |

For error code meanings, step-by-step resolution guidance, and gateway-layer error codes (4xx/5xx), see [Code and Formats](https://developer.mastercard.com/bill-payment-validator/documentation/code-and-formats/index.md).

## Multi-Step Scenario: Bill Payment Flow (Use Case 4) {#multi-step-scenario-bill-payment-flow-use-case-4}

This scenario exercises the full bill payment validation flow:

1. **Validate before payment** --- call `POST /isRoutingValid` with the consumer's biller and account details
2. **Interpret the result** --- check `ResponseString`:
   * `"Successful"` → proceed to submit the payment transaction in the RPPS batch file
   * Any other value → look up the error in [Code and Formats](https://developer.mastercard.com/bill-payment-validator/documentation/code-and-formats/index.md), correct the request, and re-validate
3. **Test error recovery** --- submit an intentional error (e.g., Exceeds Transaction Amount) and verify your application handles the non-`"Successful"` response correctly

## Next Steps {#next-steps}

* [Code and Formats](https://developer.mastercard.com/bill-payment-validator/documentation/code-and-formats/index.md) --- full error code table with resolution steps
* [Postman Collection](https://developer.mastercard.com/bill-payment-validator/documentation/postman-collection/index.md) --- run tests interactively in Postman
* [SDK Reference](https://developer.mastercard.com/bill-payment-validator/documentation/sdk-reference/index.md) --- integrate testing into your application code
* [API Reference](https://developer.mastercard.com/bill-payment-validator/documentation/api-reference/index.md) --- OpenAPI specification for all request/response fields
