> 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

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

Generates an access token for the Bill Payment API using your public and private keys. Use the returned token to authorize subsequent requests.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /test/v2.1/b2b/auth/token:
    post:
      operationId: authentication
      summary: Authentication
      description: >-
        Generates an access token for the Bill Payment API using your public and
        private keys. Use the returned token to authorize subsequent requests.
      tags:
        - subpackage_entry
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Response with status 200
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
servers:
  - url: https://p4p-core-bill-payments-service.dev.payinvert.com/api/v2.1/b2b
    description: Default
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples

**Request**

```json
{
  "publicKey": "PUB_KEY_-PCoN5pTvGLHJQdR0etNzu2I0VuqFHsGIVzmeAEB_n8",
  "privateKey": "PRIV_KEY_o7haFGpqsMusdRpnG93CZi862XEXBGUesT4L3kpKT0lhiXcYIGaE05S97RlSwFPl4ibT9jZ97fZ3-PG4sxcpQQ",
  "environment": "TEST"
}
```

**Response**

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