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

# Archivar precio

> Archiva un precio sin afectar las suscripciones que lo usan.

Archiva un precio (`active` pasa a `false`). Las suscripciones que ya lo usan siguen cobrando con normalidad. Si el precio era el `default` de su producto, se reasigna automáticamente a otro precio activo.

<Note>
  Los precios son inmutables: no se editan, se archivan. Para reemplazar un precio, crea uno nuevo con [Crear precio](/client/prices/create) y archiva el anterior aquí.
</Note>

### Path Parameters

<ParamField path="id" type="string" required placeholder="9f5d85a0-2222-7000-aaaa-000000000002">
  ID del precio que deseas archivar. [Crear precio](/client/prices/create).
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.onepay.la/v1/prices/9f5d85a0-2222-7000-aaaa-000000000002 \
    -X DELETE \
    -H "Authorization: Bearer sk_test_xxx"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.onepay.la/v1/prices/9f5d85a0-2222-7000-aaaa-000000000002', {
    method: 'DELETE',
    headers: {
      'Authorization': 'Bearer sk_test_xxx'
    }
  });

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

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

  response = requests.delete(
      'https://api.onepay.la/v1/prices/9f5d85a0-2222-7000-aaaa-000000000002',
      headers={
          'Authorization': 'Bearer sk_test_xxx'
      }
  )

  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $curl = curl_init();

  curl_setopt_array($curl, [
      CURLOPT_URL => "https://api.onepay.la/v1/prices/9f5d85a0-2222-7000-aaaa-000000000002",
      CURLOPT_CUSTOMREQUEST => "DELETE",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => [
          "Authorization: Bearer sk_test_xxx"
      ]
  ]);

  $data = json_decode(curl_exec($curl), true);
  ?>
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "message": "price archived"
  }
  ```

  ```json 404 theme={null}
  {
    "message": "No encontrado",
    "code": 10004,
    "code_name": "not_found"
  }
  ```
</ResponseExample>
