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

# Obtenir un terme de paiement

> Récupérer un terme de paiement spécifique par ID

## Autorisation

<ParamField header="Authorization" type="string" required>
  Jeton Bearer pour l'authentification. Format : `Bearer qwoty_your_token`
</ParamField>

## Paramètres de chemin

<ParamField path="id" type="string" required>
  UUID du terme de paiement
</ParamField>

## Exemples

<CodeGroup>
  ```bash cURL theme={null}
  curl https://qwoty.app/api/payment-terms/550e8400-e29b-41d4-a716-446655440000 \
    -H "Authorization: Bearer qwoty_your_token"
  ```

  ```javascript JavaScript theme={null}
  const paymentTermId = '550e8400-e29b-41d4-a716-446655440000'

  const response = await fetch(
    `https://qwoty.app/api/payment-terms/${paymentTermId}`,
    {
      headers: {
        Authorization: 'Bearer qwoty_your_token',
      },
    },
  )

  const data = await response.json()
  ```

  ```python Python theme={null}
  import requests

  payment_term_id = '550e8400-e29b-41d4-a716-446655440000'

  response = requests.get(
      f'https://qwoty.app/api/payment-terms/{payment_term_id}',
      headers={
          'Authorization': 'Bearer qwoty_your_token'
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Réponse

<ResponseField name="success" type="boolean">
  Indique si la requête a réussi
</ResponseField>

<ResponseField name="data" type="object">
  L'objet terme de paiement

  <Expandable title="Objet Terme de Paiement">
    <ResponseField name="id" type="string">
      Identifiant unique (UUID)
    </ResponseField>

    <ResponseField name="name" type="string">
      Nom du terme de paiement
    </ResponseField>

    <ResponseField name="api_name" type="string">
      Identifiant API
    </ResponseField>

    <ResponseField name="reference" type="string">
      Référence interne
    </ResponseField>

    <ResponseField name="is_active" type="boolean">
      Statut actif
    </ResponseField>

    <ResponseField name="id_crm" type="string">
      ID CRM externe
    </ResponseField>

    <ResponseField name="id_erp" type="string">
      ID ERP externe
    </ResponseField>

    <ResponseField name="id_accounting" type="string">
      ID comptabilité externe
    </ResponseField>

    <ResponseField name="installments" type="array">
      Tableau d'objets d'échéances avec id, name, percentage, term, custom\_text et order\_number
    </ResponseField>

    <ResponseField name="created_at" type="string">
      Horodatage ISO 8601
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      Horodatage ISO 8601
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "data": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Net 30 Days",
      "api_name": "net_30_days",
      "reference": "PT001",
      "is_active": true,
      "id_crm": "crm_123",
      "id_erp": "erp_456",
      "id_accounting": "acc_789",
      "installments": [
        {
          "id": "660e8400-e29b-41d4-a716-446655440001",
          "name": "Full Payment",
          "percentage": 100,
          "term": "net30",
          "custom_text": null,
          "order_number": 1
        }
      ],
      "created_at": "2024-12-21T10:30:00Z",
      "updated_at": "2024-12-21T10:30:00Z"
    }
  }
  ```
</ResponseExample>

## Réponses d'erreur

<ResponseExample>
  ```json Not Found theme={null}
  {
    "success": false,
    "error": "Payment term not found"
  }
  ```

  ```json Unauthorized theme={null}
  {
    "success": false,
    "error": "Invalid API token"
  }
  ```

  ```json Invalid ID Format theme={null}
  {
    "success": false,
    "error": "Invalid payment term ID format"
  }
  ```
</ResponseExample>
