---
title: Procesamiento Telefonico (IVR)
slug: procesamiento-telefonico-ivr
description: Learn how to process a phone or IVR operation via API effortlessly with this comprehensive document. No user interface needed! Follow the simple steps of creating an intent token, generating a card token, and executing payment. All you need are a public k
docTags: 
createdAt: 2021-01-29T02:00:17.000Z
---

Este tipo de procesamiento permite generar una operacion por Telefono o IVR via API sin intervencion de interfaz. Siempre se deben tener en cuenta las medidas de seguridad adecuadas para este tipo de Operatoria donde se manipulara el PAN del Cliente.


```mermaid
sequenceDiagram
    participant Sistema
    participant Mobbex
    Sistema->>Mobbex: Crear Operacion
    Note right of Mobbex: Utilizar Private Key
    Mobbex->>Sistema: Guardar Intent Token
    Sistema->>Mobbex: Generar Token Tarjeta
    Note right of Mobbex: Utilizar Public Key
    Mobbex->>Sistema: Devuelve Token
    Sistema->>Mobbex: Generar Cobro
```



# Requerimientos

- `Llave publica`
- `Llave privada`

# Pasos

### 1) Crear Token de Intencion de Cobro

****

**URL:**

:::BlockQuote
POST: **https\://api.mobbex.com/p/phone**
:::



**Ejemplo:**

```shell
curl --location --request POST 'https://api.mobbex.com/p/phone' \
--header 'api-key: _8bjoCPu4xW5GCHsp5yDHzSmhMnQU1kfw7nw' \
--header 'x-lang: es' \
--header 'Content-Type: application/json' \
--data-raw '{
	"total": 5.00,
	"currency": "ARS",
	"reference": "mi_referencia_interna_unica_123",
	"description": "La descripción de mi Venta",
	"customer": {
		"identification": "32321321",
		"email": "demo@mobbex.com",
		"name": "Demo User"
	},
	"test": true
}'
```


**Respuesta:**

Se debe obtener y Guardar *`data.intent.token`*``


```json
{
    "result": true,
    "data": {
        "context": "plugin.value.phone:ivr",
        "intent": {
            "type": "payment.v2",
            "token": "d95a0c8e-6a9e-40aa-a242-cd009c718916"
        },
        "test": true,
        "customer": {
            "name": "Demo User"
        }
    }
}
```

### 2) Crear Token de la Tarjeta

**URL:**

:::BlockQuote
POST: **https\://api.mobbex.com/p/sources/token/&#x7B;&#x7B;intentToken}}**
:::

****

**Parámetros en la URL:**

- `intentToken`: Resultado obtenido en la llamada anterior.

****

**Ejemplo:**

```shell
curl --location --request POST 'https://api.mobbex.com/p/sources/token/{{intentToken}}' \
--header 'api-key: ZQnK0za2GaHa5rkiUb0XROIK5akZzSDK5BgA' \
--header 'x-lang: es' \
--header 'Content-Type: application/json' \
--data-raw '{    
    "source": {       
         "card": {            
            "number": "4507990000000010",           
             "month": 10,           
             "year": 25,          
              "identification": "12123123",           
             "name": "Demo Mobbex"      
              }   
             }
            }
```



**Respuesta:**

```json
{    
    "result": true,    
    "data": {        
        "token": "T:27YxlfrFbS",      
          "description": "Visa Débito terminada en 0010",   
             "source": {       
                "references": ["visa.debit"],            
                "reference": "visa.debit",         
                "generic": "visa.debit",
                "compatReference": "visa.debit",
                "name": "Visa Débito",
                "shortName": "Visa Débito",
                "currency": "ARS",
                "card": {
                    "level": "classic",
                    "product": {
                        "name": "Visa Débito",
                        "shortName": "Visa Débit",
                        "variant": "debit",
                        "lengths": [16],
                        "gaps": [4, 8, 12],
                        "code": {
                            "name": "CVV",
                            "length": 3,
                            "position": 1
                            },
                        "logo": "https://res.mobbex.com/images/sources/png/visa.png",
                        "validation": ["length", "exp", "cvv", "luhn"]
                    },
                    "issuer": {
                        "shortName": "Visa",
                        "name": "Visa",
                        "color": "#122d98",
                        "logo": "https://res.mobbex.com/images/sources/png/visa.png"
                    }           
                 },
                "type": "card",
                "priority": 0
            }
    }
}
```

Se debe obtener y guardar `data.token`

### &#xA;3\) Ejecutar Cobro



**URL:**

:::BlockQuote
POST **https\://api.mobbex.com/p/operations/&#x7B;&#x7B;intentToken}}**
:::


**Parámetros en la URL:**

- `intentToken`: Resultado obtenido en la llamada anterior.

**Body:**

- `source`: Enviar el Token generado para la Tarjeta

**Ejemplo:**

```shell
curl --location --request POST 'https://api.mobbex.com/p/operations/{{intentToken}}' \
--header 'api-key: ZQnK0za2GaHa5rkiUb0XROIK5akZzSDK5BgA' \
--header 'x-lang: es' \
--header 'Content-Type: application/json' \
--data-raw '{
	"source": "T:ATe~3k4O3n"
}'
```


**Respuesta:**

```json
{
    "result": true,
    "data": {
        "view": "result",
        "options": {},
        "id": "Gg_UwXj5E",
        "status": {
            "code": "200",
            "text": "Aprobado",
            "message": "Transacción Aprobada"
        },
        "total": 5,
        "currency": {
            "value": "TEST",
            "label": "Test Money",
            "symbol": "T$",
            "hidden": false
        },
        "data": [],
        "actions": []
    }
}
```

