# Entregando el boleto adquirido en reventa

La responsabilidad de realizar la entrega del boleto adquirido en reventa, es pura y exclusivamente de tu sistema.

Los flujos de optimizados de compra, venta, publicación, edición y detalle de venta, con mejoras constantes para potenciar la oferta y la demanda, son de menta tech. 

Al momento de concretarse una reventa, inmediatamente **vamos a comunicarle a tu sistema que esto ha ocurrido.**


{% diagram type="sequence" height="400px" %}
{
  "nodes": [
    {
      "id": "actor-1",
      "type": "sequence-actor",
      "position": {
        "x": 80,
        "y": 30
      },
      "data": {
        "label": "Comprador",
        "accentColor": "#22c55e",
        "lifelineHeight": 306
      }
    },
    {
      "id": "actor-2",
      "type": "sequence-actor",
      "position": {
        "x": 656.2896139143585,
        "y": 30
      },
      "data": {
        "label": "Tu plataforma",
        "accentColor": "#f97316",
        "lifelineHeight": 306
      }
    },
    {
      "id": "msg-1765938030861",
      "type": "sequence-message",
      "position": {
        "x": 32.95834830885329,
        "y": 78.88201144077624
      },
      "data": {
        "label": "Realiza compra de boleto\nen mercado secundario"
      }
    },
    {
      "id": "actor-1765938270969",
      "type": "sequence-actor",
      "position": {
        "x": 303.5,
        "y": 30
      },
      "data": {
        "label": "menta tech",
        "accentColor": "#3b82f6",
        "lifelineHeight": 306
      }
    },
    {
      "id": "msg-1765938351644",
      "type": "sequence-message",
      "position": {
        "x": 278.925522042515,
        "y": 135.9761734763762
      },
      "data": {
        "label": "Se realiza el cobro"
      }
    },
    {
      "id": "actor-1765938398711",
      "type": "sequence-actor",
      "position": {
        "x": 477.93814757136727,
        "y": 30
      },
      "data": {
        "label": "Pagos",
        "accentColor": "#8b5cf6",
        "lifelineHeight": 306
      }
    },
    {
      "id": "msg-1765938441980",
      "type": "sequence-message",
      "position": {
        "x": 452.604814238034,
        "y": 198.0376784787317
      },
      "data": {
        "label": "Cobro confirmado"
      }
    },
    {
      "id": "msg-1765938477466",
      "type": "sequence-message",
      "position": {
        "x": 262.3949013346587,
        "y": 258.5307840006628
      },
      "data": {
        "label": "Notifica reventa exitosa"
      }
    },
    {
      "id": "msg-1765938519424",
      "type": "sequence-message",
      "position": {
        "x": 371.3340207090429,
        "y": 344.1852822930613
      },
      "data": {
        "label": "Recibe el boleto"
      }
    }
  ],
  "edges": [
    {
      "id": "edge-1765938273771",
      "source": "msg-1765938030861",
      "target": "actor-1765938270969",
      "sourceHandle": null,
      "targetHandle": "h-1",
      "animated": true,
      "style": {
        "stroke": "#9ca3af",
        "strokeWidth": 1.5
      },
      "markerEnd": {
        "type": "arrowclosed",
        "color": "#9ca3af",
        "width": 16,
        "height": 16
      }
    },
    {
      "id": "edge-1765938428350",
      "source": "msg-1765938351644",
      "target": "actor-1765938398711",
      "sourceHandle": null,
      "targetHandle": "h-5",
      "animated": true,
      "style": {
        "stroke": "#9ca3af",
        "strokeWidth": 1.5
      },
      "markerEnd": {
        "type": "arrowclosed",
        "color": "#9ca3af",
        "width": 16,
        "height": 16
      }
    },
    {
      "id": "edge-1765938457827",
      "source": "actor-1765938270969",
      "target": "msg-1765938441980",
      "sourceHandle": "s-10",
      "targetHandle": null,
      "animated": true,
      "style": {
        "stroke": "#9ca3af",
        "strokeWidth": 1.5
      },
      "markerStart": {
        "type": "arrowclosed",
        "color": "#9ca3af",
        "width": 16,
        "height": 16
      },
      "data": {
        "isReversed": true
      }
    },
    {
      "id": "edge-1765938579583",
      "source": "msg-1765938477466",
      "target": "actor-2",
      "sourceHandle": null,
      "targetHandle": "h-15",
      "animated": true,
      "style": {
        "stroke": "#9ca3af",
        "strokeWidth": 1.5
      },
      "label": "Webhook HTTP",
      "markerEnd": {
        "type": "arrowclosed",
        "color": "#9ca3af",
        "width": 16,
        "height": 16
      }
    },
    {
      "id": "edge-1765938625799",
      "source": "msg-1765938519424",
      "target": "actor-2",
      "sourceHandle": null,
      "targetHandle": "h-22",
      "animated": true,
      "style": {
        "stroke": "#9ca3af",
        "strokeWidth": 1.5
      },
      "markerStart": {
        "type": "arrowclosed",
        "color": "#9ca3af",
        "width": 16,
        "height": 16
      },
      "data": {
        "isReversed": true,
        "animationReversed": true
      }
    },
    {
      "id": "edge-1765938680272",
      "source": "actor-1",
      "target": "msg-1765938519424",
      "sourceHandle": "s-22",
      "targetHandle": null,
      "animated": true,
      "style": {
        "stroke": "#9ca3af",
        "strokeWidth": 1.5
      },
      "markerStart": {
        "type": "arrowclosed",
        "color": "#9ca3af",
        "width": 16,
        "height": 16
      },
      "data": {
        "isReversed": true
      }
    }
  ]
}
{% /diagram %}


