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

# Environments and authentication

> Where to send requests, how to authenticate, and which API version to use.

## Environments

| Environment | API host | Widget host |
| - | - | - |
| Sandbox | `api-sandbox.paychoice.com.au` | `sandbox-spa.paychoice.com.au` |
| Live | `api.paychoice.com.au` | `spa.paychoice.com.au` |

Sandbox and live credentials are separate. Build and test against the sandbox; move to live only once your integration is signed off.

> [!WARNING]
>
> Anything sent to the live environment incurs real fees and charges.

## Authentication

Every API request uses HTTP Basic Authentication over HTTPS, with the API username and password PayChoice issues to you.

```http theme={null}
Authorization: Basic base64(username:password)
```

Your credentials are delivered through a one-time secure link: you receive an email with the link, it prompts for a one-time code, and it expires once the credentials have been viewed.

> [!NOTE]
>
> Keep credentials out of source control and client-side code. The [PayChoice Widget](https://developers.paychoice.com.au/taking-payments/widget.md) and the [Create Token page](https://developers.paychoice.com.au/storing-payment-methods/create-token-page.md) exist so that card and bank details never need to touch your servers.

### Merchant and agency credentials

Most integrators have a **merchant** credential, scoped to one merchant account. Partners who manage several merchants have an **agency** credential, which can act on any of its merchants by passing `merchant_guid` on the request. A few endpoints, noted where they appear, are agency-only.

## API versions

| Version | Request format | `Content-Type` header | Base path |
| - | - | - | - |
| 5 | JSON | `application/json` | `/api/v5/` |
| 4 | form-data | `application/x-www-form-urlencoded` | `/api/v4/` |

Both versions return JSON and accept the same fields. Use v5 for a new integration.

Timestamps are ISO 8601 in UTC. Amounts are decimal strings in the merchant's currency, for example `"10.00"`.

> [!NOTE]
>
> The recurring billing endpoints under [Billing](https://developers.paychoice.com.au/billing/overview.md) use a different response envelope from the payment endpoints, and need an `Accept: application/json` header. Each section's overview describes its own format.

## Next

[Make your first charge](https://developers.paychoice.com.au/getting-started/first-charge.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.