> For the complete documentation index, see [llms.txt](https://docs.afipsdk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.afipsdk.com/siguientes-pasos/ir-a-produccion.md).

# Ir a producción

### 1. Obtener certificado de producción

Si aún no lo hiciste, en este momento necesitas obtener los certificados de producción. Aquí te dejo una guía sobre cómo obtenerlos.

{% embed url="<https://afipsdk.com/blog/como-obtener-certificado-para-web-services-arca/>" %}

### 2. Cambiar los parámetros

{% tabs %}
{% tab title="Node" %}
Debes agregar el `cert`, `key` y configurar `production` en `true`.

```javascript
import Afip from '@afipsdk/afip.js';
import fs from 'fs';

// Certificado (Puede estar guardado en archivos, DB, etc)
const cert = fs.readFileSync('./certificado.crt', {encoding: 'utf8'});

// Key (Puede estar guardado en archivos, DB, etc)
const key = fs.readFileSync('./key.key', {encoding: 'utf8'});

const afip = new Afip({ 
    CUIT: 20111111112,
    cert: cert,
    key: key,
    access_token: 'access_token obtenido en https://app.afipsdk.com/',
    production: true
});
```

{% endtab %}

{% tab title="PHP" %}
Debes agregar el `cert`, `key` y configurar `production` en `true`.

<pre class="language-php"><code class="lang-php">// Certificado (Puede estar guardado en archivos, DB, etc)
$cert = file_get_contents('./certificado.crt');

// Key (Puede estar guardado en archivos, DB, etc)
$key = file_get_contents('./key.key');

<strong>$afip = new Afip(array(
</strong>    'CUIT' => 20111111112,
    'cert' => $cert,
    'key' => $key,
    'access_token' => 'access_token obtenido en https://app.afipsdk.com/',
    'production' => TRUE
));
</code></pre>

{% endtab %}

{% tab title="Ruby" %}
Debes agregar el `cert`, `key` y configurar `production` en `true`.

```ruby
# Certificado (Puede estar guardado en archivos, DB, etc)
cert = File.read("./certificado.crt")

# Key (Puede estar guardado en archivos, DB, etc)
key = File.read("./key.key")

afip = Afip.new({ 
    "CUIT": 20111111112,
    "cert": cert,
    "key": key,
    "access_token": "access_token obtenido en https://app.afipsdk.com/",
    "production": true
})
```

{% endtab %}

{% tab title="Python" %}
Debes agregar el `cert`, `key` y configurar `production` en `true`.

```python
# Certificado (Puede estar guardado en archivos, DB, etc)
cert = open("./certificado.crt").read()

# Key (Puede estar guardado en archivos, DB, etc)
key = open("./key.key").read()

afip = Afip({ 
    "CUIT": 20111111112,
    "cert": cert,
    "key": key,
    "access_token": "access_token obtenido en https://app.afipsdk.com/",
    "production": True
})
```

{% endtab %}

{% tab title=".NET" %}
Debes agregar el `Cert`, `Key` y configurar `Production` en `true`.

```csharp
// Certificado (Puede estar guardado en archivos, DB, etc)
string cert = "-----BEGIN CERTIFICATE-----\nMIIDRzC...";

// Key (Puede estar guardado en archivos, DB, etc)
string key = "-----BEGIN RSA PRIVATE KEY-----\r\nMIIEowIBAAKCA...";

var afip = new Afip(new AfipOptions
{
    CUIT = 20111111112,
    Cert = cert,
    Key = key,
    AccessToken = "access_token obtenido en https://app.afipsdk.com/",
    Production = true
});
```

{% endtab %}

{% tab title="Java" %}
Debes agregar el `cert`, `key` y configurar `production` en `true`.

```java
// Certificado (Puede estar guardado en archivos, DB, etc)
String cert = "-----BEGIN CERTIFICATE-----\nMIIDRzC...";

// Key (Puede estar guardado en archivos, DB, etc)
String key = "-----BEGIN RSA PRIVATE KEY-----\r\nMIIEowIBAAKCA...";

AfipOptions options = new AfipOptions();
options.setCuit(20111111112L);
options.setCert(cert);
options.setKey(key);
options.setAccessToken("access_token obtenido en https://app.afipsdk.com/");
options.setProduction(true);

Afip afip = new Afip(options);
```

{% endtab %}

{% tab title="API" %}
En los requests cambiar el parámetro `environment: prod`

```json
{
    "environment": "prod"
}
```

En los request de Autorización agregarle el cert y key de producción

```json
{
    "environment": "prod",
    "cert": "-----BEGIN CERTIFICATE-----\nMIIDRzC...",
    "key": "-----BEGIN RSA PRIVATE KEY-----\r\nMIIEowIBAAKCA..."
}
```

{% endtab %}
{% endtabs %}

Eso es todo. Los requests que realices con esta configuración ya van a impactar en los web services de producción.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.afipsdk.com/siguientes-pasos/ir-a-produccion.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
