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

# Obtenir un jeton d'application

> Échangez les identifiants d'une application contre un jeton Bearer RS256.

Utilisez uniquement cet endpoint depuis votre serveur. Le jeton expire après `3600` secondes et doit être réutilisé jusqu'à son expiration.

```bash cURL theme={null}
curl --request POST \
  --url https://account.bizconnectpay.com/api/v1/auth/application/token \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "client_id": "BCP_live_8R4K2M7N",
    "client_secret": "bcp_secret_replace_me"
  }'
```

```json Payload theme={null}
{
  "client_id": "BCP_live_8R4K2M7N",
  "client_secret": "bcp_secret_replace_me"
}
```

```json 200 OK theme={null}
{
  "success": true,
  "data": {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...",
    "expires_in": 3600,
    "token_type": "Bearer",
    "environment": "LIVE",
    "scope": "payments.read payments.write transactions.read"
  },
  "meta": {
    "correlation_id": "3f551f5a-b809-4e0e-9dd7-52efaf784633"
  }
}
```


## OpenAPI

````yaml openapi.json POST /auth/application/token
openapi: 3.1.0
info:
  title: BizConnectPay API
  version: 1.0.0
  description: >-
    API serveur-à-serveur pour les collectes, décaissements, transactions,
    remboursements, liens de paiement et cartes virtuelles.
servers:
  - url: https://api.bizconnectpay.com/api/v1
    description: Passerelle API BizConnectPay
security:
  - bearerAuth: []
tags:
  - name: Authentification
  - name: Services
  - name: Collectes
  - name: Transactions
  - name: Décaissements
  - name: Remboursements
  - name: Liens de paiement
  - name: Porteurs de carte
  - name: Cartes virtuelles
paths:
  /auth/application/token:
    post:
      tags:
        - Authentification
      summary: Obtenir un jeton d'application
      description: >-
        Échange un Client ID et un secret contre un jeton Bearer RS256 valable
        3600 secondes par défaut.
      operationId: createApplicationToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplicationTokenRequest'
            example:
              client_id: BCP_your_client_id
              client_secret: your_application_secret
      responses:
        '200':
          description: Jeton créé
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationTokenResponse'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/ValidationError'
      security: []
      servers:
        - url: https://account.bizconnectpay.com/api/v1
components:
  schemas:
    ApplicationTokenRequest:
      type: object
      required:
        - client_id
        - client_secret
      properties:
        client_id:
          type: string
          maxLength: 80
        client_secret:
          type: string
          maxLength: 255
          writeOnly: true
    ApplicationTokenResponse:
      type: object
      required:
        - success
        - data
        - meta
      properties:
        success:
          type: boolean
          const: true
        data:
          type: object
          required:
            - access_token
            - expires_in
            - token_type
            - environment
            - scope
          properties:
            access_token:
              type: string
            expires_in:
              type: integer
              example: 3600
            token_type:
              type: string
              const: Bearer
            environment:
              type: string
              enum:
                - SANDBOX
                - LIVE
            scope:
              type: string
        meta:
          $ref: '#/components/schemas/Meta'
    Meta:
      type: object
      properties:
        correlation_id:
          type:
            - string
            - 'null'
          format: uuid
    ErrorEnvelope:
      type: object
      properties:
        success:
          type: boolean
          const: false
        data:
          type: object
          properties:
            error:
              type: object
              properties:
                code:
                  type: string
                message:
                  type: string
                details:
                  type:
                    - object
                    - array
        meta:
          $ref: '#/components/schemas/Meta'
  responses:
    Unauthenticated:
      description: Authentification requise ou invalide
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: Scope ou état de compte insuffisant
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    ValidationError:
      description: Payload ou règle métier invalide
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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