# Test Your Environment

Validate your integration before going live.

Use [Sandbox](/products/deluxe-payment-network/developer-resources/sandbox-testing) (XUAT) to test your integration without affecting live payment operations. This guide helps you validate payment submission, track processing status, verify fulfillment workflows, and confirm that your application can support production payment processing requirements.

Before moving to production, use Sandbox to confirm that your integration can successfully support the core workflows required throughout the payment lifecycle.

Don't have credentials yet? Complete [onboarding](/products/deluxe-payment-network/build-with-deluxe/get-started) before continuing with implementation.

### Verify Your Integration

Use the following workflow to validate your implementation in the Sandbox (XUAT) environment.

The Sandbox payment testing workflow shows how to authenticate with the Sandbox environment, submit a test payment file, monitor file processing and validation, and retrieve payment-level status and acknowledgements.

**Generate Access Token**
Obtain an access token for Sandbox (XUAT) API requests.

**Upload Payment File**
Submit a test payment file for processing.

**Retrieve File Status**
Monitor file processing progress and validation outcomes.

**Retrieve Payment Status**
Retrieve payment-level status and acknowledgements.

#### 1 Upload a Payment File

After generating an access token, submit a valid CSV payment file using the Payment File Upload API.

##### Request

```bash
curl --request POST \
  --url 'https://stage.dcip.deluxe.com/payables/dpxn/v1/payment-files' \
  --header 'Authorization: Bearer <access-token>' \
  --header 'businessPartner: <business-partner-name>' \
  --form 'attachment=@ExampleOfFileForBusinessNamePayments.csv;type=text/csv'
```

##### Example Response

```json
{
  "businessPartner": "client_name",
  "fileName": "ExampleOfFileForclient_namePayments.csv",
  "status": "success",
  "GUID": {
    "trackingNumbers": [
      "a9670553fe3173a4a35b673e8e24c6a8"
    ]
  },
  "uploadDTM": "2023-10-17 21:10:52"
}
```

Save the returned tracking number (File GUID). You'll use this identifier when retrieving file status and payment status information.

Expected outcome:

- Payment file accepted
- Tracking number returned
- No validation errors


#### 2 Retrieve File Status

Use the tracking number returned during file submission to verify that Payment Network accepted and processed the file.

##### Request

```bash
curl --location --request GET \
  'https://stage.dcip.deluxe.com/payables/dpxn/v1/payment-files/a9670553fe3173a4a35b673e8e24c6a8' \
  --header 'businessPartner: <business-partner-name>' \
  --header 'Authorization: Bearer <access-token>'
```

Expected outcome:

- File status information is returned
- Processing progress is available
- The file can be retrieved using the tracking number


#### 3 Retrieve Payment Status

Retrieve payment-level information associated with the submitted file.

##### Request

```bash
curl --location --request GET \
  'https://stage.dcip.deluxe.com/payables/dpxn/v1/payment-files/a9670553fe3173a4a35b673e8e24c6a8/payments' \
  --header 'businessPartner: <business-partner-name>' \
  --header 'Authorization: Bearer <access-token>'
```

Expected outcome:

- Payment records are returned
- Payment status information is available
- Status transitions can be monitored


#### 4 Verify Directory Network Connectivity (Optional)

If your implementation uses the Deluxe Directory Network (DDN), verify that you can retrieve lockbox information.

##### Request

```bash
curl 'https://stage.dcip.deluxe.com/payables/ddn/v1/lockbox' \
  --header 'apiKey: <your_api_key>' \
  --header 'Authorization: Bearer <access-token>'
```

Expected outcome:

- Lockbox directory information is returned
- Directory Network credentials are configured correctly