> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.pay4power.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pay4power.com/_mcp/server.

# Authentication (Sandbox)

POST https://p4p-core-bill-payments-service.dev.payinvert.com/api/v2.1/b2b/auth/token
Content-Type: application/json

Reference: https://docs.pay4power.com/entry/authentication-sandbox

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://p4p-core-bill-payments-service.dev.payinvert.com/api/v2.1` (Sandbox, default)
- `https://bills.v2.pay4power.com/api/v2.1` (Live)

## Request

### Body (application/json)

This endpoint expects a map from string to any.

- `map from string to any`

## Response

### 200

- `map from string to any`

## Examples

**Request**

```json
{
  "environment": "TEST",
  "privateKey": "PRIV_KEY_90-HGgp7y3xX-gTIhIAa0B7uFPgY9QPf6YJ1-Ts6n8vFSnQBHFsuc3mu_Sby3c4IZmmujAiSdv_pb9eJd6dNGA",
  "publicKey": "PUB_KEY_ciKm7IHMy3H4VjaHWLZA3lEZf3gV0ioC8t-sfDYV0JY"
}
```

**Response**

```json
{
  "correlationId": "171695d3-af3b-4d61-be14-1ed803ea13fa",
  "data": {
    "expiresAt": 1765638462,
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMSIsIm1lcmNoYW50X2lkIjoiMSIsImJ1c2luZXNzX25hbWUiOiIxMERFWU9OIiwiYnVzaW5lc3NOYW1lIjoiMTBERVlPTiIsIm1lcmNoYW50X25hbWUiOiJNZXJjaGFudF8xIiwiY2F0ZWdvcnkiOiJSZWdpc3RlcmVkQnVzaW5lc3MiLCJ0aWVyIjoiRGlhbW9uZCIsImVudmlyb25tZW50IjoiVEVTVCIsInB1YmxpY19rZXkiOiJXWmJzdTJnTUJMNGpfWFMzWDRHTVJVMHdfU0djVzh3SUFuWnk0SjZUYkFvIiwianRpIjoiM2NmMjY4NTItNzU0NS00YjE5LThlYTktZDM2YmQxYzZiMTE0IiwiaWF0IjoxNzY1NjM0ODYyLCJuYmYiOjE3NjU2MzQ4NjIsImV4cCI6MTc2NTYzODQ2MiwiaXNzIjoiQklMTFBBWU1FTlRTRVJWSUNFX01FUkNIQU5UX0lTU1VFUiIsImF1ZCI6IkJJTExQQVlNRU5UU0VSVklDRV9NRVJDSEFOVF9BVURJRU5DRSJ9.Y-EQquNmAU7NBDmhRWkU9efXg19aGuiM7qG3krcuGVY",
    "tokenType": "Bearer"
  },
  "errors": null,
  "message": "Token generated successfully.",
  "statusCode": 200,
  "success": true
}
```