{% columns gap="2rem" align="start" %}
{% column width="1" valign="center" %}
En este momento existen diferentes alternativas que los partners que nos eligen han adoptado para hacer frente a este requerimiento.

Todas tienen en común que reciben un `Webhook vía HTTP` que menta tech emite al sistema conectado. 

<br>

Luego de recibir ese Webhook cada sistema realiza las acciones necesarias para <i>transferir</i> el boleto del vendedor al comprador, de forma segura.

<br>

menta tech recopila toda la información que necesites para lograr esto, desde correo electrónico del comprador, hasta datos de personalización de boletos, dirección postal, número de teléfono o cuales sean estos requisitos.

<br>

Todo viaja por `Webhook` a tu sistema. A la derecha hay un ejemplo completo del `JSON` enviado desde menta tech. 

<br>

{% callout type="info" title="Recopilación de información" %}
Los campos que contienen datos personales pueden recopilar la información necesaria por tu sistema para el correcto envío del boleto al comprador.
{% /callout %}

{% /column %}
{% column width="2" valign="center" %}
Ejemplo de un `Webhook` saliente de menta tech informando la reventa exitosa.
<br><br>

```json
{
    "family": "ticket",
    "action": "ticket.updated",
    "data": {
        "id": "127471-2", // ID del boleto vendido (de tu sistema)
        "newOwnerEmail": "susana@hotmail.com", // Correo del nuevo dueño
        "oldOwnerEmail": "joe@gmail.com", // Correo del dueño anterior
        "reversal": false, // true si la transacción se está revirtiendo
        "metadata": {
            "nominal": {
                "fullName": "Susana Kann",
                "identificationNumber": "1307009",
                "identificationType": "DNI", // Tipo de documento del nuevo boleto. Depende del país.
            },
            "payer": {
                "fullName": "Susana Kann",
                "identificationNumber": "1307009",
                "identificationType": "DNI", // Tipo de documento del comprador. Depende del país.
            },
            "seller": {
                "identification": "9282712", // Identificación del vendedor
                "identificationType": "CC" // Tipo de documento del vendedor. Depende del país.
            },
            "order": {
                "resaleId": "689a3a0bc68bd2502ce21b15", // ID de la venta (en menta tech)
                "grossResalePaidAmount": 57.5, // Precio total de la venta
                "grossResalePaidAmountWithoutBuyerFee": 50.0, // Precio de venta sin fee del comprador
                "buyerFee": 0.15, // Fee del comprador.
                "buyerFeeAmount": 7.5 // Monto del fee del comprador
            }
        }
    }
}
```
{% /column %}
{% /columns %}


