# Getting Started (EN)

Welcome! Here you will find examples and a detailed endpoint list that will let you integrate WoowUp with the systems you use.

## Getting started

This is a REST-style API that uses JSON for serialization. To start using the API you will need:

  1.Log into WoowUp and get your Api Key from the Configuration/MyAccount section. \
  2.Read the API docs to understand what you can do.

Basics

* All request receive and return data in JSON format.
* Remember to include in the header Basic Authentication when calling any endpoint. [Here](/woowup-developer-docs#authentication) you’ll find how to do it.
* To identify a customer use the field “service\_uid”. Normally you will use the email or the ID (DNI, CPF, RUT, Passport) to identify the customer.
* Every time you are going to use service\_uid as part of the URL, first you’ll need to encode it with base64 and then with url encode. You can read here a detailed explanation [here](/woowup-developer-docs#how-to-encode-service_uid).
* Valid date formats are: YYYY-mm-dd HH:mm:ss (default in UTC) or ISO8601 format including the timezone Ex: 2004-02-12T15:19:21+03:00
* Normally you’ll include al the Product Information (sku, title, category, stock, etc) within the Create purchase order endpoint. But if you prefer, there is a specific endpoint to synchronize [products](/woowup-developer-docs/api/products#products).
* Before send a purchase order, you need to create the customer if it doesn't exist. In the example you can see how this process works in the "import\_from\_csv.php" file.
* Please, pay attention to the messages of the responses of our API because we will tell you if something is wrong with your requests or the information you send.

### Rate Limiting

The API limits the number of requests per account to ensure service stability. **The default limit is 140 requests per minute.**

The system divides time into 30-second segments and always evaluates two segments: the current one and the previous one. Requests from the current segment count at 100%, while requests from the previous segment are weighted based on elapsed time — the more time has passed, the less they count.

This creates a smooth transition between windows, avoiding the classic fixed-counter problem where a client can double the limit at the reset boundary.

{% code lineNumbers="true" %}

```java
weight     = 1 - (elapsed_seconds / segment_duration)                                                                                                                 
estimated  = (previous_requests × weight) + current_requests                                                                                                          
                                                                                                                                                                        
if estimated ≥ limit → HTTP 429 
```

{% endcode %}

**Example:** The previous segment ended with 60 requests and the current one has 25, at 15 seconds into the segment:

{% code lineNumbers="true" %}

```java
weight    = 1 - (15 / 30) = 0.5                                                                                                                                       
estimated = (60 × 0.5) + 25 = 55 → Allowed (< 70)
```

{% endcode %}

#### Response Headers

Every API response includes rate limiting headers so you can monitor your usage:

<table><thead><tr><th>Header</th><th width="373.6328125">Description</th><th width="145.015625">Example</th></tr></thead><tbody><tr><td><code>x-rate-limit-limit</code></td><td><code>Maximum requests per window</code></td><td><code>70</code></td></tr><tr><td><code>x-rate-limit-remaining</code></td><td><code>Remaining requests in current window</code> </td><td><code>45</code></td></tr><tr><td><code>x-rate-limit-reset</code></td><td><code>Unix timestamp when the window resets</code></td><td><code>1742121660</code></td></tr></tbody></table>

When the limit is exceeded, the API responds with HTTP 429 Too Many Requests and includes:

<table><thead><tr><th>Header</th><th width="373.6328125">Description</th><th width="145.015625">Example</th></tr></thead><tbody><tr><td><code>Retry-After</code> </td><td><code>Seconds to wait before retrying</code></td><td><code>18</code></td></tr></tbody></table>

**Example Responses:**

{% tabs %}
{% tab title="Normal Response" %}
`HTTP/1.1 200 OK x-rate-limit-limit: 70 x-rate-limit-remaining: 45 x-rate-limit-reset: 1742121660`
{% endtab %}

{% tab title="Rate Limited Response" %} <sup>`HTTP/1.1 429 Too Many Requests x-rate-limit-limit: 70 x-rate-limit-remaining: 0 x-rate-limit-reset: 1742121660 Retry-After: 18`</sup>

<sup>`{"payload": [], "message": "too many request", "code": "too_many_request"}`</sup>
{% endtab %}
{% endtabs %}

#### Best Practices

* Monitor headers: Check x-rate-limit-remaining on each response to track your usage before hitting the limit.
* Retry with backoff: When you receive a 429, wait the number of seconds indicated in the Retry-After header before retrying.
* Distribute requests: Spread your calls evenly over time instead of sending bursts.
* Use pagination efficiently: Use higher limit values (e.g., ?limit=100) to reduce the number of requests needed.

If you need a higher rate limit, please contact your account manager or our support team.

#### Examples

{% tabs %}
{% tab title="Python" %}
{% code lineNumbers="true" %}

```python
import requests
import time                                                                                                                                                          

BASE_URL = "https://api.woowup.com/apiv3"                                                                                                                            
API_TOKEN = "your_api_token"                                       
                                          
headers = {                                                                                                                                                          
  "Authorization": f"Bearer {API_TOKEN}",
  "Accept": "application/json"                                                                                                                                     
}                                                                  
                                                                                                                                                                   
def make_request(endpoint):                                        
  response = requests.get(f"{BASE_URL}/{endpoint}", headers=headers)

  # Read rate limit headers                                                                                                                                        
  limit = response.headers.get("x-rate-limit-limit")
  remaining = response.headers.get("x-rate-limit-remaining")                                                                                                       
  reset = response.headers.get("x-rate-limit-reset")                                                                                                               
                                          
  print(f"Limit: {limit}, Remaining: {remaining}, Reset: {reset}")                                                                                                 
                                                                 
  if response.status_code == 429:                                                                                                                                  
      retry_after = int(response.headers.get("Retry-After", 30))
      print(f"Rate limited. Retrying in {retry_after}s...")                                                                                                        
      time.sleep(retry_after)                                    
      return make_request(endpoint)
                                                                                                                                                                   
  return response.json()              
                                                                                                                                                                   
result = make_request("/users") 
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript (Node.js)" %}
{% code lineNumbers="true" %}

```typescript
const BASE_URL = "https://api.woowup.com/apiv3";
const API_TOKEN = "your_api_token";         
                                        
async function makeRequest(endpoint) {
  const response = await fetch(`${BASE_URL}/${endpoint}`, {                                                                                                          
    headers: {                              
      Authorization: `Bearer ${API_TOKEN}`,                                                                                                                          
      Accept: "application/json",                                  
    },                                                                                                                                                               
  });
                                                                                                                                                                     
  // Read rate limit headers                                       
  const limit = response.headers.get("x-rate-limit-limit");
  const remaining = response.headers.get("x-rate-limit-remaining");
  const reset = response.headers.get("x-rate-limit-reset");

  console.log(`Limit: ${limit}, Remaining: ${remaining}, Reset: ${reset}`);                                                                                          
                                        
  if (response.status === 429) {                                                                                                                                     
    const retryAfter = parseInt(response.headers.get("Retry-After") || "30", 10);                                                                                    
    console.log(`Rate limited. Retrying in ${retryAfter}s...`);
    await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000));                                                                                          
    return makeRequest(endpoint);                                  
  }
                                                                                                                                                                     
  return response.json();
}                                                                                                                                                                    
                                                                   
makeRequest("/users").then(console.log);
```

{% endcode %}
{% endtab %}

{% tab title="Ruby" %}
{% code lineNumbers="true" %}

```ruby
require "net/http"                                                                                                                                                   
require "json"
require "uri"                                                                                                                                                        
                                                                   
BASE_URL = "https://api.woowup.com/apiv3"   
API_TOKEN = "your_api_token"            

def make_request(endpoint)                                                                                                                                           
  uri = URI("#{BASE_URL}/#{endpoint}")
  request = Net::HTTP::Get.new(uri)                                                                                                                                  
  request["Authorization"] = "Bearer #{API_TOKEN}"                 
  request["Accept"] = "application/json"

  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|                                                                                        
    http.request(request)               
  end                                                                                                                                                                
                                                                                                                                                                     
  # Read rate limit headers
  limit = response["x-rate-limit-limit"]                                                                                                                             
  remaining = response["x-rate-limit-remaining"]                   
  reset = response["x-rate-limit-reset"]
                                            
  puts "Limit: #{limit}, Remaining: #{remaining}, Reset: #{reset}"

  if response.code.to_i == 429                                                                                                                                       
    retry_after = (response["Retry-After"] || "30").to_i
    puts "Rate limited. Retrying in #{retry_after}s..."                                                                                                              
    sleep(retry_after)                                             
    return make_request(endpoint)
  end                                                                                                                                                                
 
  JSON.parse(response.body)                                                                                                                                          
end                                                                

result = make_request("users")   
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}
{% code lineNumbers="true" %}

```php
<?php
                                                                                                                                                                   
$baseUrl = 'https://api.woowup.com/apiv3';                         
$apiToken = 'your_api_token';           

function makeRequest($endpoint) {                                                                                                                                    
  global $baseUrl, $apiToken;
                                                                                                                                                                   
  $ch = curl_init("{$baseUrl}/{$endpoint}");                     
  curl_setopt_array($ch, [            
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HEADERFUNCTION => function ($ch, $header) use (&$headers) {                                                                                          
          $parts = explode(':', $header, 2);
          if (count($parts) === 2) {                                                                                                                               
              $headers[strtolower(trim($parts[0]))] = trim($parts[1]);
          }                                                                                                                                                        
          return strlen($header);     
      },                                                                                                                                                           
      CURLOPT_HTTPHEADER => [                                                                                                                                      
          "Authorization: Bearer {$apiToken}",
          "Accept: application/json",                                                                                                                              
      ],                                                         
  ]);
                                                                                                                                                                   
  $headers = [];
  $body = curl_exec($ch);                                                                                                                                          
  $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);           
  curl_close($ch);                        
                                      
  // Read rate limit headers
  $limit = $headers['x-rate-limit-limit'] ?? 'N/A';                                                                                                                
  $remaining = $headers['x-rate-limit-remaining'] ?? 'N/A';
  $reset = $headers['x-rate-limit-reset'] ?? 'N/A';                                                                                                                
                                                                 
  echo "Limit: {$limit}, Remaining: {$remaining}, Reset: {$reset}\n";                                                                                              

  if ($statusCode === 429) {                                                                                                                                       
      $retryAfter = (int) ($headers['retry-after'] ?? 30);       
      echo "Rate limited. Retrying in {$retryAfter}s...\n";                                                                                                        
      sleep($retryAfter);                                        
      return makeRequest($endpoint);
  }                                                                                                                                                                
                                      
  return json_decode($body, true);                                                                                                                                 
}                                                                                                                                                                    

$result = makeRequest('/users');                                                                                                                                     
                               
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Authentication <a href="#authentication" id="authentication"></a>

In any call to the API you must sent the apikey in the query string as a parameter.

For example, if your apikey is 'abcdefghijklmnopqrstuvwxyz', you should do a request to

`https://api.woowup.com/apiv3/users?apikey=abcdefghijklmnopqrstuvwxyz`

Other method, and the recomended, is via Authentication Header, in every call you must send the header

`Authorization: Basic abcdefghijklmnopqrstuvwxyz`&#x20;

#### Deleted accounts

Requests from deleted accounts receive `410 Gone` with code `account_deleted`. Once an account has been deactivated, its API key is no longer valid and all requests will\
be rejected.

{% code lineNumbers="true" %}

```json
{
    "payload": [],
    "message": "gone: account deleted",
    "code": "account_deleted"
}
```

{% endcode %}

### Pagination <a href="#pagination" id="pagination"></a>

When you are doing a search, we paginate the results. In all paginated endpoints the pagination's parameters are:

| Parameter | Description                         | Default |
| --------- | ----------------------------------- | ------- |
| limit     | Items per page returned. Max: 100   | 25      |
| page      | Number of the page. First page is 0 | 0       |

### Returned format <a href="#returned-format" id="returned-format"></a>

All endpoints return data in json format, with the `Content-Type: application/json` header. For a correct use you have to send in all the requests the header `Accept: application/json`.

### How to encode 'service\_uid' <a href="#how-to-encode-service_uid" id="how-to-encode-service_uid"></a>

When you are trying to find an user you could identificate this by his id or his service\_uid (commonly is the email), when you use the service\_uid you must encode this in Base64 en the result encode as url safe, for example if you need to do this in php:

```php
<?php

$service_uid = 'example@email.com';
$encoded_uid = urlencode(base64_encode($service_uid));
$url = 'https://api.woowup.com/apiv3/users/'.$encoded_uid.'/exist';

```

### Sample Code: How to start sending us your purchase orders <a href="#sample-code-how-to-start-sending-us-your-purchase-orders" id="sample-code-how-to-start-sending-us-your-purchase-orders"></a>

In the following link you will find a fully functional example in PHP that process a CSV file with orders and customers and use the API to send them to WoowUp: [Download example](https://github.com/woowup/woowup-php-client/blob/master/dist/woowup-php-client-v1.zip)

### Support <a href="#support" id="support"></a>

**Remember to contact us on** [**developers@woowup.com**](mailto:developers@woowup.com) **for any questions, we will be happy to assist you.**


# Primeros Pasos (ES)

Aquí encontrará ejemplos y una lista detallada de puntos finales que le permitirá integrar WoowUp con los sistemas que utiliza via API.

## Getting Started

Esta es una API de estilo REST que utiliza JSON para la serialización.&#x20;

Para comenzar a utilizar la API necesitará:

* Inicie sesión en WoowUp y obtenga su clave API en la sección Configuración / Mi cuenta.

{% hint style="info" %}
Recuerda que debes tener permisos de Super Admin para ver las claves.
{% endhint %}

* Lea los documentos de la API para comprender lo que puede hacer.

### Elementos esenciales a tener en cuenta

* Toda solicitud recibe y devuelve datos en formato JSON.
* Recuerde incluir en el header Basic Authentication al llamar a cualquier endpoint. [Aquí](https://docs.woowup.com/#authentication) encontrarás cómo hacerlo.
* Para identificar a un cliente use el campo "service\_uid". Normalmente, usará el correo electrónico o la ID (DNI, CPF, RUT, Pasaporte) para identificar al cliente.
* Cada vez que vaya a usar service\_uid como parte de la URL, primero deberá codificarlo con base64 y luego con URL encode. Puedes leer aquí una explicación detallada [aquí](https://docs.woowup.com/#how-to-encode-service_uid).
* Los formatos de fecha válidos son: AAAA-mm-dd HH: mm: ss (predeterminado en UTC) o formato ISO 8601 que incluye la zona horaria Ej .: 2004-02-12T15: 19: 21 + 03: 00
* Normalmente, incluirá toda la Información del producto (sku, título, categoría, stock, etc.) en el punto final de Crear pedido de compra. Pero si lo prefiere, hay un endpoint específico para sincronizar [productos](https://docs.woowup.com/api/products#products).
* Antes de enviar una orden de compra, debe crear el cliente si no existe. En el ejemplo, puede ver cómo funciona este proceso en el archivo "import\_from\_csv.php".
* Por favor, preste atención a los mensajes de las respuestas de nuestra API porque le informaremos si algo está mal con sus solicitudes o con la información que envía.

### Rate Limiting

La API limita la cantidad de requests por cuenta para garantizar la estabilidad del servicio. El límite por defecto es de **140 requests por minuto.**

El sistema divide el tiempo en segmentos de 30 segundos y siempre evalúa dos segmentos: el actual y el anterior. Los requests del segmento actual cuentan al 100%, mientras que los del segmento anterior se ponderan según el tiempo transcurrido — cuanto más tiempo pasó, menos pesan.&#x20;

Esto genera una transición suave entre ventanas, evitando el problema clásico de los contadores fijos donde un cliente puede duplicar el límite en el borde del reset.

{% code lineNumbers="true" %}

```java
peso       = 1 - (segundos_transcurridos / duración_segmento)                                                                                                         
estimación = (requests_anteriores × peso) + requests_actuales 

if estimación ≥ límite → HTTP 429
```

{% endcode %}

**Ejemplo:** El segmento anterior terminó con 60 requests y el actual lleva 25, estando a los 15 segundos del segmento:

<pre class="language-java" data-line-numbers><code class="lang-java"><strong>peso = 1 - (15 / 30) = 0.5
</strong>estimación = (60 × 0.5) + 25 = 55 → Permitido (&#x3C; 70)
</code></pre>

#### Headers de respuesta

Todas las respuestas de la API incluyen headers de rate limiting para que puedas monitorear tu consumo en tiempo real:

<table><thead><tr><th width="210.078125">Header</th><th width="418.53515625">Descripcion</th><th width="121.28125">Ejemplo</th></tr></thead><tbody><tr><td><code>x-rate-limit-limit</code></td><td><code>Máximo de requests por ventana</code></td><td><code>70</code></td></tr><tr><td><code>x-rate-limit-remaining</code></td><td><code>Requests restantes en la ventana actual</code> </td><td><code>45</code></td></tr><tr><td><code>x-rate-limit-reset</code></td><td><code>Timestamp Unix de cuándo se renueva la ventana</code></td><td><code>1742121660</code></td></tr></tbody></table>

Cuando se supera el límite, la API responde con **HTTP 429 Too Many Requests** e incluye:

<table><thead><tr><th>Header</th><th width="428.92578125">Descripcion</th><th width="145.015625">Ejemplo</th></tr></thead><tbody><tr><td><code>Retry-After</code> </td><td><code>Segundos que debés esperar antes de reintentar</code></td><td><code>18</code></td></tr></tbody></table>

**Ejemplos de Respuestas:**

{% tabs %}
{% tab title="Normal" %}
`HTTP/1.1 200 OK x-rate-limit-limit: 70 x-rate-limit-remaining: 45 x-rate-limit-reset: 1742121660`
{% endtab %}

{% tab title="Bloqueada" %} <sup>`HTTP/1.1 429 Too Many Requests x-rate-limit-limit: 70 x-rate-limit-remaining: 0 x-rate-limit-reset: 1742121660 Retry-After: 18`</sup>

<sup>`{"payload": [], "message": "too many request", "code": "too_many_request"}`</sup>
{% endtab %}
{% endtabs %}

#### Buenas prácticas

* **Monitoreá los headers:** Revisá x-rate-limit-remaining en cada respuesta para conocer tu consumo antes de alcanzar el límite.
* **Reintentá con backoff:** Cuando recibas un 429, esperá la cantidad de segundos indicada en el header Retry-After antes de reintentar.
* **Distribuí los requests:** Repartí las llamadas de forma uniforme en el tiempo en lugar de enviar ráfagas.
* **Usá paginación eficiente:** Usá valores altos de limit (ej: ?limit=100) para reducir la cantidad de requests necesarios.

Si necesitás un límite más alto, contactá a tu account manager o a nuestro equipo de soporte.

### Autenticación&#x20;

En cualquier llamada a la API, debe enviar el API Key en la cadena de consulta como un parámetro.

Por ejemplo, si su API Key es 'abcdefghijklmnopqrstuvwxyz', debe hacer una solicitud para

```http
https://api.woowup.com/apiv3/users?apikey=abcdefghijklmnopqrstuvwxyz
```

Otro método, y el recomendado, es a través del encabezado de autenticación, en cada llamada debe enviar el encabezado

```
Authorization: Basic abcdefghijklmnopqrstuvwxyz
```

#### Cuentas Eliminadas

Las solicitudes desde cuentas eliminadas reciben `410 Gone` con código `account_deleted`. Una vez que una cuenta ha sido dada de baja, su API key deja de ser válida y\
todas las solicitudes serán rechazadas.

{% code lineNumbers="true" %}

```
{
    "payload": [],
    "message": "gone: account deleted",
    "code": "account_deleted"
}
```

{% endcode %}

### Paginación

Cuando estás haciendo una búsqueda, paginamos los resultados. En todos los puntos finales paginados, los parámetros de la paginación son:

| Parameter | Description                         | Default |
| --------- | ----------------------------------- | ------- |
| limit     | Items per page returned. Max: 100   | 25      |
| page      | Number of the page. First page is 0 | 0       |

### Returned Format <a href="#returned-format" id="returned-format"></a>

Todos los endpoints devuelven datos en formato JSON, con el encabezado:

```
Content-Type: application / json
```

&#x20;Para un uso correcto tienes que enviar en todas las solicitudes el encabezado

```
 Accept: application / json.
```

### Codificar 'service\_uid'&#x20;

Cuando intenta encontrar un usuario, puede identificarlo por su id o su service\_uid (comúnmente es el correo electrónico), cuando usa service\_uid debe codificar esto en Base64 y codificar el resultado como URL seguro, por ejemplo, si necesita hacer esto en php:

```php
<?php
​
$service_uid = 'example@email.com';
$encoded_uid = urlencode(base64_encode($service_uid));
$url = 'https://api.woowup.com/apiv3/users/'.$encoded_uid.'/exist';
​
```

### Código de muestra

Cómo empezar a enviarnos sus pedidos de compra En el siguiente enlace encontrará un ejemplo completamente funcional en PHP que procesa un archivo CSV con pedidos y clientes y utiliza la API para enviarlos a WoowUp: [Ejemplo de descarga](https://github.com/woowup/woowup-php-client/blob/master/dist/woowup-php-client-v1.zip)

{% hint style="info" %}
No dude en ponerse en contacto con nosotros escribiendo a <developers@woowup.com> para cualquier consulta, estaremos encantados de atenderle.
{% endhint %}


# Requisitos de conexión y seguridad

Esta página describe los protocolos de transporte y los requisitos de seguridad para conectarse a la API y endpoints públicos de WoowUp (por ej. `api.woowup.com`).

### Transporte: solo HTTPS

Todas las conexiones deben usar **HTTPS**. Los requests HTTP planos al puerto `80` se redirigen automáticamente a `443` (HTTPS). No existe acceso a la API sin cifrar.

* **Puerto:** `443`
* **Esquema:** `https://`

### TLS

WoowUp requiere **TLS 1.2 o superior** (se soportan TLS 1.2 y TLS 1.3). Las versiones anteriores (TLS 1.1, TLS 1.0, SSLv3) **no están soportadas** y serán rechazadas.

#### Cipher suites

Solo se aceptan cipher suites modernos y seguros. Todos los suites negociados proveen:

* **Forward secrecy** — intercambio de claves ECDHE
* **Cifrado autenticado (AEAD)** — AES-GCM y ChaCha20-Poly1305

Los ciphers legacy (RC4, 3DES, intercambio RSA estático, suites basados en SHA-1) **no están soportados**.

#### SNI requerido

El endpoint usa SNI (Server Name Indication). Tu cliente TLS **debe enviar la extensión SNI** con el hostname destino durante el handshake. Casi todos los clientes modernos lo hacen automáticamente; solo librerías muy viejas pueden requerir actualización.

#### Certificado

* Emitido por una CA pública de confianza (Amazon)
* Clave RSA-2048, firma SHA-256
* Tu cliente HTTP debe confiar en las root CAs públicas estándar (por defecto en todos los trust stores de OS/runtime modernos)

#### No fijes certificados ni IPs

WoowUp usa certificados gestionados que **rotan automáticamente**, y las direcciones IP de los endpoints **cambian sin previo aviso**. No hagas *certificate pinning* ni hardcodees IPs: conectá siempre por **hostname** y validá contra la cadena de CAs públicas. Fijar un certificado o una IP hará que tu integración falle cuando estos roten.

### Versiones de HTTP

WoowUp soporta:

* **HTTP/2** (negociado vía ALPN sobre TLS) — preferido, usado automáticamente por clientes modernos
* **HTTP/1.1**

### Checklist del cliente HTTP

* Usá **TLS 1.2 o superior** — por defecto en casi todo el software desde 2015 en adelante.
* Enviá **SNI** durante el handshake TLS (automático en clientes modernos).
* Confiá en las root CAs públicas estándar.
* Preferí **HTTP/2**; HTTP/1.1 está totalmente soportado.

Prestá atención a stacks muy viejos: Java < 8u161, OpenSSL < 1.0.1, Python < 2.7.9, .NET Framework < 4.6, o Windows Server 2008/2012 sin actualizaciones — pueden no negociar TLS 1.2 por defecto.

### Cómo probar

Confirmá que tu cliente negocia TLS 1.2+ correctamente:

```bash
openssl s_client -connect api.woowup.com:443 -servername api.woowup.com -tls1_2 </dev/null
```

Verificá la versión de TLS, cipher y versión de HTTP negociadas:

```bash
curl -v https://api.woowup.com/ 2>&1 | grep -iE "SSL connection|ALPN|HTTP/"
```

### Política de cambios de seguridad

WoowUp puede elevar la versión mínima de TLS o retirar cipher suites que dejen de considerarse seguros, para proteger la seguridad de las conexiones. Los cambios que puedan romper compatibilidad (por ejemplo, el retiro de una versión de TLS) se anuncian con **al menos 30 días de anticipación** a los contactos técnicos / de integración de cada cuenta, y se reflejan en esta página. Recomendamos mantener tu cliente HTTP con soporte de TLS actualizado y probar tu integración periódicamente (ver "Cómo probar").

### ¿Necesitás ayuda?

Si tu integración no puede negociar TLS 1.2 o un cipher suite soportado, contactá a soporte de WoowUp con los detalles de tu librería cliente y versión.


# Users

## Users&#x20;

## Create an user

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/apiv3/users`

Create an user. ***At least one of the parameters marked as required is mandatory for a successfull request***. For example, you can create an user with only document or only email, or both at the same time.

#### Request Body

| Name                       | Type    | Description                                                                                                         |
| -------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| document                   | string  | User's legal ID                                                                                                     |
| email                      | string  |                                                                                                                     |
| telephone                  | string  |                                                                                                                     |
| service\_uid               | string  | User's External identifier                                                                                          |
| first\_name                | string  | User's name                                                                                                         |
| last\_name                 | string  | User's last name                                                                                                    |
| birthdate                  | string  | Format: yyyy-mm-dd                                                                                                  |
| gender                     | string  | Values: "F", "M"                                                                                                    |
| street                     | string  | Customer's address                                                                                                  |
| postcode                   | string  |                                                                                                                     |
| city                       | string  |                                                                                                                     |
| department                 | string  |                                                                                                                     |
| state                      | string  |                                                                                                                     |
| country                    | string  | Country's ISO 3166-1 alpha-3 code                                                                                   |
| document\_type             | string  | User's legal ID type                                                                                                |
| marital\_status            | string  | Values: "single", "commited", "married", "divorced", "widowed".                                                     |
| tags                       | string  | Comma separated tags, ex: tag1, tag2, tag3.                                                                         |
| points                     | integer | User's points.                                                                                                      |
| mailing\_enabled           | string  | The user can or can't receive emails. Values: "enabled", "disabled".                                                |
| mailing\_disabled\_reason  | string  | Reason why the user can't receive emails. Values: "bounce", "unsubscribe", "spamreport", "dropped", "other".        |
| whatsapp\_enabled          | string  | The user can or can't receive Whatsapp. Values: "enabled", "disabled".                                              |
| whatsapp\_disabled\_reason | string  | Reason why the user can't receive Whatsapp. Values: "bounce", "unsubscribe", "spamreport", "dropped", "other".      |
| sms\_enabled               | string  | The user can or can't receive text messages. Values: "enabled", "disabled".                                         |
| sms\_disabled\_reason      | string  | Reason why the user can't receive text messages. Values: "bounce", "unsubscribe", "spamreport", "dropped", "other". |
| club\_inscription\_date    | string  |                                                                                                                     |
| custom\_attributes         | array   | Key value pair with user's additional information. Definition of these attributes must be previosly created.        |

{% tabs %}
{% tab title="200 Request successful" %}

```
{
    "payload": {
        //user-body
    },
    "message": "",
    "code": "ok",
    "time": "XXms"
}
```

{% endtab %}

{% tab title="400 Invalid parameters. View message for more details" %}

```
{
    "payload": {
        "errors": [
            "first_error_message",
            "second_error_message"
        ]
    },
    "message": "bad request",
    "code": "bad_request",
    "time": "XXms"
}
```

{% endtab %}

{% tab title="429 API's request-per-second limit exceeded" %}

```
```

{% endtab %}

{% tab title="500 Unexpected error" %}

```
{
    "payload": [],
    "message":"some_message",
    "code": "internal_error",
    "time": "XXms"
}
```

{% endtab %}
{% endtabs %}

**Example**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X POST \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    -d '{"email": "test@email.com", "first_name": "John", "last_name": "Doe", "country" : "USA"}' "https://api.woowup.com/apiv3/users"
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://api.woowup.com/apiv3/users');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"email\": \"test@email.com\", \"first_name\": \"John\", \"last_name\": \"Doe\", \"country\" : \"USA\"}");

$headers = array();
$headers[] = 'Accept: application/json';
$headers[] = 'Authorization: Basic '.$apikey;
$headers[] = 'Content-Type: application/json';
$headers[] = 'Cache-Control: no-cache';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);
```

{% endtab %}

{% tab title="python3" %}

```python
import requests #pip install requests

url = "https://api.woowup.com/apiv3/users"

payload = "{\"email\": \"test@email.com\", \"first_name\": \"John\", \"last_name\": \"Doe\", \"country\" : \"USA\"}"
headers = {
    'Accept': "application/json",
    'Authorization': "Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    'Content-Type': "application/json",
    'Cache-Control': "no-cache",
    'cache-control': "no-cache"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Json Schema**

```javascript
{
	"$schema": "http://json-schema.org/draft-04/schema#",
	"description": "A representation of a user",
	"type": "object",
	"anyOf": [{
			"required": ["service_uid"]
		},{
			"required": ["email"]
		},{
			"required": ["document"]
		},{
			"required": ["telephone"]	
		}
	],
	"properties": {
		"service_uid": {"type": ["string", "null"]},
		"email": {"type": "string", "format": "email"},
		"first_name": {"type": "string"},
		"last_name": {"type": "string"},
		"telephone": {"type": "string"},
		"birthdate": {"type": "string"},
		"gender": {"type": "string", "pattern": "^[fFmM]{0,1}$"},
		"street": {"type": "string"},
		"address": {"type": "string"},
		"city": {"type": "string"},
		"state": {"type": "string"},
		"department": {"type": "string"},
		"country": {"type": "string"},
		"document": {"type": "string"},
		"document_type": {"type": "string"},
		"marital_status": {
			"type": "string",
			"enum": ["single", "commited", "married", "divorced", "widowed"]
		},
		"postcode": {"type": "string"},
		"tags": {"type": "string"},
		"points": {"type": "integer"},
		"custom_attributes": {"type": "object"},
		"mailing_enabled": {
			"type": "string",
			"enum": ["enabled", "disabled"]
		},
		"mailing_disabled_reason": {
			"type": "string",
			"enum": ["bounce", "unsubscribe", "spamreport", "dropped", "other"]
		},
		"whatsapp_enabled": {
			"type": "string",
			"enum": ["enabled", "disabled"]
		},
		"whatsapp_disabled_reason": {
			"type": "string",
			"enum": ["bounce", "unsubscribe", "spamreport", "dropped", "other"]
		},
		"sms_enabled": {
			"type": "string",
			"enum": ["enabled", "disabled"]
		},
		"sms_disabled_reason": {
			"type": "string",
			"enum": ["bounce", "unsubscribe", "spamreport", "dropped", "other"]
		},
		"club_inscription_date": {"type": "string"}
	}
}
```

**Example**

This is a valid json due to previous json schema

```javascript
{
	"email": "test@email.com",
	"first_name": "John",
	"last_name": "Doe",
	"country": "ARG",
    "custom_attributes": {
        "fecha_casamiento": "2017-08-03 14:00:00",
        "cantidad_autos": 2,
        "nombre_mascota": "Chuky",
        "edad_mascota": 5,
        "peso_mascota": 20.3,
        "vacunas_mascota": ["parvovirus", "moquillo", "hepatitis"]
    }
}
```

**Response**

```javascript
{
    "payload": {
        "userapp_id": XXXXXXXX,
        "user_id": YYYYYYYY,
        "app_id": ZZZ,
        "service_uid": null,
        "email": "test@email.com",
        "first_name": "John",
        "last_name": "Doe",
        "telephone": null,
        "birthday": null,
        "gender": null,
        "document": null,
        "document_type": null,
        "state": null,
        "city": null,
        "department": null,
        "address": null,
        "postal_code": null,
        "marital_status": null,
        "tags": null,
        "points": 0,
        "customform": [],
        "club_inscription_date": null,
        "blocked": false,
        "notes": null,
        "mailing_enabled": true,
        "mailing_enabled_reason": null,
        "whatsapp_enabled": true,
        "whatsapp_enabled_reason": null,
        "sms_enabled": true,
        "sms_enabled_reason": null,
        "custom_attributes": {
            "fecha_casamiento": "2017-08-03 14:00:00",
            "cantidad_autos": 2,
            "nombre_mascota": "Chuky",
            "edad_mascota": 5,
            "peso_mascota": 20.3,
            "vacunas_mascota": ["parvovirus", "moquillo", "hepatitis"]
        },
        "family": [],
        "createtime": "2019-02-01T21:26:18+00:00",
        "updatetime": null
    },
    "message": "",
    "code": "ok",
    "time": "28ms"
}
```

## Find an user (multi-id)

<mark style="color:blue;">`GET`</mark> `https://api.woowup.com/apiv3/multiusers/find`

Search and retrieve an user by different parameters: service\_uid, document and email. The priority of searching can be arranged for each WoowUp account.&#x20;

#### Query Parameters

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| document     | string |             |
| email        | string |             |
| telephone    | string |             |
| service\_uid | string |             |

{% tabs %}
{% tab title="200 User successfully found" %}

```
{
    "payload": {
        // User array
    },
    "message": "ok",
    "code": "ok",
    "time": "XXms"
}
```

{% endtab %}

{% tab title="404 User not found" %}

```
{
    "payload": [],
    "message": "User not found",
    "code": "user_not_found",
    "time": "6ms"
}
```

{% endtab %}

{% tab title="429 API's request-per-second limit exceeded" %}

```
```

{% endtab %}
{% endtabs %}

**Example**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X GET \
  'https://api.woowup.com/apiv3/multiusers/find?email=test@email.com' \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic xxxxxxxxxxxxxxxxx' \
  -H 'Content-Type: application/json'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/multiusers/find?email=test@email.com",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Accept: application/json",
    "Authorization: Basic xxxxxxxxxxxxxxxxx",
    "Content-Type: application/json",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests # pip install requests

url = "https://api.woowup.com/apiv3/multiusers/find"

querystring = {"email":"test@email.com"}

headers = {
    'Accept': "application/json",
    'Authorization': "Basic xxxxxxxxxxxxxxxxx",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
    "payload": {
        "userapp_id": 31173442,
        "user_id": 31157866,
        "app_id": 938,
        "service_uid": null,
        "email": "test@email.com",
        "first_name": "John",
        "last_name": "Doe",
        "telephone": null,
        "birthday": null,
        "gender": null,
        "document": null,
        "document_type": null,
        "state": null,
        "city": null,
        "department": null,
        "address": null,
        "postal_code": null,
        "marital_status": null,
        "tags": null,
        "points": 0,
        "customform": [],
        "club_inscription_date": null,
        "blocked": false,
        "notes": null,
        "mailing_enabled": true,
        "mailing_enabled_reason": null,
        "whatsapp_enabled": true,
        "whatsapp_enabled_reason": null,
        "sms_enabled": true,
        "sms_enabled_reason": null,
        "custom_attributes": [],
        "family": [],
        "createtime": "2019-02-01T21:26:18+00:00",
        "updatetime": "2019-02-01T21:26:18+00:00"
    },
    "message": "ok",
    "code": "ok",
    "time": "49ms"
}
```

## Find an user by service\_uid (DEPRECATED)

<mark style="color:blue;">`GET`</mark> `https://api.woowup.com/apiv3/users/{id}`

Return an user by id or Base64 encoded service\_uid.

#### Path Parameters

| Name | Type   | Description                            |
| ---- | ------ | -------------------------------------- |
| id   | string | User ID or Base64 encoded service\_uid |

{% tabs %}
{% tab title="200 Request successful" %}

```
```

{% endtab %}

{% tab title="404 Unknown user" %}

```
```

{% endtab %}

{% tab title="429 API's request-per-second limit exceeded" %}

```
```

{% endtab %}

{% tab title="500 Unexpected error" %}

```
```

{% endtab %}
{% endtabs %}

**Example**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X GET \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -H "Cache-Control: no-cache" \
    "https://api.woowup.com
"
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Accept: application/json",
    "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "Cache-Control: no-cache",
    "Content-Type: application/x-www-form-urlencoded",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests # pip install requests

url = "https://api.woowup.com"

headers = {
    'Accept': "application/json",
    'Authorization': "Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    'Content-Type': "application/x-www-form-urlencoded",
    'Cache-Control': "no-cache",
    'cache-control': "no-cache"
    }

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
    "payload": {
        "userapp_id": 2207258,
        "user_id": 2192714,
        "app_id": 123,
        "service_uid": "user_2192714@email.com",
        "email": "user_2192714@email.com",
        "first_name": "first name",
        "last_name": "last name",
        "telephone": "+1 123 4567 890",
        "birthday": "1989-06-22",
        "gender": "M",
        "state": "My state",
        "city": "New City",
        "street": "The Street",
        "postal_code": "12345",
        "points": 50,
        "points_pending": 12,
        "customform": {
            "dni": "123456789"
        },
        "club_inscription_date": "2017-01-22 18:26:16",
        "blocked": false,
        "notes": "is a good customer",
        "mailing_enabled": true,
        "mailing_enabled_reason": null,
        "whatsapp_enabled": true,
        "whatsapp_enabled_reason": null,
        "sms_enabled": true,
        "sms_enabled_reason": null,
        "family": [
        {
          "first_name": "josefina",
          "last_name": "sanchez",
          "relationship": "son",
          "birthdate": "2008-11-13",
          "gender": "F",
          "email": "email03@example.com",
          "uid": "123456789",
          "telephone": "5555-6666",
          "address": "Some Address 123"
        },
        {
          "first_name": "jose",
          "last_name": "sanchez",
          "relationship": "nephew",
          "birthdate": "1999-02-22",
          "gender": "M",
          "email": "email04@example.com",
          "uid": "123456788",
          "telephone": "5555-7777",
          "address": "Some Other Address 456"
        }
      ],
      "createtime": "2016-10-03T17:10:25+00:00",
      "updatetime": "2018-02-01T14:15:40+00:00"
    },
    "message":"ok",
    "code":"ok",
    "time":"100ms"
}
```

## User exist (multi-search)

<mark style="color:blue;">`GET`</mark> `https://api.woowup.com/apiv3/multiusers/exist`

Find out whether an user exists or not searching by service\_uid, document and/or email.&#x20;

#### Query Parameters

| Name         | Type   | Description                |
| ------------ | ------ | -------------------------- |
| document     | string | User's legal ID            |
| email        | string | User's email               |
| telephone    | string | User's telephone           |
| service\_uid | string | User's external identifier |

{% tabs %}
{% tab title="200 Request successful" %}

```
```

{% endtab %}

{% tab title="429 API's requests-per-second limit exceeded" %}

```
```

{% endtab %}

{% tab title="500 Unexpected error" %}

```
```

{% endtab %}
{% endtabs %}

**Example**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X GET \
  'https://api.woowup.com/apiv3/multiusers/exist?email=test@email.com' \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic xxxxxxxxxx' \
  -H 'Content-Type: application/json'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/multiusers/exist?email=test@email.com",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Accept: application/json",
    "Authorization: Basic xxxxxxxxxx",
    "Content-Type: application/json",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests # pip install requests

url = "https://api.woowup.com/apiv3/multiusers/exist"

querystring = {"email":"test@email.com"}

headers = {
    'Accept': "application/json",
    'Authorization': "Basic xxxxxxxxxx",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
    "payload": {
        "exist": true,
        "userapp_id": "31173442"
    },
    "message": "",
    "code": "ok",
    "time": "57ms"
}
```

## User exist by ID (DEPRECATED)

<mark style="color:blue;">`GET`</mark> `https://api.woowup.com/apiv3/users/{id}/exist`

Test if an user exists by id or encoded service\_uid

#### Path Parameters

| Name | Type   | Description                     |
| ---- | ------ | ------------------------------- |
| id   | string | User ID or encoded service\_uid |

{% tabs %}
{% tab title="200 Request successful" %}

```
```

{% endtab %}

{% tab title="429 API's requests-per-second limit exceeded" %}

```
```

{% endtab %}

{% tab title="500 Unexpected error" %}

```
```

{% endtab %}
{% endtabs %}

**Example**

```bash
curl -X GET \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -H "Cache-Control: no-cache" \
    "https://api.woowup.com/apiv3/users/12345/exist"
```

**Response**

```javascript
{
    "payload": {
        "exist": true
    },
    "message":"ok",
    "code":"ok",
    "time":"100ms"
}
```

## User belongs to segment

<mark style="color:blue;">`GET`</mark> `https://api.woowup.com/apiv3/users/{id}/belongsToSegment`

Test if an user belongs to a segment.

#### Path Parameters

| Name | Type   | Description                     |
| ---- | ------ | ------------------------------- |
| id   | string | User ID or encoded service\_uid |

#### Query Parameters

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| segment\_id | string | Segment id  |

{% tabs %}
{% tab title="200 Request successful" %}

```
```

{% endtab %}

{% tab title="400 Invalid parameters" %}

```
```

{% endtab %}

{% tab title="404 User not found" %}

```
```

{% endtab %}

{% tab title="429 API's requests-per-second limit exceeded" %}

```
```

{% endtab %}

{% tab title="500 Unexpected error" %}

```
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
    "payload": {
        "belongsToSegment": true
    },
    "message":"ok",
    "code":"ok",
    "time":"100ms"
}
```

## Update an user

<mark style="color:orange;">`PUT`</mark> `https://api.woowup.com/apiv3/multiusers`

Update an existing user. At least one of the parameters marked as required is mandatory for a successful request

#### Request Body

| Name                       | Type    | Description                                                                                                         |
| -------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| document                   | string  | User's legal ID                                                                                                     |
| email                      | string  |                                                                                                                     |
| telephone                  | string  |                                                                                                                     |
| service\_uid               | string  | User's external identifier                                                                                          |
| first\_name                | string  | User's name                                                                                                         |
| last\_name                 | string  | User's last name                                                                                                    |
| birthdate                  | string  | Format: yyyy-mm-dd                                                                                                  |
| gender                     | string  | Values: "F", "M"                                                                                                    |
| street                     | string  | Customer's address                                                                                                  |
| postcode                   | string  |                                                                                                                     |
| city                       | string  |                                                                                                                     |
| department                 | string  |                                                                                                                     |
| state                      | string  |                                                                                                                     |
| country                    | string  | Country's ISO 3166-1 alpha-3 code                                                                                   |
| document\_type             | string  | User's legal ID type                                                                                                |
| marital\_status            | string  | Values: "single", "commited", "married", "divorced", "widowed".                                                     |
| tags                       | string  | Comma separated tags, ex: tag1, tag2, tag3.                                                                         |
| points                     | integer | User's points.                                                                                                      |
| mailing\_enabled           | string  | The user can or can't receive emails. Values: "enabled", "disabled".                                                |
| mailing\_disabled\_reason  | string  | Reason why the user can't receive emails. Values: "bounce", "unsubscribe", "spamreport", "dropped", "other".        |
| whatsapp\_enabled          | string  | The user can or can't receive Whatsapp. Values: "enabled", "disabled".                                              |
| whatsapp\_disabled\_reason | string  | Reason why the user can't receive Whatsapp. Values: "bounce", "unsubscribe", "spamreport", "dropped", "other".      |
| sms\_enabled               | string  | The user can or can't receive text messages. Values: "enabled", "disabled".                                         |
| sms\_disabled\_reason      | string  | Reason why the user can't receive text messages. Values: "bounce", "unsubscribe", "spamreport", "dropped", "other". |
| club\_inscription\_date    | string  |                                                                                                                     |
| custom\_attributes         | array   | Key value pair with user's additional information. Definition of these attributes must be previosly created.        |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}

{% tab title="400 " %}

```
```

{% endtab %}

{% tab title="404 " %}

```
```

{% endtab %}

{% tab title="429 API's requests-per-second limit exceeded" %}

```
```

{% endtab %}

{% tab title="500 " %}

```
```

{% endtab %}
{% endtabs %}

**Example**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X PUT \
  https://api.woowup.com/apiv3/multiusers \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic xxxxxxxxxxxxxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
        "email": "test@email.com",
        "first_name": "John",
        "last_name": "Doe",
        "state": "CABA",
        "city": "Buenos Aires"
}'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/multiusers",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\"email\": \"test@email.com\",\"first_name\": \"John\",\"last_name\": \"Doe\",\"state\": \"CABA\",\"city\": \"Buenos Aires\"}",
  CURLOPT_HTTPHEADER => array(
    "Accept: application/json",
    "Authorization: Basic xxxxxxxxxxxxxxxxxxxx",
    "Content-Type: application/json",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests # pip install requests

url = "https://api.woowup.com/apiv3/multiusers"

payload = "{\"email\": \"test@email.com\",\"first_name\": \"John\",\"last_name\": \"Doe\",\"state\": \"CABA\",\"city\": \"Buenos Aires\"}"
headers = {
    'Accept': "application/json",
    'Authorization': "Basic xxxxxxxxxxxxxxxxxxxx",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("PUT", url, data=payload, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
    "payload": {
        "userapp_id": XXXXXXXX,
        "user_id": YYYYYYYY,
        "app_id": ZZZ,
        "service_uid": null,
        "email": "test@email.com",
        "first_name": "John",
        "last_name": "Doe",
        "telephone": null,
        "birthday": null,
        "gender": null,
        "document": null,
        "document_type": null,
        "state": "CABA",
        "city": "Buenos Aires",
        "department": null,
        "address": null,
        "postal_code": null,
        "marital_status": null,
        "tags": null,
        "points": 0,
        "customform": [],
        "club_inscription_date": null,
        "blocked": false,
        "notes": null,
        "mailing_enabled": true,
        "mailing_enabled_reason": null,
        "whatsapp_enabled": true,
        "whatsapp_enabled_reason": null,
        "sms_enabled": true,
        "sms_enabled_reason": null,
        "custom_attributes": [],
        "family": [],
        "createtime": "2019-02-01T21:26:18+00:00",
        "updatetime": "2019-02-05T21:34:35+00:00"
    },
    "message": "ok",
    "code": "ok",
    "time": "50ms"
}
```

## Update an user (DEPRECATED)

<mark style="color:orange;">`PUT`</mark> `https://api.woowup.com/apiv3/users/{id}`

Update an existing user.

#### Path Parameters

| Name | Type   | Description                     |
| ---- | ------ | ------------------------------- |
| id   | string | User ID or encoded service\_uid |

#### Request Body

| Name                      | Type    | Description                                                                                                            |
| ------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------- |
| service\_uid              | string  | Internal user ID                                                                                                       |
| document                  | string  | User's legal ID                                                                                                        |
| email                     | string  |                                                                                                                        |
| telephone                 | string  |                                                                                                                        |
| first\_name               | string  | User's name                                                                                                            |
| last\_name                | string  | User's last name                                                                                                       |
| birthdate                 | string  | Format: yyyy-mm-dd                                                                                                     |
| gender                    | string  | Values: "F", "M"                                                                                                       |
| street                    | string  | Customer's address                                                                                                     |
| postcode                  | string  |                                                                                                                        |
| city                      | string  |                                                                                                                        |
| department                | string  |                                                                                                                        |
| state                     | string  |                                                                                                                        |
| country                   | string  | Country's ISO 3166-1 alpha-3 code                                                                                      |
| document\_type            | string  | User's legal ID type                                                                                                   |
| marital\_status           | string  | Values: "single", "commited", "married", "divorced", "widowed".                                                        |
| tags                      | string  | Comma separated tags, ex: tag1, tag2, tag3.                                                                            |
| points                    | integer | User's points.                                                                                                         |
| mailing\_enabled          | string  | <p>The user can or can't receive emails. <br>Values: "enabled", "disabled".</p>                                        |
| mailing\_disabled\_reason | string  | <p>Reason why the user can't receive emails.<br>Values: "bounce", "unsubscribe", "spamreport", "dropped", "other".</p> |
| custom\_attributes        | array   | Key value pair with user's additional information. Definition of these attributes must be previosly created.           |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}

{% tab title="400 " %}

```
```

{% endtab %}

{% tab title="404 " %}

```
```

{% endtab %}

{% tab title="429 API's requests-per-second limit exceded" %}

```
```

{% endtab %}

{% tab title="500 " %}

```
```

{% endtab %}
{% endtabs %}

**Example**

```bash
curl -X PUT \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    -d '{"email": "test@gmail2.com", "service_uid": "test@gmail2.com", "gender": "F", "telephone": "123456789", "birthday": "1980-04-22"}' "https://api.woowup.com/apiv3/users/12345"
```

**Response**

```javascript
{
    "payload": {
        "userapp_id": 2207258,
        "user_id": 2192714,
        "app_id": 123,
        "service_uid": "user_2192714@email.com",
        "email": "user_2192714@email.com",
        "first_name": "first name",
        "last_name": "last name",
        "points": 50,
        "customform": {
            "dni": "123456789"
        },
        "custom_attributes": {
            "dni": "123456789",
            "fecha_casamiento": "2017-08-03 14:00:00",
            "cantidad_autos": 2,
            "nombre_mascota": "Chuky",
            "edad_mascota": 5
        }
    },
    "message":"ok",
    "code":"ok",
    "time":"100ms"
}
```

## Delete an user

<mark style="color:red;">`DELETE`</mark> `https://api.woowup.com/apiv3/multiusers`

Delete an user

#### Request Body

| Name         | Type   | Description                |
| ------------ | ------ | -------------------------- |
| document     | string |                            |
| email        | string |                            |
| telephone    | string |                            |
| service\_uid | string | User's external identifier |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "payload": [],
    "message": "ok",
    "code": "ok",
    "time": "98ms"
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
{
    "payload": {
        "errors": [
            "Failed matching any of the provided schemas."
        ]
    },
    "message": "bad request",
    "code": "bad_request",
    "time": "44ms"
}
```

{% endtab %}

{% tab title="403 " %}

```javascript
{
    "payload": [],
    "message": "forbidden: authentication failed",
    "code": "forbidden",
    "time": "7ms"
}
```

{% endtab %}

{% tab title="404 User not found" %}

```javascript
{
    "payload": [],
    "message": "User not found",
    "code": "user_not_found",
    "time": "72ms"
}
```

{% endtab %}

{% tab title="500 " %}

```javascript
{
    "payload": [],
    "message": "",
    "code": "internal_error",
    "time": "72ms"
}
```

{% endtab %}
{% endtabs %}

{% hint style="danger" %}
El borrado de usuarios puede tardar en verse reflejado en la plataforma.&#x20;
{% endhint %}

{% hint style="warning" %}
optional / required body parameters depend on multi-id settings
{% endhint %}

**Example**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X DELETE \
  https://api.woowup.com/apiv3/multiusers \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
	"email": "test@email.com",
	"document": "987654321"
}'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/multiusers",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_POSTFIELDS => "{\"email\": \"test@email.com\",\"document\": \"987654321\"}",
  CURLOPT_HTTPHEADER => array(
    "Accept: application/json",
    "Authorization: Basic XXXXXXXXXXXXXXXXXXXX",
    "Content-Type: application/json",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests # pip install requests

url = "https://api.woowup.com/apiv3/multiusers"

payload = "{\"email\": \"test@email.com\",\"document\": \"987654321\"}"
headers = {
    'Accept': "application/json",
    'Authorization': "Basic XXXXXXXXXXXXXXXXXXXX",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("DELETE", url, data=payload, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
    "payload": [],
    "message": "ok",
    "code": "ok",
    "time": "98ms"
}
```

>

## Delete users by segment

<mark style="color:red;">`DELETE`</mark> `https://api.woowup.com/apiv3/multiusers/bulk`

Delete users by segment

#### Request Body

| Name        | Type   | Description                       |
| ----------- | ------ | --------------------------------- |
| segment\_id | number |                                   |
| notify\_to  | string | email to receive the confirmation |

{% tabs %}
{% tab title="200 will be receive an email when the deletion process is finished" %}

```javascript
{
    "payload": {
        "request_id": "XXX"
    },
    "message": "ok",
    "code": "ok",
    "time": "111ms"
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
//bad_request
{
    "payload": {
        "errors": [
            "Required properties missing: [\"segment_id\"]"
        ]
    },
    "message": "bad request",
    "code": "bad_request",
    "time": "38ms"
}

//invalid_email
{
    "payload": [],
    "message": "Invalid email to notify",
    "code": "invalid_email",
    "time": "48ms"
}
```

{% endtab %}

{% tab title="403 " %}

```javascript
{
    "payload": [],
    "message": "forbidden: authentication failed",
    "code": "forbidden",
    "time": "7ms"
}
```

{% endtab %}

{% tab title="404 Segment not found" %}

```javascript
{
    "payload": [],
    "message": "Segment not found",
    "code": "segment_not_found",
    "time": "47ms"
}
```

{% endtab %}

{% tab title="500 " %}

```javascript
{
    "payload": [],
    "message": "",
    "code": "internal_error",
    "time": "72ms"
}
```

{% endtab %}
{% endtabs %}

**Example**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X DELETE \
  https://api.woowup.com/apiv3/multiusers/bulk \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
	"segment_id": 4321,
    "notify_to": "test@email.com"
}'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/multiusers/bulk",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_POSTFIELDS => "{\"segment_id\": \"4321\",\"notify_to\": \"test@email.com\"}",
  CURLOPT_HTTPHEADER => array(
    "Accept: application/json",
    "Authorization: Basic XXXXXXXXXXXXXXXXXXXX",
    "Content-Type: application/json",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests # pip install requests

url = "https://api.woowup.com/apiv3/multiusers/bulk"

payload = "{\"segment_id\": \"4321\",\"notify_to\": \"test@email.com\"}"
headers = {
    'Accept': "application/json",
    'Authorization': "Basic XXXXXXXXXXXXXXXXXXXX",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("DELETE", url, data=payload, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
    "payload": {
        "request_id": "XXX"
    },
    "message": "ok",
    "code": "ok",
    "time": "111ms"
}
```

{% hint style="danger" %}
El borrado por segmento puede tardar en verse reflejado en la plataforma. El tiempo de borrado es proporcional al volumen de datos a borrar.
{% endhint %}

## Register a new user into loyalty club (DEPRECATED)

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/apiv3/users/register`

Create and register a new user into loyalty club. This doesn't support multi-id. It is recommended to use this endpoint.

#### Request Body

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| service\_uid | string |             |
| email        | string |             |
| pass         | string |             |
| first\_name  | string |             |
| last\_name   | string |             |

{% tabs %}
{% tab title="200 Request successful." %}

```
{
  "payload":{
    "userapp_id": 12345,
    "user_id": 12345,
    "app_id": 123,
    "service_uid": "1122334455",
    "email": "user@example.com",
    "first_name": "firstname",
    "last_name": "lastname",
    "points": 50,
    "customform": {
      "cedula": "11223344"
    }
  },
  "message":"ok",
  "code":"ok",
  "time":"100ms"
}
```

{% endtab %}

{% tab title="400 Invalid parameters. View message for more details." %}

```
```

{% endtab %}

{% tab title="429 API's requests-per-second limit exceeded" %}

```
```

{% endtab %}

{% tab title="500 Unexpected error." %}

```
```

{% endtab %}
{% endtabs %}

## Create an user from newsletter (DEPRECATED)

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/apiv3/users/newsletter`

Create an user from newsletter and set a 'newsletter' tag. It does not support multi identification. For that purpose, please use this endpoint.

#### Request Body

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| service\_uid | string |             |
| email        | string |             |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}

{% tab title="429 API's requests-per-second limit exceeded" %}

```
```

{% endtab %}
{% endtabs %}

## Add points to an user

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/apiv3/multiusers/points`

Add/substract loyalty points to an existing user

#### Request Body

| Name         | Type    | Description                                                                                                                 |
| ------------ | ------- | --------------------------------------------------------------------------------------------------------------------------- |
| document     | string  |                                                                                                                             |
| email        | string  |                                                                                                                             |
| telephone    | string  |                                                                                                                             |
| service\_uid | string  |                                                                                                                             |
| concept      | string  | Concept for which you are adding points to the user. Values: manual, purchase, gift, survey\_response, register or referrer |
| points       | integer | Points to be added (could be less than zero)                                                                                |
| description  | string  | Additional description                                                                                                      |

{% tabs %}
{% tab title="200 Request successful" %}

```
```

{% endtab %}

{% tab title="400 Invalid parameters. View message for more details." %}

```
```

{% endtab %}

{% tab title="404 User not found." %}

```
```

{% endtab %}

{% tab title="429 API's requests-per-second limit exceeded" %}

```
```

{% endtab %}

{% tab title="500 Unexpected error." %}

```
```

{% endtab %}
{% endtabs %}

**Example**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X POST \
  https://api.woowup.com/apiv3/multiusers/points \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
	"email": "test@email.com",
	"concept": "purchase",
	"points": 200,
	"description": "Add points"
}'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/multiusers/points",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"email\": \"test@email.com\",\"concept\": \"purchase\",\"points\": 200,\"description\": \"Add points\"}",
  CURLOPT_HTTPHEADER => array(
    "Accept: application/json",
    "Authorization: Basic 7a3a72d12f544e2fa74307c3ec2786b0f39cb56c56d1c0edecf5860dd57cd3b1",
    "Content-Type: application/json",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests # pip install requests

url = "https://api.woowup.com/apiv3/multiusers/points"

payload = "{\"email\": \"test@email.com\",\"concept\": \"purchase\",\"points\": 200,\"description\": \"Add points\"}"
headers = {
    'Accept': "application/json",
    'Authorization': "Basic 7a3a72d12f544e2fa74307c3ec2786b0f39cb56c56d1c0edecf5860dd57cd3b1",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
    "payload": {
        "transaction_id": 465127654
    },
    "message": "ok",
    "code": "ok",
    "time": "32ms"
}
```

## Add points by user ID (DEPRECATED)

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/apiv3/users/{id}/points`

Add/substract points to an user by user ID or Base64 encoded service\_uid.

#### Path Parameters

| Name | Type   | Description                     |
| ---- | ------ | ------------------------------- |
| id   | string | User ID or encoded service\_uid |

#### Request Body

| Name        | Type    | Description                                                                                                                 |
| ----------- | ------- | --------------------------------------------------------------------------------------------------------------------------- |
| concept     | string  | Concept for which you are adding points to the user. Values: manual, purchase, gift, survey\_response, register or referrer |
| points      | integer | Points to be added (could be less than zero)                                                                                |
| description | string  | Additional description                                                                                                      |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}

{% tab title="400 " %}

```
```

{% endtab %}

{% tab title="429 API's requests-per-second limit exceeded" %}

```
```

{% endtab %}

{% tab title="500 " %}

```
```

{% endtab %}
{% endtabs %}

**JSON Request Format**

```javascript
    {
        "concept": "purchase|gift|survey_response|register|referrer",
        "points": "integer",
        "description": "string"
    }
```

**Example**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X POST \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    -d '{"concept": "gift", "points": "2123", "description": "test"}' "https://api.woowup.com/apiv3/users/123456/points"
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/users/123456/points",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"concept\": \"gift\", \"points\": \"2123\", \"description\": \"test\"}",
  CURLOPT_HTTPHEADER => array(
    "Accept: application/json",
    "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "Cache-Control: no-cache",
    "Content-Type: application/json",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests # pip install requests

url = "https://api.woowup.com/apiv3/users/123456/points"

payload = "{\"concept\": \"gift\", \"points\": \"2123\", \"description\": \"test\"}"
headers = {
    'Accept': "application/json",
    'Authorization': "Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    'Content-Type': "application/json",
    'Cache-Control': "no-cache",
    'cache-control': "no-cache"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
  "payload": {
    "transaction_id": 12345
  },
  "message": "ok",
  "code": "ok",
  "time": "100ms"
}
```

## Merge Users

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/apiv3/multiusers/merge`

Merge customers

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
|      | string |             |

#### Request Body

| Name | Type   | Description                                                                  |
| ---- | ------ | ---------------------------------------------------------------------------- |
| to   | object | Object with identification data from user (service\_uid, email, document)    |
| from | object | Object with identification data from user (service\_uid, email and document) |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

#### JSON Request format

```javascript
{
    "from": {
        "document": "987654321",
        "email": "from@email.com"
    },
    "to": {
        "document": "56789432",
        "email": "to@email.com"
    }
}
```

#### Example

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X POST \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    -d '{"from": {"document": "987654321","email": "from@email.com"},"to": {"document": "56789432","email": "to@email.com"}}' \
    "https://api.woowup.com/apiv3/multiusers/merge"
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/multiusers/merge",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"from\": {\"document\": \"987654321\",\"email\": \"from@email.com\"},\"to\": {\"document\": \"56789432\",\"email\": \"to@email.com\"}}",
  CURLOPT_HTTPHEADER => array(
    "Accept: application/json",
    "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "Cache-Control: no-cache",
    "Content-Type: application/json",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests # pip install requests

url = "https://api.woowup.com/apiv3/multiusers/merge"

payload = "{\"from\": {\"document\": \"987654321\",\"email\": \"from@email.com\"},\"to\": {\"document\": \"56789432\",\"email\": \"to@email.com\"}}"
headers = {
    'Accept': "application/json",
    'Authorization': "Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    'Content-Type': "application/json",
    'Cache-Control': "no-cache",
    'cache-control': "no-cache"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

#### Response

```javascript
{
  "payload": {},
  "message": "ok",
  "code": "ok",
  "time": "100ms"
}
```

## Transactions

## List user's transactions

<mark style="color:blue;">`GET`</mark> `https://api.woowup.com/apiv3/multiusers/transactions`

Retrieve and list filtered user's transactions

#### Query Parameters

| Name         | Type    | Description                                   |
| ------------ | ------- | --------------------------------------------- |
| document     | string  |                                               |
| email        | string  |                                               |
| telephone    | string  |                                               |
| service\_uid | string  |                                               |
| concept      | string  | See below for valid values                    |
| limit        | integer | Items per page returned. Default 25, max 100. |
| page         | string  | Number of page. First page is 0               |
| from         | string  | Format: yyyy-mm-dd                            |
| to           | string  | Format: yyyy-mm-dd                            |

{% tabs %}
{% tab title="200 Request successful" %}

```
```

{% endtab %}

{% tab title="400 Invalid parameters. View message for more details." %}

```
```

{% endtab %}

{% tab title="404 User not found" %}

```
```

{% endtab %}

{% tab title="429 API's requests-per-second limit exceeded" %}

```
```

{% endtab %}

{% tab title="500 Unexpected error" %}

```
```

{% endtab %}
{% endtabs %}

**Concept valid values**: 'return', 'sale', 'manual-load', 'register', 'refer', 'purchase-order', 'expiration', 'correct-answer', 'vtex-sale', 'survey', 'sale-invoice', 'points-give-away', 'email-campaign', 'transactional-email', 'survey-response', 'sms-campaign', 'abandoned-cart', 'release-by-products', 'release-by-sale', 'redeemed-points-in-sale', 'import-customer', 'ticket-solved', 'share', 'want', 'buy', 'compete', 'inquire', 'see', 'versus', 'challenge', 'share-video', 'mobile-challenge', 'multiple-choice', 'redeem', 'check-code', 'check-ticket'.

**Example**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X GET \
  'https://api.woowup.com/apiv3/multiusers/transactions?email=test@email.com' \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'Content-Type: application/json'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/multiusers/transactions?email=test@email.com",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Accept: application/json",
    "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxx",
    "Content-Type: application/json",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests # pip install requests

url = "https://api.woowup.com/apiv3/multiusers/transactions"

querystring = {"email":"test@email.com"}

headers = {
    'Accept': "application/json",
    'Authorization': "Basic xxxxxxxxxxxxxxxxxxxxxxxx",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
    "payload": [
        {
            "id": 465127654,
            "points": 200,
            "pending_points": 0,
            "createtime": "2019-02-05 22:05:06",
            "version": null,
            "branch": null,
            "description": "Add points",
            "concept": "sale-invoice",
            "data": {
                "purchase": null
            }
        },
        {
            "id": 199718788,
            "points": 0,
            "pending_points": 0,
            "createtime": "2015-07-07 17:35:02",
            "version": null,
            "branch": {
                "id": 5589,
                "name": "Venta Online"
            },
            "description": "",
            "concept": "sale-invoice",
            "data": {
                "purchase": {
                    "service_uid": null,
                    "invoice_number": "17432",
                    "channel": "web",
                    "purchase_detail": {
                        "items": [
                            {
                                "product_id": "30004",
                                "product_name": "Billetera mediana - Color : Negro",
                                "quantity": 1,
                                "price": 967.5
                            }
                        ]
                    },
                    "prices": {
                        "total": 967.5,
                        "gross": 967.5,
                        "discount": 0,
                        "shipping": 148.16,
                        "tax": 0,
                        "cost": 0
                    },
                    "points": 0,
                    "downloadtime": "2018-08-29 18:58:00",
                    "createtime": "2015-07-07 17:35:02",
                    "metadata": null,
                    "cancel_transaction_id": null,
                    "branch": {
                        "id": 5589,
                        "name": "Venta Online"
                    },
                    "payment": {
                        "type": "",
                        "brand": "Billetera Mediana * 1",
                        "name": null
                    },
                    "purchase_operator": null,
                    "pickup_store": null,
                    "promotions": null
                }
            }
        },
        {
            "id": 145900817,
            "points": 0,
            "pending_points": 0,
            "createtime": "2018-06-06 20:27:59",
            "version": null,
            "branch": {
                "id": 5554,
                "name": "Caballito"
            },
            "description": "",
            "concept": "sale-invoice",
            "data": {
                "purchase": {
                    "service_uid": null,
                    "invoice_number": "10F9DE3961EFE4145671AB3E17755482211161",
                    "channel": null,
                    "purchase_detail": {
                        "items": [
                            {
                                "product_id": "30021",
                                "product_name": "BILLETERA",
                                "quantity": 1,
                                "price": 2400
                            }
                        ]
                    },
                    "prices": {
                        "total": 1440,
                        "gross": 2400,
                        "discount": 960,
                        "shipping": 0,
                        "tax": 249.92,
                        "cost": 0
                    },
                    "points": 0,
                    "downloadtime": "2018-06-06 20:27:59",
                    "createtime": "2018-06-06 20:27:59",
                    "metadata": null,
                    "cancel_transaction_id": null,
                    "branch": {
                        "id": 5554,
                        "name": "Caballito"
                    },
                    "payment": null,
                    "purchase_operator": null,
                    "pickup_store": null,
                    "promotions": null
                }
            }
        }
    ],
    "message": "ok",
    "code": "ok",
    "time": "94ms"
}
```

## List user's transactions by id (DEPRECATED)

<mark style="color:blue;">`GET`</mark> `https://api.woowup.com/apiv3/users/{id}/transactions/`

Retrieve user's transactions by user ID or encoded service\_uid.

#### Path Parameters

| Name | Type   | Description                            |
| ---- | ------ | -------------------------------------- |
| id   | string | User ID or Base64 encoded service\_uid |

#### Query Parameters

| Name    | Type   | Description                                  |
| ------- | ------ | -------------------------------------------- |
| limit   | string | Items per page returned. Default 25, max 100 |
| page    | string | Number of page. First page is 0              |
| from    | string | Format: yyyy-mm-dd                           |
| to      | string | Format: yyyy-mm-dd                           |
| concept | string | See below for valid values                   |

{% tabs %}
{% tab title="200 Request successful" %}

```
```

{% endtab %}

{% tab title="400 Invalid parameters. View message for more details" %}

```
```

{% endtab %}

{% tab title="404 User not found" %}

```
```

{% endtab %}

{% tab title="429 API's requests-per-second limit exceeded" %}

```
```

{% endtab %}

{% tab title="500 Unexpected error" %}

```
```

{% endtab %}
{% endtabs %}

**Concept valid values**: 'return', 'sale', 'manual-load', 'register', 'refer', 'purchase-order', 'expiration', 'correct-answer', 'vtex-sale', 'survey', 'sale-invoice', 'points-give-away', 'email-campaign', 'transactional-email', 'survey-response', 'sms-campaign', 'abandoned-cart', 'release-by-products', 'release-by-sale', 'redeemed-points-in-sale', 'import-customer', 'ticket-solved', 'share', 'want', 'buy', 'compete', 'inquire', 'see', 'versus', 'challenge', 'share-video', 'mobile-challenge', 'multiple-choice', 'redeem', 'check-code', 'check-ticket'.

**Example**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X GET \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Cache-Control: no-cache" \
    "https://api.woowup.com/apiv3/users/12345/transactions"
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/users/12345/transactions",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Accept: application/json",
    "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "Cache-Control: no-cache",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests # pip install requests

url = "https://api.woowup.com/apiv3/users/12345/transactions"

headers = {
    'Accept': "application/json",
    'Authorization': "Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    'Cache-Control': "no-cache",
    'cache-control': "no-cache"
    }

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
 {
  "payload": [
    {
      "id": 154566,
      "points": 0,
      "pending_points": 0,
      "createtime": "2017-11-03 13:57:00",
      "version": null,
      "branch": {
        "id": 700,
        "name": "Central"
      },
      "description": "",
      "concept": "sale-invoice",
      "data": {
        "purchase": {
          "price": 3849,
          "cost": 0,
          "createtime": "2017-11-03 13:57:00",
          "invoice_number": "034535",
          "gross_total": 3700,
          "discount_total": 0,
          "shipping_total": 149,
          "tax_total": 0,
          "products_quantity": 1,
          "affiliate": null,
          "branch": {
            "id": 700,
            "name": "Central"
          },
          "payment": {
            "type": "credit",
            "brand": "Example Bank",
            "name": "Credit Card"
          }
        }
      }
    }
  ],
  "message": "ok",
  "code": "ok",
  "time": "100ms"
}
```

## Family members

## List user's family members (multi-id)

<mark style="color:blue;">`GET`</mark> `https://api.woowup.com/multiusers/members`

#### Query Parameters

| Name         | Type   | Description        |
| ------------ | ------ | ------------------ |
| document     | string | User's document    |
| email        | string | User's email       |
| telephone    | string | User's telephone   |
| service\_uid | string | User's external id |

{% tabs %}
{% tab title="200 " %}

```
{
    "payload": [
        {
            "id": 5183,
            "first_name": "John",
            "last_name": "Doe",
            "relationship": "sibling",
            "relationship_text": "hermano",
            "birthdate": null,
            "gender": null,
            "email": "johndoe@example.com",
            "uid": "johndoe@example.com",
            "telephone": null,
            "address": null
        },
        {
            "id": 5184,
            "first_name": "Bobby",
            "relationship": "pet_dog",
            "relationship_text": "perro",
            "birthdate": null,
            "gender": null,
            "email": "bobby_the_dog@example.com",
            "uid": "bobby_the_dog@example.com",
            "telephone": null,
            "address": null
        }
    ],
    "message": "ok",
    "code": "ok",
    "time": "34ms"
}
```

{% endtab %}
{% endtabs %}

## Create family member (multi-id)

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/multiusers/members`

#### Query Parameters

| Name         | Type   | Description        |
| ------------ | ------ | ------------------ |
| document     | string | User's document    |
| email        | string | User's email       |
| telephone    | string | User's telephone   |
| service\_uid | string | User's external id |

#### Request Body

| Name         | Type   | Description                                                                                                                 |
| ------------ | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| uid          | string | Family member's id                                                                                                          |
| email        | string |                                                                                                                             |
| first\_name  | string |                                                                                                                             |
| last\_name   | string |                                                                                                                             |
| telephone    | string |                                                                                                                             |
| birthdate    | string |                                                                                                                             |
| address      | string |                                                                                                                             |
| gender       | string | "f", "F", "m", "M"                                                                                                          |
| relationship | string | "son", "parent", "grandparent", "sibling", "friend", "espose", "grandson", "nephew", "pet\_dog", "pet\_cat", "pet", "other" |

{% tabs %}
{% tab title="200 " %}

```
{
    "payload" : {
        "id": 5183,
        "first_name": "John",
        "last_name": "Doe",
        "relationship": "sibling",
        "relationship_text": "hermano",
        "birthdate": null,
        "gender": null,
        "email": "johndoe@example.com",
        "uid": "johndoe@example.com",
        "telephone": null,
        "address": null
    },
    "message": "ok",
    "code": "ok",
    "time": "41ms"
}
```

{% endtab %}
{% endtabs %}

## Update family member (multi-id)

<mark style="color:orange;">`PUT`</mark> `https://api.woowup.com/multiusers/members`

#### Query Parameters

| Name         | Type   | Description        |
| ------------ | ------ | ------------------ |
| document     | string | User's document    |
| email        | string | User's email       |
| telephone    | string | User's telephone   |
| service\_uid | string | User's external id |

#### Request Body

| Name         | Type   | Description                                                                                                                 |
| ------------ | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| uid          | string | Family member's id                                                                                                          |
| email        | string |                                                                                                                             |
| first\_name  | string |                                                                                                                             |
| last\_name   | string |                                                                                                                             |
| telephone    | string |                                                                                                                             |
| birthdate    | string |                                                                                                                             |
| address      | string |                                                                                                                             |
| gender       | string | "f", "F", "m", "M"                                                                                                          |
| relationship | string | "son", "parent", "grandparent", "sibling", "friend", "espose", "grandson", "nephew", "pet\_dog", "pet\_cat", "pet", "other" |

{% tabs %}
{% tab title="200 " %}

```
{
    "payload" : {
        "id": 5183,
        "first_name": "John",
        "last_name": "Doe",
        "relationship": "sibling",
        "relationship_text": "hermano",
        "birthdate": null,
        "gender": null,
        "email": "johndoe@example.com",
        "uid": "johndoe@example.com",
        "telephone": null,
        "address": null
    },
    "message": "ok",
    "code": "ok",
    "time": "41ms"
}
```

{% endtab %}
{% endtabs %}

## Bulk-create family member (multi-id)

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/multiusers/members/bulk`

#### Query Parameters

| Name         | Type   | Description        |
| ------------ | ------ | ------------------ |
| document     | string | User's document    |
| email        | string | User's email       |
| telephone    | string | User's telephone   |
| service\_uid | string | User's external id |

#### Request Body

| Name         | Type   | Description                                                                                                                 |
| ------------ | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| uid          | string | Family member's id                                                                                                          |
| email        | string |                                                                                                                             |
| first\_name  | string |                                                                                                                             |
| last\_name   | string |                                                                                                                             |
| telephone    | string |                                                                                                                             |
| birthdate    | string |                                                                                                                             |
| address      | string |                                                                                                                             |
| gender       | string | "f", "F", "m", "M"                                                                                                          |
| relationship | string | "son", "parent", "grandparent", "sibling", "friend", "espose", "grandson", "nephew", "pet\_dog", "pet\_cat", "pet", "other" |

{% tabs %}
{% tab title="200 " %}

```
{
    "payload": [],
    "message": "",
    "code": "ok",
    "time": "37ms"
}
```

{% endtab %}
{% endtabs %}

### GET /users/{id}/members

Get user's family members

| Parameter | Type | Required | Description                     |
| --------- | ---- | -------- | ------------------------------- |
| id        | uri  | Yes      | User ID or encoded service\_uid |

**Example**

{% tabs %}
{% tab title="Bash" %}

```javascript
curl -X GET \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Cache-Control: no-cache" \
    "https://api.woowup.com/apiv3/users/12345/members"
```

{% endtab %}

{% tab title="PHP" %}

```python
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/users/12345/members",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Accept: application/json",
    "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "Cache-Control: no-cache",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests

url = "https://api.woowup.com/apiv3/users/12345/members"

headers = {
    'Accept': "application/json",
    'Authorization': "Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    'Cache-Control': "no-cache",
    'cache-control': "no-cache"
    }

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
 {
  "payload": [
      {
          "id": 11072,
          "first_name": "Juan",
          "last_name": "Perez",
          "relationship": "grandparent",
          "relationship_text": "abuelo",
          "birthdate": "1945-10-23",
          "gender": "M",
          "email": "3b5d2afa79e9dfbe98d119d51973b94a@email.com",
          "uid": "3b5d2afa79e9dfbe98d119d51973b94a@email.com",
          "telephone": "112233445566",
          "address": "Calle falsa 123"
      },
      {
          "id": 11073,
          "first_name": "Juan",
          "last_name": "Perez",
          "relationship": "parent",
          "relationship_text": "padre",
          "birthdate": null,
          "gender": "M",
          "email": "3b5d2afa79e9dfbe98d119d51973b94a@email.com",
          "uid": "3b5d2afa79e9dfbe98d119d51973b94a@email.com",
          "telephone": "112233445566",
          "address": "Calle falsa 123"
      }
  ],
  "message": "ok",
  "code": "ok",
  "time": "100ms"
}
```

**Errors**

| HttpCode | HttpCode Name     | Code                | Description                              |
| -------- | ----------------- | ------------------- | ---------------------------------------- |
| 200      | ok                | ok                  | Request successful                       |
| 404      | not found         | user\_not\_found    | User not found                           |
| 429      | too many requests | too\_many\_requests | API's requests-per-second limit exceeded |
| 500      | internal error    | internal\_error     | Unexpected error                         |

### POST /users/{id}/members

Add family member to an user

| Parameter | Type | Required | Description                     |
| --------- | ---- | -------- | ------------------------------- |
| id        | uri  | Yes      | User ID or encoded service\_uid |

**Json Schema**

```javascript
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A representation of a user",
        "type": "object",
        "required": ["relationship"],
        "properties": {
            "uid": { "type": "string", "minLength": 1 },
            "email": { "type": "string", "format": "email", "minLength": 1 },
            "first_name": { "type": "string" },
            "last_name": { "type": "string" },
            "telephone": { "type": "string" },
            "birthdate": { "type": "string" },
            "address": { "type": "string" },
            "gender": { "type": "string", "pattern": "^[fFmM]{0,1}$" },
            "relationship": {
                "type": "string",
                "enum": ["son", "parent", "grandparent", "sibling", "friend", "espose", "grandson", "nephew", "pet_dog", "pet_cat", "pet", "other"]
            },
            "new_relationship": {
                "type": "string",
                "enum": ["son", "parent", "grandparent", "sibling", "friend", "espose", "grandson", "nephew", "pet_dog", "pet_cat", "pet", "other"]
            }
        }
    }
```

**Errors**

| HttpCode | HttpCode Name     | Code                       | Description                                              |
| -------- | ----------------- | -------------------------- | -------------------------------------------------------- |
| 200      | ok                | ok                         | Request successful                                       |
| 400      | bad request       | bad\_request               | Invalid parameters, view message for more details        |
| 404      | not found         | user\_not\_found           | User not found                                           |
| 429      | too many requests | too\_many\_requests        | API's requests-per-second limit exceeded                 |
| 500      | internal error    | internal\_error            | Unexpected error                                         |
| 500      | internal error    | family\_member\_duplicated | The members already exist with that uid and relationship |

### POST /users/{id}/members/bulk

Add family members to an user

| Parameter | Type | Required | Description                     |
| --------- | ---- | -------- | ------------------------------- |
| id        | uri  | Yes      | User ID or encoded service\_uid |

**JSON Request Format**

```javascript
[
    {
        "relationship": "parent|grandparent|son|friend|sibling|espose",
        "first_name": "John",
        "last_name": "Doe",
        "email": "john@doe.com",
        "uid": "john@doe.com",
        "telephone": "123456789",
        "gender": "F|M",
        "birthdate": "YYYY-MM-DD",
        "address": "Av. Evergreen 123"
    }
]
```

**Response**

```javascript
{
  "payload": {},
  "message": "ok",
  "code": "ok",
  "time": "100ms"
}
```

**Errors**

| HttpCode | HttpCode Name     | Code                | Description                                       |
| -------- | ----------------- | ------------------- | ------------------------------------------------- |
| 200      | ok                | ok                  | Request successful                                |
| 400      | bad request       | bad\_request        | Invalid parameters, view message for more details |
| 404      | not found         | not\_found          | User not found                                    |
| 429      | too many requests | too\_many\_requests | API's requests-per-second limit exceeded          |
| 500      | internal error    | internal\_error     | Unexpected error                                  |

### PUT /users/{id}/members/{memberid}

Update user's family member

| Parameter | Type | Required | Description                     |
| --------- | ---- | -------- | ------------------------------- |
| id        | uri  | Yes      | User ID or encoded service\_uid |
| id        | uri  | Yes      | Member ID or encoded uid        |

**Json Schema**

```javascript
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A representation of a user",
        "type": "object",
        "required": ["relationship"],
        "properties": {
            "uid": { "type": "string", "minLength": 1 },
            "email": { "type": "string", "format": "email", "minLength": 1 },
            "first_name": { "type": "string" },
            "last_name": { "type": "string" },
            "telephone": { "type": "string" },
            "birthdate": { "type": "string" },
            "address": { "type": "string" },
            "gender": { "type": "string", "pattern": "^[fFmM]{0,1}$" },
            "relationship": {
                "type": "string",
                "enum": ["son", "parent", "grandparent", "sibling", "friend", "espose", "grandson", "nephew", "pet_dog", "pet_cat", "pet", "other"]
            },
            "new_relationship": {
                "type": "string",
                "enum": ["son", "parent", "grandparent", "sibling", "friend", "espose", "grandson", "nephew", "pet_dog", "pet_cat", "pet", "other"]
            }
        }
    }
```

**Errors**

| HttpCode | HttpCode Name     | Code                | Description                                       |
| -------- | ----------------- | ------------------- | ------------------------------------------------- |
| 200      | ok                | ok                  | Request successful                                |
| 400      | bad request       | bad\_request        | Invalid parameters, view message for more details |
| 429      | too many requests | too\_many\_requests | API's requests-per-second limit exceeded          |
| 404      | not found         | user\_not\_found    | User not found                                    |
| 404      | not found         | member\_not\_found  | Family member not found                           |
| 500      | internal error    | internal\_error     | Unexpected error                                  |

## Real-time search

<mark style="color:blue;">`GET`</mark> `https://api.woowup.com/apiv3/users/realtime-search`

Provide a quick users search for real-time operations like for example search users on your point of sale

#### Query Parameters

| Name   | Type   | Description                                                                            |
| ------ | ------ | -------------------------------------------------------------------------------------- |
| limit  | number | Defaullt 25. Max 100 per page                                                          |
| page   | number | Default 0                                                                              |
| search | string | Search by first name, last name, email, document, telephone and external identificator |

{% tabs %}
{% tab title="200 For example searching users by <https://api.woowup.com/apiv3/users/realtime-search?search=@email.com>" %}

```
{
    "payload": [{
      "userapp_id": 1111111,
      "user_id": 222222,
      "app_id": 123,
      "service_uid": "user1@email.com",
      "email": "user1@email.com",
      "first_name": "Juan Miguel",
      "last_name": "Velez",
      "document": "34567890",
      "telephone": "1234-5678",
      "birthday": "1999-07-06",
      "gender": "M",
      "state": "Some State",
      "city": "Some City",
      "street": "Some street",
      "postal_code": "12345",
      "tags": ['tag1', 'tag2'],
      "points": 494,
      "customform": [

      ],
      "family":[],
      "createtime": "2016-10-03T17:10:25+00:00",
      "updatetime": "2018-02-01T14:15:40+00:00"
    },
    {
      "userapp_id": 333333,
      "user_id": 444444,
      "app_id": 123,
      "service_uid": "user2@email.com",
      "email": "user2@email.com",
      "first_name": "juana manuela",
      "last_name": "carbajal",
      "document": "23456789",
      "telephone": "1234-5678",
      "birthday": "1998-02-11",
      "gender": "F",
      "state": "Some State",
      "city": "Some City",
      "street": "Some street",
      "postal_code": "12345",
      "tags": null,
      "points": 0,
      "customform": [

      ],
      "family": [
        {
          "first_name": "josefina",
          "last_name": "sanchez",
          "relationship": "son",
          "birthdate": "2008-11-13",
          "gender": "F",
          "email": "email03@example.com",
          "uid": "123456789",
          "telephone": "5555-6666",
          "address": "Some Address 123"
        },
        {
          "first_name": "jose",
          "last_name": "sanchez",
          "relationship": "nephew",
          "birthdate": "1999-02-22",
          "gender": "M",
          "email": "email04@example.com",
          "uid": "123456788",
          "telephone": "5555-7777",
          "address": "Some Other Address 456"
        }
      ],
      "createtime": "2016-10-03T17:10:25+00:00",
      "updatetime": "2018-02-01T14:15:40+00:00"
    }],
    "message":"ok",
    "code":"ok",
    "time":"100ms"
}
```

{% endtab %}
{% endtabs %}


# Purchases

### POST /purchases

Create a new purchase. This endpoint is ***near real time***, the purchase will be enqueued to be processed.

**Important: only one of the customers identifier** (email, document, service\_uid) **is required** so the API can relate the purchase to an use&#x72;**. Using hard identifiers is highly recommended.**

{% hint style="danger" %}
Maximum size of data sent is **256KB**
{% endhint %}

The json with the purchase should be valid with the following [json-schema](http://json-schema.org/)

**Request content format**

```
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "A representation of a purchase",
    "type": "object",
    "anyOf": [
        {"required": ["service_uid", "invoice_number", "purchase_detail", "prices"]},
        {"required": ["email", "invoice_number", "purchase_detail", "prices"]},
        {"required": ["document", "invoice_number", "purchase_detail", "prices"]},
        {"required": ["telephone", "invoice_number", "purchase_detail", "prices"]}
    ],
    "properties": {
        "service_uid": { "type": "string" },
        "email": { "type": "string" },
        "document": { "type": "string" },
        "telephone": { "type": "string" },
        "points": { "type": "number", "multipleOf": 1 },
        "invoice_number": { "type": ["string", "integer"] },
        "channel":{"type": "string",
                    "enum": ["web","telephone", "in-store", "corporate", "direct", "other"]
                },
        "purchase_detail": {
            "type": "array",
            "items": {
                "type": "object",
                "required": ["sku", "quantity", "unit_price"],
                "properties": {
                    "sku": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^[^-][a-zA-Z0-9_%-]+$"
                    },
                    "base_name": {"type": "string"},
                    "product_name": {"type": "string"},
                    "category": {
                        "type": "array",
                        "items": {
                            "oneOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "object",
                                    "required": ["id", "name" ],
                                    "properties": {
                                        "id": { "type": "string" },
                                        "name": { "type": "string" },
                                        "url": { "type": "string" },
                                        "image_url": { "type": "string" }
                                    }
                                }
                            ]
                        }
                    },
                    "quantity": { "type": "integer" },
                    "unit_price": { "type": "number" },
                    "variations": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": ["name", "value"],
                            "properties": {
                                "name": {"type": "string"},
                                "value": {"type": "string"}
                            }
                        }
                    },
                    "specifications": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": ["name", "value"],
                            "properties": {
                                "name": { "type": "string" },
                                "value": { "type": "string" }
                            }
                        }
                    },
                    "brand": {"type": "string"},
                    "description": {"type": "string"},
                    "url": {"type": "string"},
                    "image_url": {"type": "string"},
                    "thumbnail_url": {"type": "string"},
                    "stock": {"type": "number"},
                    "available": {"type": "boolean"},
                    "manufacturer_warranty_date": {"type": "date"},
                    "extension_warranty_date": {"type": "date"},
                    "with_extension_warranty": {"type": "boolean"},
                    "custom_attributes": { "type": "object" }
                }
            }
        },
        "prices": {
            "type": "object",
            "required": ["total"],
            "properties": {
                "cost": { "type": "number" },
                "shipping": { "type": "number" },
                "gross": { "type": "number" },
                "tax": { "type": "number" },
                "discount": { "type": "number" },
                "total": { "type": "number" }
            }
        },
        "payment": {
            "oneOf": [
                {
                    "type": "object",
                    "required": ["type"],
                    "properties": {
                        "type":  { "type": "string",
                        "enum": ['credit', 'debit', 'cash', 'mercadopago', 'other']
                        },
                        "brand": { "type": "string" },
                        "bank":  { "type": "string" },
                        "total":  { "type": "float" },
                        "installments":  { "type": "integer" },
                        "card_first_digits":  { "type": "string", "pattern": "^[0-9]{6}$" }
                    }
                },
                {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "required": ["type","total"],
                        "properties": {
                            "type":  { "type": "string",
                            "enum": ['credit', 'debit', 'cash', 'mercadopago', 'other']
                            },
                            "brand": { "type": "string" },
                            "bank":  { "type": "string" },
                            "total":  { "type": "float" },
                            "installments":  { "type": "integer" },
                            "card_first_digits":  { "type": "string", "pattern": "^[0-9]{6}$" }
                        }
                    }
                }
            ]
        },
        "branch_name": { "type": "string" },
        "seller": {
            "type": "object",
            "required": ["name", "email"],
            "properties": {
                "name": { "type": "string"},
                "email": { "type": "string", "format": "email" },
                "external_id": { "type": "string" }
            }
        },
        "createtime": { "type": "string" },
        "approvedtime": { "type": "string" },
        "metadata": { "type": "object" },
        "custom_attributes": { "type": "object" }
    }
}
```

**Example**

This is a valid purchase according to the previous [json-schema](http://json-schema.org/):

```
{
  "document": "123456789",
  "points": 24,
  "invoice_number": "FAC-000085643",
  "channel": "web",
  "purchase_detail": [
    {
      "sku": "2907362",
      "product_name": "Heladera Patrick",
      "base_name": "Heladera Patrick",
      "category": [
        { "id": "a", "name": "Electrodomésticos"},
        { "id": "a-b", "name": "Linea blanca"},
        { "id": "a-b-c", "name": "Heladeras"}
      ],
      "quantity": 1,
      "unit_price": 1999.00,
      "variations": [
        {
          "name": "Volumen",
          "value": "100 lts"
        }
      ],
      "brand": "Patrick",
      "description": "Su capacidad total de almacenamiento es de 280 litros. El espacio para refrigerador cuenta con 204 litros para ordenar alimentos y bebidas y el freezer tiene un total de 76 litros para congelados.",
      "url": "http://www.example.com/example",
      "image_url": "http://www.example.com/example",
      "thumbnail_url": "http://www.example.com/example",
      "stock": 10,
      "available": true,
      "specifications": [
        {"name": "Garantia del Fabricante", "value": "12 meses"},
        {"name": "Alto", "value": "143.3 cm"},
        {"name": "Ancho", "value": "60.9 cm"}
      ],
      "manufacturer_warranty_date": "2018-12-31 23:59:59",
      "extension_warranty_date": "2020-12-31 23:59:59",
      "with_extension_warranty": true,
      "custom_attributes": { 
        "millas_aerolineas_plus": 300,
        "codigo_dto": "2354XFD45" 
      }
    }
  ],
  "prices": {
    "cost": 800.00,
    "shipping": 120.00,
    "gross": 1800.00,
    "tax": 199.00,
    "discount": 100.00,
    "total": 1899.00
  },
  "payment":{
    "type":"credit",
    "brand":"Visa",
    "bank": "Example Bank",
    "total": 1899.00,
    "installments": 12,
    "card_first_digits": "123456"
  },
  "branch_name": "Palermo I",
  "seller":{
    "name": "Seller Relles",
    "email": "seller@email.com",
    "external_id": "0001"
  },
  "createtime": "2017-03-23 14:35:22",
  "approvedtime": "2017-03-23 14:35:22",
  "custom_attributes": { 
    "fecha_max_cambio": "2017-03-26"
  }
}
```

This is an example:

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X POST \
  https://api.woowup.com/apiv3/purchases \
  -H 'accept: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  -d '{
  "document": "123456789",
  "points": 24,
  "invoice_number": "FAC-000085643",
  "channel": "web",
  "purchase_detail": [
    {
      "sku": "2907362",
      "product_name": "Heladera Patrick",
      "base_name": "Heladera Patrick",
      "category": [
        { "id": "a", "name": "Electrodomésticos"},
        { "id": "a-b", "name": "Linea blanca"},
        { "id": "a-b-c", "name": "Heladeras"}
      ],
      "quantity": 1,
      "unit_price": 1999.00,
      "variations": [
        {
          "name": "Volumen",
          "value": "100 lts"
        }
      ],
      "brand": "Patrick",
      "description": "Su capacidad total de almacenamiento es de 280 litros. El espacio para refrigerador cuenta con 204 litros para ordenar alimentos y bebidas y el freezer tiene un total de 76 litros para congelados.",
      "url": "http://www.example.com/example",
      "image_url": "http://www.example.com/example",
      "thumbnail_url": "http://www.example.com/example",
      "stock": 10,
      "available": true,
      "specifications": [
        {"name": "Garantia del Fabricante", "value": "12 meses"},
        {"name": "Alto", "value": "143.3 cm"},
        {"name": "Ancho", "value": "60.9 cm"}
      ],
      "manufacturer_warranty_date": "2018-12-31 23:59:59",
      "extension_warranty_date": "2020-12-31 23:59:59",
      "with_extension_warranty": true,
      "custom_attributes": { 
        "millas_aerolineas_plus": 300,
        "codigo_dto": "2354XFD45" 
      }
    }
  ],
  "prices": {
    "cost": 800.00,
    "shipping": 120.00,
    "gross": 1800.00,
    "tax": 199.00,
    "discount": 100.00,
    "total": 1899.00
  },
  "payment":{
    "type":"credit",
    "brand":"Visa",
    "bank": "Example Bank",
    "total": 1899.00,
    "installments": 12,
    "card_first_digits": "123456"
  },
  "branch_name": "Palermo I",
  "seller":{
    "name": "Seller Relles",
    "email": "seller@email.com",
    "external_id": "0001"
  },
  "createtime": "2017-03-23 14:35:22",
  "approvedtime": "2017-03-23 14:35:22",
  "custom_attributes": { 
    "fecha_max_cambio": "2017-03-26"
  }
}'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$purchase = {{purchase}};

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/purchases",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $purchase,
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "cache-control: no-cache,no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests

url = "https://api.woowup.com/apiv3/purchases"

payload = {{purchase}}
headers = {
    'accept': "application/json",
    'authorization': "Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    'cache-control': "no-cache,no-cache"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Errors**

| HttpCode | HttpCode Name     | Code                         | Description                                       |
| -------- | ----------------- | ---------------------------- | ------------------------------------------------- |
| 200      | ok                | ok                           | Purchase successfully saved                       |
| 400      | bad request       | bad\_request                 | Invalid parameters, view message for more details |
| 429      | too many requests | too\_many\_requests          | API's requests-per-second limit exceeded          |
| 500      | internal error    | user\_not\_found             | User not found                                    |
| 500      | internal error    | duplicated\_purchase\_number | Duplicated purchase number                        |
| 500      | internal error    | internal\_error              | Unexpected error                                  |

### POST /purchases/bulk

Create multiple purchases in one request. This endpoint is equal to `/purchases` but accept an array of purchases. This is an example with 2 purchases in one request:

{% hint style="danger" %}
Maximum size per purchase sent is **256KB**
{% endhint %}

```bash
curl -X POST \
  https://api.woowup.com/apiv3/purchases \
  -H 'accept: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  -d '[{
  "document": "123456789",
  "points": 24,
  "invoice_number": "FAC-000085643",
  "channel": "web",
  "purchase_detail": [
    {
      "sku": "2907362",
      "product_name": "Heladera Patrick",
      "base_name": "Heladera Patrick",
      "category": [
        { "id": "a", "name": "Electrodomésticos"},
        { "id": "a-b", "name": "Linea blanca"},
        { "id": "a-b-c", "name": "Heladeras"}
      ],
      "quantity": 1,
      "unit_price": 1999.00,
      "variations": [
        {
          "name": "Volumen",
          "value": "100 lts"
        }
      ],
      "brand": "Patrick",
      "description": "Su capacidad total de almacenamiento es de 280 litros. El espacio para refrigerador cuenta con 204 litros para ordenar alimentos y bebidas y el freezer tiene un total de 76 litros para congelados.",
      "url": "http://www.example.com/example",
      "image_url": "http://www.example.com/example",
      "thumbnail_url": "http://www.example.com/example",
      "stock": 10,
      "available": true,
      "specifications": [
        {"name": "Garantia del Fabricante", "value": "12 meses"},
        {"name": "Alto", "value": "143.3 cm"},
        {"name": "Ancho", "value": "60.9 cm"}
      ],
      "custom_attributes": { 
      	"millas_aerolineas_plus": 300,
      	"codigo_dto": "2354XFD45" 
      }
    }
  ],
  "prices": {
    "cost": 800.00,
    "shipping": 120.00,
    "gross": 1800.00,
    "tax": 199.00,
    "discount": 100.00,
    "total": 1899.00
  },
  "payment":{
    "type":"debit",
    "brand":"Amex",
    "bank": "Example Bank"
  },
  "branch_name": "Palermo I",
  "createtime": "2017-03-23 14:35:22",
  "custom_attributes": { 
  	"fecha_max_cambio": "2017-03-26"
  }
},
{
  "document": "987654321",
  "points": 24,
  "invoice_number": "FAC-000085644",
  "purchase_detail": [
    {
      "sku": "2907362",
      "product_name": "TV Samsung",
      "base_name": "TV Samsung",
      "category": [
        { "id": "x", "name": "Electrodomésticos"},
        { "id": "x-y", "name": "Hogar"},
        { "id": "x-y-z", "name": "TV"}
      ],
      "quantity": 1,
      "unit_price": 3500.00,
      "variations": [
        {
          "name": "Tamaño",
          "value": "42 pulgadas"
        }
      ],
      "brand": "Samsung",
      "description": "Pasá videos, música y fotos desde tu móvil o PC a tu TV mediante una conexión sencilla gracias a la aplicación Samsung View.",
      "url": "http://www.example.com/example",
      "image_url": "http://www.example.com/example",
      "thumbnail_url": "http://www.example.com/example",
      "stock": 20,
      "available": true,
      "specifications": [
        {"name": "Profundidad (con base)", "value": "29.4 cm"},
        {"name": "Alto", "value": "71 cm"},
        {"name": "Ancho", "value": "110 cm"}
      ]
    }
  ],
  "prices": {
    "cost": 800.00,
    "shipping": 120.00,
    "gross": 3300.00,
    "tax": 200.00,
    "discount": 100.00,
    "total": 3400.00
  },
  "payment":{
    "type":"credit",
    "brand":"Visa",
    "bank": "Another Bank"
  },
  "branch_name": "Palermo I",
  "seller":{
    "name": "Seller Relles",
    "email": "seller@email.com",
    "external_id": "0001"
  },
  "createtime": "2017-03-23 14:35:22"
}]'
```

**Errors**

| HttpCode | HttpCode Name     | Code                         | Description                                       |
| -------- | ----------------- | ---------------------------- | ------------------------------------------------- |
| 200      | ok                | ok                           | Purchases successfully saved                      |
| 400      | bad request       | bad\_request                 | Invalid parameters, view message for more details |
| 429      | too many requests | too\_many\_requests          | API's requests-per-second limit exceeded          |
| 500      | internal error    | user\_not\_found             | User not found                                    |
| 500      | internal error    | duplicated\_purchase\_number | Duplicated purchase number                        |
| 500      | internal error    | internal\_error              | Unexpected error                                  |

### PUT /purchases

Update a purchase. This endpoint is ***near real time***, the purchase will be enqueued to be processed.

{% hint style="danger" %}
Maximum size of data sent is **256KB**
{% endhint %}

**Example**

This is a valid purchase according to the previous [json-schema](http://json-schema.org/):

```
{
  "document": "1234567890",
  "points": 24,
  "invoice_number": "FAC-000085643",
  "channel": "web",
  "purchase_detail": [
    {
      "sku": "2907362",
      "product_name": "Heladera Patrick",
      "base_name": "Heladera Patrick",
      "category": [
        { "id": "a", "name": "Electrodomésticos"},
        { "id": "a-b", "name": "Linea blanca"},
        { "id": "a-b-c", "name": "Heladeras"}
      ],
      "quantity": 1,
      "unit_price": 1999.00,
      "variations": [
        {
          "name": "Volumen",
          "value": "100 lts"
        }
      ],
      "brand": "Patrick",
      "description": "Su capacidad total de almacenamiento es de 280 litros. El espacio para refrigerador cuenta con 204 litros para ordenar alimentos y bebidas y el freezer tiene un total de 76 litros para congelados.",
      "url": "http://www.example.com/example",
      "image_url": "http://www.example.com/example",
      "thumbnail_url": "http://www.example.com/example",
      "stock": 10,
      "available": true,
      "specifications": [
        {"name": "Garantia del Fabricante", "value": "12 meses"},
        {"name": "Alto", "value": "143.3 cm"},
        {"name": "Ancho", "value": "60.9 cm"}
      ],
      "custom_attributes": { 
      	"millas_aerolineas_plus": 500,
      	"codigo_dto": "20054XFD46" 
      }
    }
  ],
  "prices": {
    "cost": 800.00,
    "shipping": 120.00,
    "gross": 1800.00,
    "tax": 199.00,
    "discount": 100.00,
    "total": 1899.00
  },
  "payment":{
    "type":"credit",
    "brand":"Visa",
    "bank": "Example Bank"
  },
  "branch_name": "Palermo I",
  "seller":{
    "name": "Seller Relles",
    "email": "seller@email.com",
    "external_id": "0001"
  },
  "createtime": "2017-03-23 14:35:22",
  "approvedtime": "2017-03-23 14:35:22",
  "custom_attributes": { 
	"fecha_max_cambio": "2017-03-30"
  }
}
```

This is an example:

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X PUT \
  https://api.woowup.com/apiv3/purchases \
  -H 'accept: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  -d '{
  "document": "1234567890",
  "points": 24,
  "invoice_number": "FAC-000085643",
  "channel": "web",
  "purchase_detail": [
    {
      "sku": "2907362",
      "product_name": "Heladera Patrick",
      "base_name": "Heladera Patrick",
      "category": [
        { "id": "a", "name": "Electrodomésticos"},
        { "id": "a-b", "name": "Linea blanca"},
        { "id": "a-b-c", "name": "Heladeras"}
      ],
      "quantity": 1,
      "unit_price": 1999.00,
      "variations": [
        {
          "name": "Volumen",
          "value": "100 lts"
        }
      ],
      "brand": "Patrick",
      "description": "Su capacidad total de almacenamiento es de 280 litros. El espacio para refrigerador cuenta con 204 litros para ordenar alimentos y bebidas y el freezer tiene un total de 76 litros para congelados.",
      "url": "http://www.example.com/example",
      "image_url": "http://www.example.com/example",
      "thumbnail_url": "http://www.example.com/example",
      "stock": 10,
      "available": true,
      "specifications": [
        {"name": "Garantia del Fabricante", "value": "12 meses"},
        {"name": "Alto", "value": "143.3 cm"},
        {"name": "Ancho", "value": "60.9 cm"}
      ],
      "custom_attributes": { 
      	"millas_aerolineas_plus": 500,
      	"codigo_dto": "20054XFD46" 
      }
    }
  ],
  "prices": {
    "cost": 800.00,
    "shipping": 120.00,
    "gross": 1800.00,
    "tax": 199.00,
    "discount": 100.00,
    "total": 1899.00
  },
  "payment":{
    "type":"credit",
    "brand":"Visa",
    "bank": "Example Bank"
  },
  "branch_name": "Palermo I",
  "seller":{
    "name": "Seller Relles",
    "email": "seller@email.com",
    "external_id": "0001"
  },
  "createtime": "2017-03-23 14:35:22",
  "approvedtime": "2017-03-23 14:35:22",
  "custom_attributes": { 
	"fecha_max_cambio": "2017-03-30"
  }
}'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$purchase = {{purchase}};

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/purchases",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => $purchase,
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "cache-control: no-cache,no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests

url = "https://api.woowup.com/apiv3/purchases"

payload = {{purchase}}
headers = {
    'accept': "application/json",
    'authorization': "Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    'cache-control': "no-cache,no-cache"
    }

response = requests.request("PUT", url, data=payload, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Errors**

| HttpCode | HttpCode Name     | Code                         | Description                                       |
| -------- | ----------------- | ---------------------------- | ------------------------------------------------- |
| 200      | ok                | ok                           | Purchase successfully updated                     |
| 400      | bad request       | bad\_request                 | Invalid parameters, view message for more details |
| 429      | too many requests | too\_many\_request           | API's requests-per-second limit exceeded          |
| 500      | internal error    | user\_not\_found             | User not found                                    |
| 500      | internal error    | inexistent\_purchase\_number | Purchase number inexistent                        |
| 500      | internal error    | internal\_error              | Unexpected error                                  |

### GET /purchases

Search a purchase.

| Parameter       | Type  | Required | Description                           |
| --------------- | ----- | -------- | ------------------------------------- |
| invoice\_number | query | No       |                                       |
| service\_uid    | query | No       |                                       |
| branch\_name    | query | No       |                                       |
| branch\_id      | query | No       | Is only used together invoice\_number |

{% hint style="info" %}

```
Query by invoice_number returns only the first purchase created.
```

{% endhint %}

**Example**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X GET \
  -H 'accept: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  "https://api.woowup.com/apiv3/purchases?service_uid=12345"
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/purchases?service_uid=12345",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "cache-control: no-cache,no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests

url = "https://api.woowup.com/apiv3/purchases"

querystring = {"service_uid":"12345"}

headers = {
    'accept': "application/json",
    'authorization': "Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    'cache-control': "no-cache,no-cache",
    }

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

```
{
    "payload": [
        {
            "service_uid": "12345",
            "document": "23456789",
            "email" "email@example.com",
            "invoice_number": "00001",
            "channel": null,
            "purchase_detail": {
                "items": [
                    {
                        "product_id": "543V",
                        "product_name": "Manta Panal",
                        "quantity": 1,
                        "price": 1999,
                        "custom_attributes": {
                            "codigo_dto": "2354XFD45",
                            "millas_aerolineas_plus": 300
                        }
                    }
                ]
            },
            "prices": {
                "total": 1999,
                "gross": 1999,
                "discount": 0,
                "shipping": 0,
                "tax": 0,
                "cost": 0
            },
            "points": 0,
            "downloadtime": "2018-05-10 23:30:49",
            "createtime": "2018-05-10 23:30:49",
            "custom_attributes": {
                "fecha_max_cambio": "2017-03-26 00:00:00"
            },
            "cancel_transaction_id": null,
            "branch": null,
            "payment": {
                "type": "other",
                "brand": null,
                "name": null
            },
            "purchase_operator": null,
            "pickup_store": "SHOPPING LOCAL 1",
            "promotions": null
        },
        {
            "service_uid": "12345",
            "document": "23456789",
            "email" "email@example.com",
            "invoice_number": "00002",
            "channel": null,
            "purchase_detail": {
                "items": [
                    {
                        "product_id": "123V",
                        "product_name": "Botas Color Rosa",
                        "quantity": 1,
                        "price": 1999
                    }
                ]
            },
            "prices": {
                "total": 1999,
                "gross": 1999,
                "discount": 0,
                "shipping": 0,
                "tax": 0,
                "cost": 0
            },
            "points": 0,
            "downloadtime": "2018-05-10 23:30:49",
            "createtime": "2018-05-10 23:30:49",
            "cancel_transaction_id": null,
            "branch": null,
            "payment": {
                "type": "other",
                "brand": null,
                "name": null
            },
            "purchase_operator": null,
            "pickup_store": "SHOPPING LOCAL 1",
            "promotions": null
        }
    ],
    "message": "ok",
    "code": "ok",
    "time": "62ms"
}
```

**Errors**

| HttpCode | HttpCode Name     | Code                | Description                                       |
| -------- | ----------------- | ------------------- | ------------------------------------------------- |
| 200      | ok                | ok                  | Request successful                                |
| 400      | bad request       | bad\_request        | Invalid parameters, view message for more details |
| 404      | not found         | not\_found          | Purchase not found                                |
| 429      | too many requests | too\_many\_requests | API's requests-per-second limit exceeded          |
| 500      | internal error    | internal\_error     | Unexpected error                                  |

### GET /purchases/iin/{firstSixDigits}

Retrieve information about bank by first six digits of credit/debit card

| Parameter      | Type | Required | Description                          |
| -------------- | ---- | -------- | ------------------------------------ |
| firstSixDigits | url  | Yes      | First six digit of credit/debit card |

#### Example

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X GET \
  -H 'accept: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  "https://api.woowup.com/apiv3/purchases/iin/123456"
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/purchases/iin/123456",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "cache-control: no-cache,no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests

url = "https://api.woowup.com/apiv3/purchases/iin/123456"

headers = {
    'accept': "application/json",
    'authorization': "Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    'cache-control': "no-cache,no-cache"
    }

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

#### Response

```javascript
{
    "payload": {
        "scheme": "visa",
        "brand": "Visa/Dankort",
        "type": "debit",
        "prepaid": "",
        "country": "DK",
        "bank": {
            "name": "Spar Nord",
            "logo": "",
            "url": "www.sparnord.dk",
            "phone": "",
            "city": ""
        }
    },
    "message": "ok",
    "code": "ok",
    "time": "109ms"
}
```

#### Errors

| HTTP Code | HTTP Code Name    | Decription        |
| --------- | ----------------- | ----------------- |
| 200       | Ok                | Succesful request |
| 404       | Not Found         | IIN not found     |
| 429       | Too Many Requests | Too Many Requests |
| 500       | Internal Error    | Unexpected error  |

## Delete purchase

<mark style="color:red;">`DELETE`</mark> `https://api.woowup.com/apiv3/purchases`

Delete a purchase

#### Request Body

| Name            | Type   | Description |
| --------------- | ------ | ----------- |
| invoice\_number | string |             |
| branch\_name    | string |             |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "payload": [],
    "message": "ok",
    "code": "ok",
    "time": "98ms"
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
{
    "payload": {
        "errors": [
            "Required properties missing: [\"invoice_number\"]"
        ]
    },
    "message": "bad request",
    "code": "bad_request",
    "time": "124ms"
}
```

{% endtab %}

{% tab title="403 " %}

```javascript
{
    "payload": [],
    "message": "forbidden: authentication failed",
    "code": "forbidden",
    "time": "7ms"
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
//purchase
{
    "payload": {
        "errors": [
            "purchase not found"
        ]
    },
    "message": "purchase not found",
    "code": "not_found",
    "time": "77ms"
}

//branch
{
    "payload": {
        "errors": [
            "branch not found"
        ]
    },
    "message": "branch not found",
    "code": "not_found",
    "time": "70ms"
}
```

{% endtab %}

{% tab title="500 " %}

```javascript
{
    "payload": [],
    "message": "",
    "code": "internal_error",
    "time": "72ms"
}
```

{% endtab %}
{% endtabs %}

**Example**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X DELETE \
  https://api.woowup.com/apiv3/purchases \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
	"invoice_number": "987654321"
}'
```

{% endtab %}

{% tab title="PHP" %}

```php
```

{% endtab %}

{% tab title="python3" %}

```python
import requests

url = "https://api.woowup.com/apiv3/purchases"

payload = "{\"invoice_number\": \"987654321\"}"
headers = {
    'Accept': "application/json",
    'Authorization': "Basic XXXXXXXXXXXXXXXXXXXX",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("DELETE", url, data=payload, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
    "payload": [],
    "message": "ok",
    "code": "ok",
    "time": "98ms"
}
```

## Delete purchases (bulk)

<mark style="color:red;">`DELETE`</mark> `https://api.woowup.com/apiv3/purchases/bulk`

#### Request Body

| Name         | Type   | Description                                   |
| ------------ | ------ | --------------------------------------------- |
| branch\_name | string |                                               |
| from         | string | date format YYYY-MM-DD hh:mm:ss (in UTC time) |
| to           | string | date format YYYY-MM-DD hh:mm:ss (in UTC-time) |
| notify\_to   | string | email to receive the confirmation             |

{% tabs %}
{% tab title="200 will be receive an email when the deletion process is finished" %}

```javascript
{
    "payload": {
        "request_id": "XXX"
    },
    "message": "ok",
    "code": "ok",
    "time": "111ms"
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
//bad_request
{
    "payload": {
        "errors": [
            "Failed matching any of the provided schemas."
        ]
    },
    "message": "bad request",
    "code": "bad_request",
    "time": "38ms"
}

//invalid_email
{
    "payload": [],
    "message": "Invalid email to notify",
    "code": "invalid_email",
    "time": "48ms"
}
```

{% endtab %}

{% tab title="403 " %}

```javascript
{
    "payload": [],
    "message": "forbidden: authentication failed",
    "code": "forbidden",
    "time": "7ms"
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
//branch
{
    "payload": {
        "errors": [
            "branch not found"
        ]
    },
    "message": "branch not found",
    "code": "not_found",
    "time": "70ms"
}
```

{% endtab %}

{% tab title="500 " %}

```javascript
{
    "payload": [],
    "message": "",
    "code": "internal_error",
    "time": "72ms"

```

{% endtab %}
{% endtabs %}

**Very (VERY) important**

> Both dates 'from' and 'to' must be specified in UTC time. For example we want 'from' date to be August 22nd 2019 at 3 p.m in Argentina. As Argentina's timezone is UTC-3, 'from' will be set as '2019-08-22 16:00:00'

{% hint style="warning" %}
optional / required body parameters

```javascript
        "anyOf": [
            {"required": ["branch_name"]},
            {"required": ["from", "to"]}
        ]
```

{% endhint %}

**Example**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X DELETE \
  https://api.woowup.com/apiv3/purchases/bulk \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
	"from": "2019-07-01",
	"to": "2019-07-31",
    "notify_to": "test@email.com"
}'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

$payload = [
    "from" => "2019-07-01",
    "to" => "2019-07-31",
    "notify_to" => "test@noemail.com",
];

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.woowup.com/apiv3/purchases/bulk",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_POSTFIELDS => json_encode($payload),
  CURLOPT_HTTPHEADER => array(
    "Accept: application/json",
    "Authorization: Basic XXXXXXXXXXXXXXXXXXXX",
    "Content-Type: application/json",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="python3" %}

```python
import requests

url = "https://api.woowup.com/apiv3/purchases/bulk"

payload = {
    "from": "2019-07-01",
    "to": "2019-07-31",
    "notify_to": "test@noemail.com"
    }

headers = {
    'Accept': "application/json",
    'Authorization': "Basic XXXXXXXXXXXXXXXXXXXX",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("DELETE", url, data=payload, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
    "payload": {
        "request_id": "XXX"
    },
    "message": "ok",
    "code": "ok",
    "time": "111ms"
}
```

**Practical example**

Let's say we have unwanted purchases in a certain period of time and/or assigned to a particular branch, so we wan't to delete them.\
What else do we need? An email to notify after the delete has finished and the account's Api Key ([where do I get that?](http://help.woowup.com/es/articles/2456630-mi-cuenta)).\
\
1\) First thing we are going to do is transform our start and end date to UTC time. **If you wan't to delete a whole branch's sales skip this step**.\
For example we want to delete the whole month of August 2019 in Colombia, the timezone of which is UTC-5. So the start date is 2019-08-01 00:00:00-05:00. Converted the timezone to UTC, it will be 2019-08-01 05:00:00. Then the end date converted will be 2019-09-01 04:59:59 (that is Colombia's 2019-08-31 23:59:59)\
\
2\) Now let's define the branch. **If you want to delete purchases for a period of time no matter what branch they belong to, skip this step.**\
Now we want to delete the purchases for the branch called "Example Store" ([where can I see the full list of branches?](http://help.woowup.com/es/articles/2459991-tiendas-y-zonas)). At the admin, if we open a branch, we will get the following window:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LmtkddXwVuQscYjcHni%2F-LmttRI9kwpFW-ZEJYgV%2Fimage.png?alt=media\&token=443221bb-5386-4901-9e7b-cb3a2df4a146)

What we need is the Code ("001" in this example). That is what is going to fill in the 'branch\_name' field.\
\
3\) We are ready to build and send our request. Let's say our account's apikey is "abcdefghij" and the email we want to notify after deletion is complete is "<test@example.com>". The request's cURL will go:

```bash
curl -X DELETE \
  https://api.woowup.com/apiv3/purchases/bulk \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic abcdefghij' \
  -H 'Content-Type: application/json' \
  -d '{
	"from": "2019-08-01 05:00:00",
	"to": "2019-09-01 04:59:59",
	"branch_name": "001",
    "notify_to": "test@email.com"
}'
```

*Note: if you just wan't to delete purchases for a certain period of time, ignore the 'branch\_name' field, and if you just wan't to delete a complete branch's orders, ignore 'from' and 'to' fields.*\
\
To send the request you can use any software that executes cURL commands ([Postman](https://www.getpostman.com/) for example).


# Products

### POST /products

Create a new product. \
The json with the product should be valid with the following [json-schema](http://json-schema.org/)

#### **Request content format**

```
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "A representation of a product",
    "type": "object",
    "required": ["sku", "name"],
    "properties": {
        "sku": {"type":"string"},
        "base_sku": {"type":"string"},
        "name": {"type":"string", "minLength": 1},
        "base_name": {"type": "string"},
        "brand": {"type":"string"},
        "description": {"type":"string"},
        "url": {"type":"string"},
        "image_url": {"type":"string"},
        "thumbnail_url": {"type":"string"},
        "price": {"type":"number"},
        "offer_price": {"type":"number"},        
        "stock": {"type":"number"},
        "available": {"type":"boolean"},
        "release_date": {"type":"string"},
        "category": {
            "type": "array",
            "items": {
                "oneOf": [
                    {
                        "type": "string",
                        "minLength" : 1,
                        "maxLength" : 100
                    },
                    {
                        "type": "object",
                        "required": ["id", "name" ],
                        "properties": {
                            "id": {
                                "type" : "string",
                                "minLength" : 1,
                                "maxLength" : 64
                            },
                            "name": {
                                "type" : "string",
                                "minLength" : 1,
                                "maxLength" : 100
                            },
                            "url": { "type": "string" },
                            "image_url": { "type": "string" }
                        }
                    }
                ]
            }
        },
        "specifications": {
            "type": "array",
            "items": {
                "type": "object",
                "required": ["name", "value"],
                "properties": {
                    "name": { "type": "string" },
                    "value": { "type": "string" }
                }
            }
        },
        "metadata": {
            "type": "object"
        },
        "with_extension_warranty": { "type": "boolean" },
        "custom_attributes": { "type": "object" }
    }
}
```

**Example**

This is a valid purchase according to the previous [json-schema](http://json-schema.org/):

```
{
    "sku": "6786896868",
    "base_sku": "6786896",
    "brand": "BGH Positive",
    "name": "Notebook",
    "base_name": "BGH Notebook",
    "description": "Notebook BGH 14\"",
    "url": "http://www.example.com/notebook-bgh-6786896868",
    "image_url": "http://www.example.com/notebook-bgh-6786896868.png",
    "thumbnail_url": "http://www.example.com/thumbnail_notebook-bgh-6786896868.png",
    "price": 12200,
    "offer_price": 12000,
    "stock": 20,
    "available": true,
    "release_date": "2020-04-16T00:00:00-03:00",
    "category": [
        {
            "id": "a",
            "name": "Todos los productos",
            "url": "http://www.example.com/categorias/a",
            "image_url": "http://www.example.com/categorias/a.jpg"
        },
        {
            "id": "a-b",
            "name": "Hogar",
            "url": "http://www.example.com/categorias/a/b",
            "image_url": "http://www.example.com/categorias/b.png"
        },
        {
            "id": "a-b-c",
            "name": "Notebook",
            "url": "http://www.example.com/categorias/a/b/c",
            "image_url": "http://www.example.com/categorias/c.jpg"
        }
    ],
    "specifications": [
        {"name": "Disco rígido", "value": "1TB"}
    ],
    "metadata": {
        "internal_id": 123456789,
        "uploaded_by": {
            "id": 1,
            "name": "john doe",
            "email": "dataentry@myecommerce.com"
        }
    },
    "custom_attributes": { 
        "weight": 2,
        "release_date": "2019-05-22T14:35:22-03:00"
    }
}
```

This is a curl example:

```
curl -X POST \
  https://api.woowup.com/apiv3/products \
  -H 'accept: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  -d '{
    "sku": "6786896868",
    "base_sku": "6786896",
    "brand": "BGH Positive",
    "name": "Notebook",
    "base_name": "BGH Notebook",
    "description": "Notebook BGH 14\"",
    "url": "http://www.example.com/notebook-bgh-6786896868",
    "image_url": "http://www.example.com/notebook-bgh-6786896868.png",
    "thumbnail_url": "http://www.example.com/thumbnail_notebook-bgh-6786896868.png",
    "price": 12200,
    "offer_price": 12000,
    "stock": 20,
    "available": true,
    "release_date": "2020-04-16 03:00:00",
    "category": [
        {
            "id": "a",
            "name": "Todos los productos",
            "url": "http://www.example.com/categorias/a",
            "image_url": "http://www.example.com/categorias/a.jpg"
        },
        {
            "id": "a-b",
            "name": "Hogar",
            "url": "http://www.example.com/categorias/a/b",
            "image_url": "http://www.example.com/categorias/b.png"
        },
        {
            "id": "a-b-c",
            "name": "Notebook",
            "url": "http://www.example.com/categorias/a/b/c",
            "image_url": "http://www.example.com/categorias/c.jpg"
        }
    ],
    "specifications": [
        {"name": "Disco rígido", "value": "1TB"}
    ],
    "metadata": {
        "internal_id": 123456789,
        "uploaded_by": {
            "id": 1,
            "name": "john doe",
            "email": "dataentry@myecommerce.com"
        }
    },
    "custom_attributes": { 
        "weight": 2,
        "release_date": "2019-05-22T14:35:22-03:00"
    }
}'
```

**Errors**

| HttpCode | HttpCode Name     | Code                | Description                                       |
| -------- | ----------------- | ------------------- | ------------------------------------------------- |
| 201      | ok                | ok                  | Request successful                                |
| 400      | bad request       | bad\_request        | Invalid parameters, view message for more details |
| 429      | too many requests | too\_many\_requests | API's requests-per-second limit exceeded          |
| 500      | internal error    | internal\_error     | Unexpected error                                  |

### POST /products/bulk

Create multiple products in one request. This endpoint is equal to `/products` but accept an array of products.

This is an example with 2 products in one request:

```
curl -X POST \
  https://api.woowup.com/apiv3/products/bulk \
  -H 'accept: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  -d '[{
    "sku": "6786896868",
    "brand": "BGH Positive",
    "name": "Notebook",
    "base_name": "BGH Notebook",
    "description": "Notebook BGH 14\"",
    "url": "http://www.example.com/notebook-bgh-6786896868",
    "image_url": "http://www.example.com/notebook-bgh-6786896868.png",
    "thumbnail_url": "http://www.example.com/thumbnail_notebook-bgh-6786896868.png",
    "price": 12200,
    "offer_price": 12000,
    "stock": 20,
    "available": true,
    "category": [
        {
            "id": "a",
            "name": "Todos los productos",
            "url": "http://www.example.com/categorias/a",
            "image_url": "http://www.example.com/categorias/a.jpg"
        },
        {
            "id": "a-b",
            "name": "Hogar",
            "url": "http://www.example.com/categorias/a/b",
            "image_url": "http://www.example.com/categorias/b.png"
        },
        {
            "id": "a-b-c",
            "name": "Notebook",
            "url": "http://www.example.com/categorias/a/b/c",
            "image_url": "http://www.example.com/categorias/c.jpg"
        }
    ],
    "specifications": [
        {"name": "Disco rígido", "value": "1TB"}
    ],
    "metadata": {
        "internal_id": 123456789,
        "uploaded_by": {
            "id": 1,
            "name": "john doe",
            "email": "dataentry@myecommerce.com"
        }
    },
    "custom_attributes": { 
        "weight": 2,
        "release_date": "2019-05-22T14:35:22-03:00"
    }
}, {
    "sku": "44558987",
    "brand": "Asus",
    "name": "Notebook",
    "base_name": "Asus Notebook",
    "description": "Notebook ASUS 15\"",
    "url": "http://www.example.com/notebook-asus-44558987",
    "image_url": "http://www.example.com/notebook-asus-44558987.png",
    "thumbnail_url": "http://www.example.com/thumbnail_notebook-asus-44558987.png",
    "price": 14000,
    "offer_price": 13900,
    "stock": 15,
    "available": true,
    "category": [
        {
            "id": "a",
            "name": "Todos los productos",
            "url": "http://www.example.com/categorias/a",
            "image_url": "http://www.example.com/categorias/a.jpg"
        },
        {
            "id": "a-b",
            "name": "Hogar",
            "url": "http://www.example.com/categorias/a/b",
            "image_url": "http://www.example.com/categorias/b.png"
        },
        {
            "id": "a-b-c",
            "name": "Notebook",
            "url": "http://www.example.com/categorias/a/b/c",
            "image_url": "http://www.example.com/categorias/c.jpg"
        }
    ],
    "specifications": [
        {"name": "Disco rígido", "value": "720GB"}
    ]
}]'
```

**Errors**

| HttpCode | HttpCode Name     | Code                | Description                                       |
| -------- | ----------------- | ------------------- | ------------------------------------------------- |
| 201      | ok                | ok                  | Request successful                                |
| 400      | bad request       | bad\_request        | Invalid parameters, view message for more details |
| 429      | too many requests | too\_many\_requests | API's requests-per-second limit exceeded          |
| 500      | internal error    | internal\_error     | Unexpected error                                  |

### PUT /products/{id}

Update product's information. The {id} parameter is required and can be: the product's code encoded or the product's id.

This is an example to update the stock and the availability of the product according to the json schema on the POST section:

```
curl -X PUT \
  https://api.woowup.com/apiv3/products/Njc4Njg5Njg2OA== \
  -H 'accept: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  -d '{
    "sku": "6786896868",
    "base_sku": "6786896",
    "brand": "BGH Positive",
    "name": "Notebook",
    "base_name": "BGH Notebook",
    "description": "Notebook BGH 14\"",
    "url": "http://www.example.com/notebook-bgh-6786896868",
    "image_url": "http://www.example.com/notebook-bgh-6786896868.png",
    "thumbnail_url": "http://www.example.com/thumbnail_notebook-bgh-6786896868.png",
    "price": 12200,
    "offer_price": 12000,
    "stock": 20,
    "available": true,
    "release_date": "2020-04-16T00:00:00-03:00",
    "category": [
        {
            "id": "a",
            "name": "Todos los productos",
            "url": "http://www.example.com/categorias/a",
            "image_url": "http://www.example.com/categorias/a.jpg"
        },
        {
            "id": "a-b",
            "name": "Hogar",
            "url": "http://www.example.com/categorias/a/b",
            "image_url": "http://www.example.com/categorias/b.png"
        },
        {
            "id": "a-b-c",
            "name": "Notebook",
            "url": "http://www.example.com/categorias/a/b/c",
            "image_url": "http://www.example.com/categorias/c.jpg"
        }
    ],
    "specifications": [
        {"name": "Disco rígido", "value": "1TB"}
    ],
    "metadata": {
        "internal_id": 987654321,
        "uploaded_by": {
            "id": 2,
            "name": "joanne doe",
            "email": "dataentry2@myecommerce.com"
        }
    },
    "custom_attributes": { 
        "weight": 15,
        "release_date": "2019-04-26"
    }
}'
```

**Errors**

| HttpCode | HttpCode Name     | Code                | Description                                       |
| -------- | ----------------- | ------------------- | ------------------------------------------------- |
| 200      | ok                | ok                  | Request successful                                |
| 400      | bad request       | bad\_request        | Invalid parameters, view message for more details |
| 404      | not found         | not\_found          | Product not found                                 |
| 429      | too many requests | too\_many\_requests | API's requests-per-second limit exceeded          |
| 500      | internal error    | internal\_error     | Unexpected error                                  |

### GET /products/{id}/exist

Test if a product exist by id/sku. The {id} parameter is required and can be: the product's code encoded or the product's id.

| Parameter | Type | Required | Description               |
| --------- | ---- | -------- | ------------------------- |
| id        | uri  | Yes      | Product ID or encoded sku |

**Example**

```
curl -X GET \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -H "Cache-Control: no-cache" \
    "https://api.woowup.com/apiv3/products/12345/exist"
```

**Response**

```
{
    "payload": {
        "exist": true
    },
    "message":"ok",
    "code":"ok",
    "time":"100ms"
}
```

**Errors**

| HttpCode | HttpCode Name     | Code                | Description                              |
| -------- | ----------------- | ------------------- | ---------------------------------------- |
| 200      | ok                | ok                  | Request successful                       |
| 429      | too many requests | too\_many\_requests | API's requests-per-second limit exceeded |
| 500      | internal error    | internal\_error     | Unexpected error                         |


# Benefits

## Benefits

### GET /benefits

Retrieve a list of benefits separated by status

| Parameter          | Type  | Required | Description                                      |
| ------------------ | ----- | -------- | ------------------------------------------------ |
| currentbenefits    | query | No       | Amount of benefits available for redeem returned |
| outofstockbenefits | query | No       | Amount of benefits out of stock returned         |
| comingbenefits     | query | No       | Amount of coming benefits returned               |

#### Example <a href="#example" id="example"></a>

```bash
curl -X GET \
  'https://api.woowup.com/apiv3/benefits?outofstockbenefits=1000&comingbenefits=1000&currentbenefits=1000' \
  -H 'accept: application/json' \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -H 'cache-control: no-cache'
```

#### Response <a href="#response" id="response"></a>

```bash
{
  "payload": {
    "current": [
      {
        "id": 123,
        "slug": "benefit-1-title",
        "title": "Benefit 1 title",
        "description": "Benefit 1 description",
        "status": "1",
        "image_id": "1234",
        "user_id": "1234",
        "app_id": "123",
        "app_code": "CONTEST",
        "contenttype_id": "10",
        "version": null,
        "category_id": null,
        "startdate": "2017-03-24 00:00:00",
        "enddate": "2017-12-31 09:30:26",
        "featured": "0",
        "wallpublish": "0",
        "monthly_redeems": "3",
        "modified": "2017-03-21 19:37:25",
        "created": "2017-02-22 18:49:17",
        "image_url": "https://api.woowup.com/uploads/1234567/qwerty-adfg-zcv-iuytr-vbnmjhgfd.png",
        "points": 0,
        "event_date": "2017-06-02 18:00:00",
        "sku": "s000123"
      }
    ],
    "outofstock": [
      {
        "id": 124,
        "slug": "benefit-2-title",
        "title": "Benefit 2 title",
        "description": "Benefit 2 description",
        "status": "1",
        "image_id": "1234",
        "user_id": "1234",
        "app_id": "123",
        "app_code": "CONTEST",
        "contenttype_id": "10",
        "version": null,
        "category_id": null,
        "startdate": "2017-03-24 00:00:00",
        "enddate": "2017-12-31 09:30:26",
        "featured": "0",
        "wallpublish": "0",
        "monthly_redeems": "3",
        "modified": "2017-03-21 19:37:25",
        "created": "2017-02-22 18:49:17",
        "image_url": "https://api.woowup.com/uploads/1234567/qwerty-adfg-zcv-iuytr-vbnmjhgfd.png",
        "points": 0,
        "event_date": "2017-06-02 18:00:00",
        "sku": "s000124"
      }
    ],
    "comingbenefits": [
      {
        "id": 125,
        "slug": "benefit-3-title",
        "title": "Beneift 3 title",
        "description": "Benefit 3 description",
        "status": "1",
        "image_id": "1234",
        "user_id": "1234",
        "app_id": "123",
        "app_code": "CONTEST",
        "contenttype_id": "10",
        "version": null,
        "category_id": null,
        "startdate": "2017-03-24 00:00:00",
        "enddate": "2017-12-31 09:30:26",
        "featured": "0",
        "wallpublish": "0",
        "monthly_redeems": "3",
        "modified": "2017-03-21 19:37:25",
        "created": "2017-02-22 18:49:17",
        "image_url": "https://api.woowup.com/uploads/1234567/qwerty-adfg-zcv-iuytr-vbnmjhgfd.png",
        "points": 0,
        "event_date": "2017-06-02 18:00:00",
        "sku": "s000125"
      }
    ]
  },
  "message": "",
  "code": "ok",
  "time": "36ms"
}
```

#### HTTP Response codes <a href="#http-response-codes" id="http-response-codes"></a>

| HTTP Code | Name               | Description                                    |
| --------- | ------------------ | ---------------------------------------------- |
| 200       | ok                 | Successful request                             |
| 400       | bad request        | Invalid parameters                             |
| 403       | forbidden          | Invalid or inexistent apikey                   |
| 405       | method not allowed | Use an invalid http verb in the request        |
| 500       | server error       | Internal error, explained in the json response |

### GET /benefits/all

Retrieve a list of ALL benefits.

| Parameter | Type  | Required | Description                                        |
| --------- | ----- | -------- | -------------------------------------------------- |
| page      | query | No       | Page number. Default: 0                            |
| limit     | query | No       | Amount of benefits per page. Default: 25, Max: 100 |

#### Example <a href="#example-1" id="example-1"></a>

```bash
curl -X GET \
  'https://api.woowup.com/apiv3/benefits?page=0&limit=100' \
  -H 'accept: application/json' \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -H 'cache-control: no-cache'
```

#### Response <a href="#response-1" id="response-1"></a>

```javascript
{
    "payload": [{
        "id": "1",
        "slug": "beneficio-1",
        "title": "Beneficio 1",
        "description": "Descripción del beneficio 1",
        "status": "1",
        "image_id": "2",
        "user_id": "3",
        "app_id": "4",
        "app_code": "CONTEST",
        "contenttype_id": "10",
        "version": null,
        "category_id": null,
        "startdate": "2018-03-25 21:11:00",
        "enddate": "2018-12-31 09:30:26",
        "featured": "0",
        "wallpublish": "0",
        "monthly_redeems": "1",
        "modified": "2018-03-20 17:12:04",
        "created": "2018-03-20 17:12:04",
        "image_url": "https://admin.woowup.com/uploads/123/123-asd-asd-asd-asd.png",
        "points": 0,
        "event_date": "2018-03-27 12:00:00",
        "out_stock_at": null,
        "sku": "s000001"
    }, {
        "id": "2",
        "slug": "beneficio-2",
        "title": "Título del beneficio 2",
        "description": "Descripción del beneficio 2",
        "status": "1",
        "image_id": "2",
        "user_id": "3",
        "app_id": "4",
        "app_code": "CONTEST",
        "contenttype_id": "10",
        "version": null,
        "category_id": null,
        "startdate": "2018-03-22 20:28:00",
        "enddate": "2018-12-31 09:30:26",
        "featured": "1",
        "wallpublish": "0",
        "monthly_redeems": "1",
        "modified": "2018-03-20 17:25:43",
        "created": "2018-03-19 11:32:28",
        "image_url": "https://admin.woowup.com/uploads/123/asd-qwe-qwe-asd-xcv.jpg",
        "points": 0,
        "event_date": "2018-03-25 22:00:00",
        "out_stock_at": null,
        "sku": "s000002"
    }],
    "message": "",
    "code": "ok",
    "time": "36ms"
}
```

#### HTTP Response codes <a href="#http-response-codes-1" id="http-response-codes-1"></a>

| HTTP Code | Name               | Description                                    |
| --------- | ------------------ | ---------------------------------------------- |
| 200       | ok                 | Successful request                             |
| 400       | bad request        | Invalid parameters                             |
| 403       | forbidden          | Invalid or inexistent apikey                   |
| 405       | method not allowed | Use an invalid http verb in the request        |
| 500       | server error       | Internal error, explained in the json response |

### POST /benefits/{benefit\_id}/assign

Assign a benefit to a customer

| Parameter   | Type | Required | Description |
| ----------- | ---- | -------- | ----------- |
| benefit\_id | Url  | Yes      | Benefit ID  |
| userapp\_id | POST | Yes      | Customer ID |

#### Example

```bash
curl -X POST \
  'https://api.woowup.com/apiv3/benefits/123/assign' \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -H 'Cache-Control: no-cache'
  -H 'Content-Type: application/x-www-form-urlencoded'
  -d 'userapp_id=456'
```

This example assign benfit with **ID 123** to customer with **ID 456**

#### **Response**

```bash
{
    "payload": {
        "status": true
    },
    "message": "ok",
    "code": "ok",
    "time": "123ms"
}
```

#### HTTP Response codes <a href="#http-response-codes-1" id="http-response-codes-1"></a>

| HTTP Code | Name               | Description                                    |
| --------- | ------------------ | ---------------------------------------------- |
| 200       | ok                 | Successful request                             |
| 400       | bad request        | Invalid parameters                             |
| 403       | forbidden          | Invalid or inexistent apikey                   |
| 405       | method not allowed | Use an invalid http verb in the request        |
| 500       | server error       | Internal error, explained in the json response |


# Coupons

## Coupons

<mark style="color:blue;">`GET`</mark> `https://api.woowup.com/apiv3/coupons` &#x20;

Retrieve a list of redeemed coupons  by assign\_date descending

#### Path Parameters

| Name   | Type   | Description                                                                |
| ------ | ------ | -------------------------------------------------------------------------- |
| status | string | "available", "assigned", "pending", "cancelled", "used"                    |
| from   | string | Min assign\_date of the returned coupons. Format yyyy-mm-dd hh:mm:ss (UTC  |
| to     | string | Max assign\_date of the returned coupons. Format yyyy-mm-dd hh:mm:ss (UTC) |
| page   | number | Number of the page returned. Default 0                                     |
| limit  | number | Items per page returned. Default 25, MAX 100                               |

{% tabs %}
{% tab title="200 " %}

```
[
    {
        "id": 1234,
        "code": "ASE34AWVS21",
        "assign_date": "2017-05-10 14:32:12",
        "status": "assigned",
        "user": {
            "userapp_id": 1234,
            "user_id": 1234,
            "app_id": 123,
            "service_uid": "98765",
            "email": "user@email.com",
            "first_name": "John",
            "last_name": "Doe",
            "telephone": "5411987654321",
            "birthday": "1986-08-13",
            "gender": "M",
            "tags": [],
            "points": 0,
            "points_pending": 0,
            "customform": {
                "user_id": "98765"
            },
            "club_inscription_date": "2017-01-03",
            "blocked": false,
            "notes": "user notes",
            "mailing_enabled": true,
            "mailing_enabled_reason": null
        },
        "benefit": {
            "id": 1234,
            "slug": "benefit-1-title",
            "title": "Benefit 1 title",
            "description": "Benefit 1 description",
            "terms": "Terms and condition",
            "on_assign_msg": "After assign message",
            "status": 1,
            "app_id": 123,
            "startdate": "2017-04-20 14:51:00",
            "enddate": "2017-05-17 19:34:25",
            "action_id": 5678,
            "image_url": "https://api.woowup.com/image.png"
        }
    },
    {
        "id": 1235,
        "code": "ASE34AWVS22",
        "assign_date": null,
        "status": "available",
        "user": null,
        "benefit": {
            "id": 1234,
            "slug": "benefit-1-title",
            "title": "Benefit 1 title",
            "description": "Benefit 1 description",
            "terms": "Terms and condition",
            "on_assign_msg": "After assign message",
            "status": 1,
            "app_id": 123,
            "startdate": "2017-04-20 14:51:00",
            "enddate": "2017-05-17 19:34:25",
            "action_id": 5678,
            "image_url": "https://api.woowup.com/image.png"
        }
    }
]
```

{% endtab %}

{% tab title="400 " %}

```
```

{% endtab %}

{% tab title="500 " %}

```
```

{% endtab %}
{% endtabs %}

**Example**

```
curl -X GET \
  'https://api.woowup.com/apiv3/coupons?status=assigned&limit=100&page=0&from=2017-01-01%2000%3A00%3A00&to=2017-05-31%2023%3A59%3A59' \
  -H 'accept: application/json' \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -H 'cache-control: no-cache'
```

## Update Coupon

<mark style="color:orange;">`PUT`</mark> `https://api.woowup.com/apiv3/coupons/:code`&#x20;

#### Request Body

| Name   | Type   | Description |
| ------ | ------ | ----------- |
| status | string |             |

{% tabs %}
{% tab title="200 " %}

```
[
    {
        "id": 1234,
        "code": "abcdefg",
        "assign_date": "2017-05-10 14:32:12",
        "status": "cancelled",
        "user": {
            "userapp_id": 1234,
            "user_id": 1234,
            "app_id": 123,
            "service_uid": "98765",
            "email": "user@email.com",
            "first_name": "John",
            "last_name": "Doe",
            "telephone": "5411987654321",
            "birthday": "1986-08-13",
            "gender": "M",
            "tags": [],
            "points": 0,
            "points_pending": 0,
            "customform": {
                "user_id": "98765"
            },
            "club_inscription_date": "2017-01-03",
            "blocked": false,
            "notes": "user notes",
            "mailing_enabled": true,
            "mailing_enabled_reason": null
        },
        "benefit": {
            "id": 1234,
            "slug": "benefit-1-title",
            "title": "Benefit 1 title",
            "description": "Benefit 1 description",
            "terms": "Terms and condition",
            "on_assign_msg": "After assign message",
            "status": 1,
            "app_id": 123,
            "startdate": "2017-04-20 14:51:00",
            "enddate": "2017-05-17 19:34:25",
            "action_id": 5678,
            "image_url": "https://api.woowup.com/image.png"
        }
    }
]
```

{% endtab %}

{% tab title="400 " %}

```
{
    "payload": {
        "errors": [
            "/status: Value \"qwerty\" is not one of: [\"available\",\"assigned\",\"pending\",\"cancelled\",\"used\"]"
        ]
    },
    "message": "bad request",
    "code": "bad_request",
    "time": "42ms"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    "payload": [],
    "message": "Can't update coupon",
    "code": "internal_error",
    "time": "82ms"
}
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
{ \
&#x20; "$schema": "<http://json-schema.org/draft-04/schema#>", \
&#x20; "description": "A representation of a coupon", \
&#x20; "type": "object", \
&#x20; "required": \["status"], \
&#x20; "properties": { \
&#x20;   "status": { \
&#x20;      "type": "string",  \
&#x20;      "enum": \["available", "assigned", "pending", "cancelled", "used"] \
&#x20;   }\
&#x20;}
{% endhint %}

```
curl -X PUT \
  https://api.woowup.com/apiv3/coupons/abcdefg \
  -H 'accept: application/json' \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -d '{
	"status": "cancelled"
}'
```


# Events

### GET /events

Retrieve a list events

| Parameter | Type  | Required | Description                                    |
| --------- | ----- | -------- | ---------------------------------------------- |
| limit     | query | No       | Items per page returned. Default: 25, Max: 100 |
| page      | query | No       | Number of the page returned. Default: 0        |

**Example**

```
curl -X GET \
  'https://api.woowup.com/apiv3/events?limit=100&page=0' \
  -H 'accept: application/json' \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -H 'cache-control: no-cache'
```

**Response**

```
[
    {
        "id": 1234,
        "name": "view-product",
        "createtime": "2017-05-10 14:32:12"
    },
    {
        "id": 1235,
        "name": "view-category",
        "createtime": "2017-05-10 14:32:12"
    },
    {
        "id": 1236,
        "name": "purchase-product",
        "createtime": "2017-05-10 14:32:12"
    }
]
```

**Errors**

| HttpCode | HttpCode Name  | Code            | Description                                       |
| -------- | -------------- | --------------- | ------------------------------------------------- |
| 200      | ok             | ok              | Request successful                                |
| 400      | bad request    | bad\_request    | Invalid parameters, view message for more details |
| 500      | internal error | internal\_error | Unexpected error                                  |

### POST /events

Create a new event.

| Parameter | Required | Description                                               |
| --------- | -------- | --------------------------------------------------------- |
| name      | Yes      | Event name, only accepted alphanumeric characters and "-" |

**JSON Body format**

```
{
  "name": "view-product"
}
```

**Example**

This is a curl example:

```
curl -X POST \
  https://api.woowup.com/apiv3/events \
  -H 'accept: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  -d '{
  "name": "view-product"
}'
```

**Response**

This is a curl example:

```
{
  "id": 1234
  "name": "view-product",
  "createtime": "2017-07-21 13:43:29"
}
```

**Errors**

| HttpCode | HttpCode Name  | Code            | Description                                                           |
| -------- | -------------- | --------------- | --------------------------------------------------------------------- |
| 200      | ok             | ok              | Request successful                                                    |
| 400      | bad request    | bad\_request    | Invalid parameters or duplicated event, view message for more details |
| 500      | internal error | internal\_error | Unexpected error                                                      |

### POST /user-events

Associate an event to user

**JSON Body format**

```
{
  "event": "view-product",
  "service_uid": "example@email.com",
  "datetime": "2017-06-21 09:52:12",
  "metadata": {
    "campo 1": "valor 1",
    "campo 2": "valor 2",
  }
}
```

{% hint style="warning" %}
Recuerda que el "service\_uid" puede variar. Hay cuentas que utilizan el correo y otras que pueden usar el documento o un id interno. Utilizar el indicado para tu cuenta, en caso de no saber cual es consulta con el equipo de soporte.
{% endhint %}

{% hint style="danger" %}
Si se envia el campo "datetime" en el formato del ejemplo, por default interpreta que esta en UTC.  Para utilizar tu timezone, es necesario formatear la fecha bajo el standard ISO 8601.&#x20;

Ejemplo *GMT-5*: 2004-02-12T15:19:21-05:00&#x20;
{% endhint %}

**Example**

This is a curl example:

```
curl -X POST \
  https://api.woowup.com/apiv3/user-events \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  -d '{ "event": "view-product", "service_uid": "example@email.com", "datetime": "2017-06-21 09:52:12", "metadata": { "campo 1": "valor 1" } }'
```

**Errors**

| HttpCode | HttpCode Name  | Code            | Description                                                           |
| -------- | -------------- | --------------- | --------------------------------------------------------------------- |
| 200      | ok             | ok              | Request successful                                                    |
| 400      | bad request    | bad\_request    | Invalid parameters or duplicated event, view message for more details |
| 404      | not found      | not\_found      | Event or user not found, view message for more details                |
| 500      | internal error | internal\_error | Unexpected error                                                      |

### GET /user-events

Retrieve a list of user events

| Parameter    | Type  | Required | Description                                    |
| ------------ | ----- | -------- | ---------------------------------------------- |
| limit        | query | No       | Items per page returned. Default: 25, Max: 100 |
| page         | query | No       | Number of the page returned. Default: 0        |
| service\_uid | query | No       | service\_uid of user                           |
| event        | query | No       | event name                                     |

#### Example <a href="#example-3" id="example-3"></a>

```
curl -X GET \
  'https://api.woowup.com/apiv3/user-events' \
  -H 'accept: application/json' \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -H 'cache-control: no-cache'
```

#### Response <a href="#response-2" id="response-2"></a>

```
{
  "payload": [
    {
      "id": 1,
      "event": {
        "id": 1,
        "name": "ingreso-club",
        "createtime": "2017-07-18 12:54:37"
      },
      "user": {
        "userapp_id": 37679,
        "user_id": 37791,
        "service_uid": "user@customer.com",
        "email": "user@customer.com"
      },
      "datetime": "2017-07-18 10:05:03",
      "metadata": null
    },
    {
      "id": 2,
      "event": {
        "id": 1,
        "name": "ingreso-club",
        "createtime": "2017-07-18 12:54:37"
      },
      "user": {
        "userapp_id": 37679,
        "user_id": 37791,
        "service_uid": "user@customer.com",
        "email": "user@customer.com"
      },
      "datetime": "2017-07-18 10:05:38",
      "metadata": null
    }
  ],
  "message": "ok",
  "code": "ok",
  "time": "1159ms"
}
```

**Errors**

| HttpCode | HttpCode Name  | Code            | Description                                                           |
| -------- | -------------- | --------------- | --------------------------------------------------------------------- |
| 200      | ok             | ok              | Request successful                                                    |
| 400      | bad request    | bad\_request    | Invalid parameters or duplicated event, view message for more details |
| 500      | internal error | internal\_error | Unexpected error                                                      |

## Delete event

<mark style="color:red;">`DELETE`</mark> `https://api.woowup.com/apiv3/events/{id}`

Delete an event

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "payload": [],
    "message": "",
    "code": "ok",
    "time": "52ms"
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{
    "payload": [],
    "message": "event not found",
    "code": "not_found",
    "time": "39ms"
}
```

{% endtab %}

{% tab title="500 " %}

```javascript
{
    "payload": [],
    "message": "",
    "code": "internal_error",
    "time": "72ms"
}
```

{% endtab %}
{% endtabs %}

**Example**

```bash
curl -X DELETE \
  https://api.woowup.com/apiv3/events/999999 \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
  -H 'Content-Type: application/json' \

```

**Response**

```javascript
{
    "payload": [],
    "message": "",
    "code": "ok",
    "time": "52ms"
}
```

## Delete user events (bulk)

<mark style="color:red;">`DELETE`</mark> `https://api.woowup.com/apiv3/user-events/bulk`

#### Request Body

| Name        | Type   | Description                       |
| ----------- | ------ | --------------------------------- |
| event\_name | string |                                   |
| from        | string | date format YYYY-MM-DD hh:mm:ss   |
| to          | string | date format YYYY-MM-DD hh:mm:ss   |
| notify\_to  | string | email to receive the confirmation |

{% tabs %}
{% tab title="200 will be receive an email when the deletion process is finished" %}

```javascript
{
    "payload": {
        "request_id": "XXX"
    },
    "message": "ok",
    "code": "ok",
    "time": "111ms"
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
//bad_request
{
    "payload": {
        "errors": [
            "Failed matching any of the provided schemas."
        ]
    },
    "message": "bad request",
    "code": "bad_request",
    "time": "38ms"
}

//invalid_email
{
    "payload": [],
    "message": "Invalid email to notify",
    "code": "invalid_email",
    "time": "48ms"
}
```

{% endtab %}

{% tab title="403 " %}

```javascript
{
    "payload": [],
    "message": "forbidden: authentication failed",
    "code": "forbidden",
    "time": "7ms"
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{
    "payload": {
        "errors": [
            "event not found"
        ]
    },
    "message": "event not found",
    "code": "not_found",
    "time": "51ms"
}
```

{% endtab %}

{% tab title="500 " %}

```javascript
{
    "payload": [],
    "message": "",
    "code": "internal_error",
    "time": "72ms"
}
```

{% endtab %}
{% endtabs %}

**Example**

```bash
curl -X DELETE \
  https://api.woowup.com/apiv3/user-events/bulk \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
    "event-name": "eventExample"
	"from": "2019-07-01",
	"to": "2019-07-31",
    "notify_to": "test@email.com"
}'
```

**Response**

```javascript
{
    "payload": {
        "request_id": "XXX"
    },
    "message": "ok",
    "code": "ok",
    "time": "111ms"
}
```


# Garantía Extendida

Cómo registrar eventos que disparen campañas de ofrecimiento de extensión de garantías

## **Proceso de sincronización de datos para las campañas de Garantía de reparación**

WoowUp permite enviar la información necesaria para poder ejecutar campañas donde queremos ofrecer al cliente una Garantía extendida de reparación para los productos que ha comprado.

### Información requerida en la venta.

Cuando se envían los datos de la venta a WoowUp, ya sea mediante un archivo de datos CSV o usando la API POST /Purchase, se debe sumar la siguiente info al detalle de cada producto con Garantía en la venta:

* **"manufacturer\_warranty\_date":** fecha de vencimiento de la garantía de fábrica del producto.
* **"extension\_warranty\_date":** fecha de vencimiento de la garantía extendida del producto.
* **"with\_extension\_warranty":** booleano que indica si ya fue adquirida la garantía extendida.

### Ofrecimiento de garantía extendida post-venta

Este evento está relacionado a ofrecerle la garantía extendida a los clientes que acaban de comprar un producto, no han comprado la garantía extendida y queremos hacer un intento post-venta (al dia siguiente de la compra o a los pocos días).

Lo primero que haremos y por única vez es crear el evento "extended-warranty-offer-post-purchase" (este nombre es sugerido pero pueden usar otro), haciendo una request de tipo POST en <https://api.woowup.com/apiv3/events> con el siguiente cuerpo:

```javascript
{
  "name": "extended-warranty-offer-post-purchase"
}
```

Con esto ya tenemos el evento creado. Ahora queremos informarle a WoowUp que para el cliente identificado con “X”, se le debe ofrecer la garantía del producto con sku “Y”.

Haremos un POST a <https://api.woowup.com/apiv3/user-events> informando para el evento, la misma fecha que tiene la factura de compra y además el precio de cada una de las garantías que queramos mostrar en el mensaje. La llamada al endpoint tiene entonces el siguiente cuerpo:

```javascript
{
  "event": "extended-warranty-offer-post-purchase",
  "service_uid": "X",
  "datetime": "Z",
  "metadata": {
    "sku": "Y",
    "1_year_extension_price": "P1",
    "2_year_extension_price": "P2",
  }
}
```

Este proceso se ejecuta diariamente, creando en WoowUp los eventos de ofrecimiento de garantía extendida post-venta para todas las ventas del dia donde corresponda.

### Configuración de la campaña

En la sección de Campañas, el diseñador creará una campana de tipo Evento API. Seleccionará el evento “extended-warranty-offer-post-purchase” y tiene la posibilidad de definir cuantos días luego de creado el evento se dispara el mail (el mismo día, 5 días más tarde, una semana, etc). Tendra a disposicion toda la metadata que se ha enviado en el evento para personalizar el email.

### Ofrecimiento de garantía extendida pre-vencimiento garantía de fábrica.

Este evento está relacionado a ofrecerle la garantía extendida a los clientes para los cuales se acerca el vencimiento de garantía de fabrica y aun no han comprado la extensión.

Lo primero que haremos y por única vez es crear el evento "extended-warranty-offer-pre-manufacturer-warranty-expire" (este nombre es sugerido pero pueden usar otro), haciendo una request de tipo POST en <https://api.woowup.com/apiv3/events> con el siguiente cuerpo:

```javascript
{
  "name": "extended-warranty-offer-pre-manufacturer-warranty-expire"
}

```

Con esto ya tenemos el evento creado. Ahora queremos informarle a WoowUp que para el cliente identificado con “X”, se le debe ofrecer la garantía del producto con sku “Y”.

Haremos un POST a <https://api.woowup.com/apiv3/user-events> informando para el evento, la fecha de vencimiento de la garantía y además el precio de cada una de las garantías que queramos mostrar en el mensaje. La llamada al endpoint tiene entonces el siguiente cuerpo:

```javascript
{
  "event": "extended-warranty-offer-pre-manufacturer-warranty-expire”
  "service_uid": "X",
  "datetime": "Z",
  "metadata": {
    "sku": "Y",
    "1_year_extension_price": "P1",
    "2_year_extension_price": "P2",
  }
}
```

Este proceso se ejecuta diariamente, creando en WoowUp los eventos de ofrecimiento de garantía extendida post-venta pre vencimiento de garantía de fábrica para todas las ventas del donde corresponda. Esto implica que debe contar con una consulta a su base de ventas para poder obtener previamente esta información.

#### Configuración de la campaña

En la sección de Campanas, el diseñador creará una campana de tipo Evento API. Seleccionará el evento “extended-warranty-offer-pre-manufacturer-warranty-expire” y tiene la posibilidad de definir cuantos días luego de creado el evento se dispara el mail (5 días antes, 15 días antes, etc). Tendrá a disposición toda la metadata que se ha enviado en el evento para personalizar el email.

### Línea del tiempo

En el siguiente gráfico modelamos como queda la linea del tiempo para este proceso:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LTib4AfHBQvG5ji230p%2F-LTib8ig-ClFJOQz4GuF%2Ftimeline1.jpg?alt=media\&token=8b9fa7c7-76dc-4f06-a58b-628f0cf602c1)

Volviendo a la línea de tiempo, agregando el disparo del evento, la misma quedaría:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LTib4AfHBQvG5ji230p%2F-LTibEI1PuP-lPnP1KDI%2Ftimeline2.jpg?alt=media\&token=8b282d44-048a-4960-a2ee-d374c05c6fb0)

### Ejemplo

Para finalizar, se muestra un ejemplo más completo con disparos todos los lunes y con aviso al cliente 30 días antes. Supongamos que tenemos los siguientes artículos vendidos:<br>

| Fecha de venta | Id de cliente | SKU  | Vencimiento de garantía |
| -------------- | ------------- | ---- | ----------------------- |
| 2018-01-31     | 67890         | P004 | 2019-01-31              |
| 2018-02-04     | 12345         | P002 | 2019-02-04              |
| 2018-08-09     | 12345         | P001 | 2019-02-09              |
| 2018-11-10     | 12345         | P003 | 2019-02-10              |

Llegado el día Lunes 31 de Diciembre, tomaremos los productos cuya garantía finaliza dentro de los +31 y +38 días, es decir entre el 31 de Enero y el 7 de Febrero<br>

| Fecha de venta | Id de cliente | SKU      | Vencimiento de garantía |
| -------------- | ------------- | -------- | ----------------------- |
| **2018-01-31** | **67890**     | **P004** | **2019-01-31**          |
| **2018-02-04** | **12345**     | **P002** | **2019-02-04**          |
| 2018-08-09     | 12345         | P001     | 2019-02-09              |
| 2018-11-10     | 12345         | P003     | 2019-02-10              |

El proceso disparará un evento para el cliente 67890 con el sku P004 y fecha 31/01/2019, y otro al cliente 12345 con el sku P002 y fecha 04/02/2019, cada uno con los correspondientes precios de garantía al día 31/12. El día 01/01 se enviará la campaña al cliente 67890 y el día 05/01 al cliente 12345.

Al siguiente Lunes 7 de Enero, el proceso buscará las garantías que venzan entre el 8 y el 15 de Febrero

| Fecha de venta | Id de cliente | SKU      | Vencimiento de garantía |
| -------------- | ------------- | -------- | ----------------------- |
| **2018-08-09** | **12345**     | **P001** | **2019-02-09**          |
| **2018-11-10** | **12345**     | **P003** | **2019-02-10**          |

Esto disparará dos eventos distintos al cliente 12345, uno con sku P001 y fecha 09/02/2019, y el otro con sku P003 y fecha 10/02/2019. El cliente recibirá un aviso el día 10/01 por el producto P001 y otro el día 11/01 por el producto P003.


# Custom Attributes

## Custom attributes - Users

### GET /account/custom-attributes

List custom attribute's definitions

| Parameter | Type  | Required | Description                                     |
| --------- | ----- | -------- | ----------------------------------------------- |
| text      | query | No       | Search by attribute's name or attribute's label |
| limit     | query | No       | Items per page returned. Default 25, max 100    |
| page      | query | No       | Number of page. First page is 0                 |

**Example**

```
curl -X GET \
  -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Accept: application/json" \
  -H 'cache-control: no-cache' \
  'https://api.woowup.com/apiv3/account/custom-attributes'
```

**Response**

```
{
    "payload": [
        {
            "label": "Fecha de vigencia",
            "name": "vigencia",
            "field_type": "datetime",
            "data_type": "timestamp",
            "group": null
        },
        {
            "label": "Nro Socio",
            "name": "nro_socio",
            "field_type": "text",
            "data_type": "string",
            "group": "Datos del socio"
        },
        {
            "label": "Tipo de Documento",
            "name": "tipo_documento",
            "field_type": "select",
            "data_type": "string",
            "group": "Datos del socio"
            "options": [
                {
                    "value": "CI",
                    "text": "CI"
                },
                {
                    "value": "DNI",
                    "text": "DNI"
                },
                {
                    "value": "LC",
                    "text": "LC"
                },
                {
                    "value": "PASS",
                    "text": "PASS"
                },
                {
                    "value": "LE",
                    "text": "LE"
                },
                {
                    "value": "S/D",
                    "text": "S/D"
                }
            ]
        },
        {
            "label": "Sede",
            "name": "sede",
            "field_type": "select",
            "data_type": "string",
            "group": null,
            "options": [
                {
                    "value": "Palermo",
                    "text": "Palermo"
                },
                {
                    "value": "Belgrano",
                    "text": "Belgrano"
                }
            ]
        }
    ],
    "message": "ok",
    "code": "ok",
    "time": "22ms"
```

### POST /account/custom-attributes

Create custom attribute's definition. The name property is the key of the attribute that you can use on the /users endpoint to send custom attributes data.

**Request content format**

```
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Definition of custom attributes",
        "type": "object",
        "required": ["name", "data_type", "field_type", "label"],
        "properties": {
            "label": { "type": "string", "minLength": 1 },
            "name": { "type": "string", "minLength": 1 },
            "field_type": { 
                "type": "string", 
                "enum": ["text", "select", "datetime"]
            },
            "data_type": {
                "type": "string",
                "enum": ["string", "integer", "float", "timestamp"]
            },
            "options": {
                "type": "array",
                "items": {
                    "type": "object",
                    "required": ["value", "text"],
                    "properties": {
                        "value": { "type": "string" },
                        "text": { "type": "string" }
                    }
                }
            }
        }
    }
```

**Example**

These example creates a custom attribute definition to save the document type of the user

```
curl -X POST \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    -d '{"label":"Tipo de Documento","field_type":"select","group":null,"data_type":"string","options":[{"value":"CI","text":"CI"},{"value":"DNI","text":"DNI"},{"value":"LC","text":"LC"},{"value":"PASS","text":"PASS"},{"value":"LE","text":"LE"},{"value":"S/D","text":"S/D"}]}' \
    'https://api.woowup.com/apiv3/account/custom-attributes'
```

**Response**

```
{
  "payload": {
    "label": "Tipo de Documento",
    "name": "tipo_documento",
    "field_type": "select",
    "data_type": "string",
    "group": null,
    "options": [
      {
        "value": "CI",
        "text": "CI"
      },
      {
        "value": "DNI",
        "text": "DNI"
      },
      {
        "value": "LC",
        "text": "LC"
      },
      {
        "value": "PASS",
        "text": "PASS"
      },
      {
        "value": "LE",
        "text": "LE"
      },
      {
        "value": "S\/D",
        "text": "S\/D"
      }
    ]
  },
  "message": "ok",
  "code": "ok",
  "time": "592ms"
}
```

### PUT /account/custom-attributes/{name}

Update custom attribute's definition. Please be carefull whith data type's changes, you may loose information

| Parameter | Type | Required | Description                   |
| --------- | ---- | -------- | ----------------------------- |
| name      | URI  | YES      | Custom attribute's name (key) |

**Request content format**

```
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Definition of custom attributes",
        "type": "object",
        "properties": {
            "label": { "type": "string", "minLength": 1 },
            "field_type": { 
                "type": "string", 
                "enum": ["text", "select", "datetime"]
            },
            "data_type": {
                "type": "string",
                "enum": ["string", "integer", "float", "timestamp"]
            },
            "options": {
                "type": "array",
                "items": {
                    "type": "object",
                    "required": ["value", "text"],
                    "properties": {
                        "value": { "type": "string" },
                        "text": { "type": "string" }
                    }
                }
            }
        }
    }
```

**Example**

These example updates a custom attribute definition to save the document type of the user

```
curl -X PUT \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    -d '{"label":"Tipo de Documento","field_type":"select","group":"Datos del cliente","data_type":"string","options":[{"value":"CI","text":"CI"},{"value":"DNI","text":"DNI"},{"value":"LC","text":"LC"},{"value":"PASS","text":"PASS"},{"value":"LE","text":"LE"},{"value":"S/D","text":"S/D"}]}' \
    'https://api.woowup.com/apiv3/account/custom-attributes/tipo_documento'
```

**Response**

```
{
  "payload": {
    "label": "Tipo de Documento",
    "name": "tipo_documento",
    "field_type": "select",
    "data_type": "string",
    "group": "Datos del cliente",
    "options": [
      {
        "value": "CI",
        "text": "CI"
      },
      {
        "value": "DNI",
        "text": "DNI"
      },
      {
        "value": "LC",
        "text": "LC"
      },
      {
        "value": "PASS",
        "text": "PASS"
      },
      {
        "value": "LE",
        "text": "LE"
      },
      {
        "value": "S\/D",
        "text": "S\/D"
      }
    ]
  },
  "message": "ok",
  "code": "ok",
  "time": "592ms"
}
```

### DELETE /account/custom-attributes/{name}

Delete custom attribute's definition

| Parameter | Type | Required | Description                   |
| --------- | ---- | -------- | ----------------------------- |
| name      | URI  | YES      | Custom attribute's name (key) |

**Example**

```
curl -X DELETE \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    'https://api.woowup.com/apiv3/account/custom-attributes/tipo_documento'
```

**Response**

```
{
    "payload": [
        {
            "label": "Fecha de vigencia",
            "name": "vigencia",
            "field_type": "datetime",
            "data_type": "timestamp",
            "group": null
        },
        {
            "label": "Nro Socio",
            "name": "nro_socio",
            "field_type": "text",
            "data_type": "string",
            "group": "Datos del socio"
        },
        {
            "label": "Sede",
            "name": "sede",
            "field_type": "select",
            "data_type": "string",
            "group": null,
            "options": [
                {
                    "value": "Palermo",
                    "text": "Palermo"
                },
                {
                    "value": "Belgrano",
                    "text": "Belgrano"
                }
            ]
        }
    ],
    "message": "ok",
    "code": "ok",
    "time": "32ms"
```

## Custom attributes - Products

### GET /account/product-custom-attributes

List custom attribute's definitions

| Parameter | Type  | Required | Description                                     |
| --------- | ----- | -------- | ----------------------------------------------- |
| text      | query | No       | Search by attribute's name or attribute's label |
| limit     | query | No       | Items per page returned. Default 25, max 100    |
| page      | query | No       | Number of page. First page is 0                 |

**Example**

```
curl -X GET \
  -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Accept: application/json" \
  -H 'cache-control: no-cache' \
  'https://api.woowup.com/apiv3/account/product-custom-attributes'
```

**Response**

```
{
    "payload": [
        {
            "label": "Color",
            "name": "color",
            "field_type": "text",
            "data_type": "string",
            "group": null
        },
        {
            "label": "Peso",
            "name": "peso",
            "field_type": "text",
            "data_type": "integer",
            "group": null
        },
        {
            "label": "Alto",
            "name": "alto",
            "field_type": "text",
            "data_type": "string",
            "group": null
        },
        {
            "label": "Fecha lanzamiento",
            "name": "release_date",
            "field_type": "text",
            "data_type": "timestamp",
            "group": null
        }
    ],
    "message": "ok",
    "code": "ok",
    "time": "31ms"
}
```

### POST /account/product-custom-attributes

Create custom attribute's definition. The name property is the key of the attribute.

**Request content format**

```
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Definition of custom attributes",
        "type": "object",
        "required": ["name", "data_type", "field_type", "label"],
        "properties": {
            "label": { "type": "string", "minLength": 1 },
            "name": { "type": "string", "minLength": 1 },
            "field_type": { 
                "type": "string", 
                "enum": ["text", "select", "datetime"]
            },
            "data_type": {
                "type": "string",
                "enum": ["string", "integer", "float", "timestamp"]
            },
            "options": {
                "type": "array",
                "items": {
                    "type": "object",
                    "required": ["value", "text"],
                    "properties": {
                        "value": { "type": "string" },
                        "text": { "type": "string" }
                    }
                }
            }
        }
    }
```

**Example**

These example creates a custom attribute definition to save the "network" of the product

```
curl -X POST \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    -d '{"label":"Network","name":"network","field_type":"checkbox","data_type": "string","group": "Technology","options":[{"value":"GMS","text":"GMS"},{"value":"HSPA","text":"HSPA"},{"value":"LTE","text":"LTE"}]}' \
    'https://api.woowup.com/apiv3/account/product-custom-attributes'
```

**Response**

```
{
    "payload": {
        "label": "Network",
        "name": "network",
        "field_type": "checkbox",
        "data_type": "string",
        "group": "Technology",
        "options": [
            {
                "value": "GMS",
                "text": "GMS"
            },
            {
                "value": "HSPA",
                "text": "HSPA"
            },
            {
                "value": "LTE",
                "text": "LTE"
            }
        ]
    },
    "message": "ok",
    "code": "ok",
    "time": "54ms"
}
```

### PUT /account/product-custom-attributes/{name}

Update custom attribute's definition. Please be carefull whith data type's changes, you may loose information

| Parameter | Type | Required | Description                   |
| --------- | ---- | -------- | ----------------------------- |
| name      | URI  | YES      | Custom attribute's name (key) |

**Request content format**

```
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Definition of custom attributes",
        "type": "object",
        "properties": {
            "label": { "type": "string", "minLength": 1 },
            "field_type": { 
                "type": "string", 
                "enum": ["text", "select", "datetime"]
            },
            "data_type": {
                "type": "string",
                "enum": ["string", "integer", "float", "timestamp"]
            },
            "options": {
                "type": "array",
                "items": {
                    "type": "object",
                    "required": ["value", "text"],
                    "properties": {
                        "value": { "type": "string" },
                        "text": { "type": "string" }
                    }
                }
            }
        }
    }
```

**Example**

These example updates a custom attribute definition to save the "network" of the product

```
curl -X PUT \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    -d '{"label":"Network","name":"network","field_type":"checkbox","data_type": "string","group": "Technology","options":[{"value":"GMS","text":"GMS"},{"value":"HSPA","text":"HSPA"},{"value":"LTE","text":"LTE"},{"value":"S/D","text":"S/D"}]}' \
    'https://api.woowup.com/apiv3/account/product-custom-attributes/network'
```

**Response**

```
{
    "payload": {
        "label": "Network",
        "name": "network",
        "field_type": "checkbox",
        "data_type": "string",
        "group": "Technology",
        "options": [
            {
                "value": "GMS",
                "text": "GMS"
            },
            {
                "value": "HSPA",
                "text": "HSPA"
            },
            {
                "value": "LTE",
                "text": "LTE"
            },
            {
                "value": "S/D",
                "text": "S/D"
            }
        ]
    },
    "message": "ok",
    "code": "ok",
    "time": "43ms"
}
```

### DELETE /account/product-custom-attributes/{name}

Delete custom attribute's definition

| Parameter | Type | Required | Description                   |
| --------- | ---- | -------- | ----------------------------- |
| name      | URI  | YES      | Custom attribute's name (key) |

**Example**

```
curl -X DELETE \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    'https://api.woowup.com/apiv3/account/product-custom-attributes/network'
```

**Response**

```
{
    "payload": [
        {
            "label": "Color",
            "name": "color",
            "field_type": "text",
            "data_type": "string",
            "group": null
        },
        {
            "label": "Peso",
            "name": "peso",
            "field_type": "text",
            "data_type": "integer",
            "group": null
        },
        {
            "label": "Alto",
            "name": "alto",
            "field_type": "text",
            "data_type": "string",
            "group": null
        },
        {
            "label": "Fecha lanzamiento",
            "name": "release_date",
            "field_type": "text",
            "data_type": "timestamp",
            "group": null
        }
    ],
    "message": "ok",
    "code": "ok",
    "time": "49ms"
}
```

## Custom attributes - Purchases

### GET /account/purchase-custom-attributes

List custom attribute's definitions

| Parameter | Type  | Required | Description                                     |
| --------- | ----- | -------- | ----------------------------------------------- |
| text      | query | No       | Search by attribute's name or attribute's label |
| limit     | query | No       | Items per page returned. Default 25, max 100    |
| page      | query | No       | Number of page. First page is 0                 |

**Example**

```
curl -X GET \
  -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Accept: application/json" \
  -H 'cache-control: no-cache' \
  'https://api.woowup.com/apiv3/account/purchase-custom-attributes'
```

**Response**

```
{
    "payload": [
        {
            "label": "codigo_promocion",
            "name": "codigo_promocion",
            "field_type": "text",
            "data_type": "string",
            "group": null
        },
        {
            "label": "fecha_max_cambio",
            "name": "fecha_max_cambio",
            "field_type": "text",
            "data_type": "timestamp",
            "group": null
        }
    ],
    "message": "ok",
    "code": "ok",
    "time": "67ms"
}
```

### POST /account/purchase-custom-attributes

Create custom attribute's definition. The name property is the key of the attribute.

**Request content format**

```
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Definition of custom attributes",
        "type": "object",
        "required": ["name", "data_type", "field_type", "label"],
        "properties": {
            "label": { "type": "string", "minLength": 1 },
            "name": { "type": "string", "minLength": 1 },
            "field_type": { 
                "type": "string", 
                "enum": ["text", "select", "datetime"]
            },
            "data_type": {
                "type": "string",
                "enum": ["string", "integer", "float", "timestamp"]
            },
            "options": {
                "type": "array",
                "items": {
                    "type": "object",
                    "required": ["value", "text"],
                    "properties": {
                        "value": { "type": "string" },
                        "text": { "type": "string" }
                    }
                }
            }
        }
    }
```

**Example**

These example creates a custom attribute definition to save the "nombre\_promocion" of the purchase

```
curl -X POST \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    -d '{"label":"Nombre promocion","name":"nombre_promocion","field_type":"text","data_type": "string","group": null}' \
    'https://api.woowup.com/apiv3/account/purchase-custom-attributes'
```

**Response**

```
{
    "payload": {
        "label": "Nombre promocion",
        "name": "nombre_promocion",
        "field_type": "text",
        "data_type": "string",
        "group": null
    },
    "message": "ok",
    "code": "ok",
    "time": "52ms"
}
```

### PUT /account/purchase-custom-attributes/{name}

Update custom attribute's definition. Please be carefull whith data type's changes, you may loose information

| Parameter | Type | Required | Description                   |
| --------- | ---- | -------- | ----------------------------- |
| name      | URI  | YES      | Custom attribute's name (key) |

**Request content format**

```
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Definition of custom attributes",
        "type": "object",
        "properties": {
            "label": { "type": "string", "minLength": 1 },
            "field_type": { 
                "type": "string", 
                "enum": ["text", "select", "datetime"]
            },
            "data_type": {
                "type": "string",
                "enum": ["string", "integer", "float", "timestamp"]
            },
            "options": {
                "type": "array",
                "items": {
                    "type": "object",
                    "required": ["value", "text"],
                    "properties": {
                        "value": { "type": "string" },
                        "text": { "type": "string" }
                    }
                }
            }
        }
    }
```

**Example**

These example updates a custom attribute definition to save the "codigo\_promocion" of the purchase

```
curl -X PUT \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    -d '{"label": "codigo_promocion","name": "codigo_promocion","field_type": "text","data_type": "integer","group": null}' \
    'https://api.woowup.com/apiv3/account/purchase-custom-attributes/codigo_promocion'
```

**Response**

```
{
    "payload": {
        "label": "codigo_promocion",
        "name": "codigo_promocion",
        "field_type": "text",
        "data_type": "integer",
        "group": null
    },
    "message": "ok",
    "code": "ok",
    "time": "57ms"
}
```

### DELETE /account/purchase-custom-attributes/{name}

Delete custom attribute's definition

| Parameter | Type | Required | Description                   |
| --------- | ---- | -------- | ----------------------------- |
| name      | URI  | YES      | Custom attribute's name (key) |

**Example**

```
curl -X DELETE \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    'https://api.woowup.com/apiv3/account/purchase-custom-attributes/nombre_promocion'
```

**Response**

```
{
    "payload": [
        {
            "label": "codigo_promocion",
            "name": "codigo_promocion",
            "field_type": "text",
            "data_type": "integer",
            "group": null
        },
        {
            "label": "fecha_max_cambio",
            "name": "fecha_max_cambio",
            "field_type": "text",
            "data_type": "timestamp",
            "group": null
        }
    ],
    "message": "ok",
    "code": "ok",
    "time": "50ms"
}
```

## Custom attributes - Purchases Detail

### GET /account/purchase-item-custom-attributes

List custom attribute's definitions

| Parameter | Type  | Required | Description                                     |
| --------- | ----- | -------- | ----------------------------------------------- |
| text      | query | No       | Search by attribute's name or attribute's label |
| limit     | query | No       | Items per page returned. Default 25, max 100    |
| page      | query | No       | Number of page. First page is 0                 |

**Example**

```
curl -X GET \
  -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Accept: application/json" \
  -H 'cache-control: no-cache' \
  'https://api.woowup.com/apiv3/account/purchase-item-custom-attributes'
```

**Response**

```
{
    "payload": [
        {
            "label": "alto",
            "name": "alto",
            "field_type": "text",
            "data_type": "integer",
            "group": null
        },
        {
            "label": "ancho",
            "name": "ancho",
            "field_type": "text",
            "data_type": "integer",
            "group": null
        },
        {
            "label": "volumen",
            "name": "volumen",
            "field_type": "text",
            "data_type": "string",
            "group": null
        }
    ],
    "message": "ok",
    "code": "ok",
    "time": "37ms"
}
```

### POST /account/purchase-item-custom-attributes

Create custom attribute's definition. The name property is the key of the attribute.

**Request content format**

```
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Definition of custom attributes",
        "type": "object",
        "required": ["name", "data_type", "field_type", "label"],
        "properties": {
            "label": { "type": "string", "minLength": 1 },
            "name": { "type": "string", "minLength": 1 },
            "field_type": { 
                "type": "string", 
                "enum": ["text", "select", "datetime"]
            },
            "data_type": {
                "type": "string",
                "enum": ["string", "integer", "float", "timestamp"]
            },
            "options": {
                "type": "array",
                "items": {
                    "type": "object",
                    "required": ["value", "text"],
                    "properties": {
                        "value": { "type": "string" },
                        "text": { "type": "string" }
                    }
                }
            }
        }
    }
```

**Example**

These example creates a custom attribute definition to save the "garantia\_fabricante" of the purchase detail

```
curl -X POST \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    -d '{"label":"Garantia del Fabricante","name":"garantia_fabricante","field_type":"text","data_type": "string","group": null}' \
    'https://api.woowup.com/apiv3/account/purchase-item-custom-attributes'
```

**Response**

```
{
    "payload": {
        "label": "Garantia del Fabricante",
        "name": "garantia_fabricante",
        "field_type": "text",
        "data_type": "string",
        "group": null
    },
    "message": "ok",
    "code": "ok",
    "time": "52ms"
}
```

### PUT /account/purchase-item-custom-attributes/{name}

Update custom attribute's definition. Please be carefull whith data type's changes, you may loose information

| Parameter | Type | Required | Description                   |
| --------- | ---- | -------- | ----------------------------- |
| name      | URI  | YES      | Custom attribute's name (key) |

**Request content format**

```
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Definition of custom attributes",
        "type": "object",
        "properties": {
            "label": { "type": "string", "minLength": 1 },
            "field_type": { 
                "type": "string", 
                "enum": ["text", "select", "datetime"]
            },
            "data_type": {
                "type": "string",
                "enum": ["string", "integer", "float", "timestamp"]
            },
            "options": {
                "type": "array",
                "items": {
                    "type": "object",
                    "required": ["value", "text"],
                    "properties": {
                        "value": { "type": "string" },
                        "text": { "type": "string" }
                    }
                }
            }
        }
    }
```

**Example**

These example updates a custom attribute definition to save the garantia\_fabricante" of the purchase detail

```
curl -X PUT \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    -d '{"label":"Garantia del Fabricante","name":"garantia_fabricante","field_type":"text","data_type": "timestamp","group": null}' \
    'https://api.woowup.com/apiv3/account/purchase-item-custom-attributes/garantia_fabricante'
```

**Response**

```
{
    "payload": {
        "label": "Garantia del Fabricante",
        "name": "garantia_fabricante",
        "field_type": "text",
        "data_type": "timestamp",
        "group": null
    },
    "message": "ok",
    "code": "ok",
    "time": "56ms"
}
```

### DELETE /account/purchase-item-custom-attributes/{name}

Delete custom attribute's definition

| Parameter | Type | Required | Description                   |
| --------- | ---- | -------- | ----------------------------- |
| name      | URI  | YES      | Custom attribute's name (key) |

**Example**

```
curl -X DELETE \
    -H "Accept: application/json" \
    -H "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    'https://api.woowup.com/apiv3/account/purchase-item-custom-attributes/garantia_fabricante'
```

**Response**

```
{
    "payload": [
        {
            "label": "alto",
            "name": "alto",
            "field_type": "text",
            "data_type": "integer",
            "group": null
        },
        {
            "label": "ancho",
            "name": "ancho",
            "field_type": "text",
            "data_type": "integer",
            "group": null
        },
        {
            "label": "volumen",
            "name": "volumen",
            "field_type": "text",
            "data_type": "string",
            "group": null
        }
    ],
    "message": "ok",
    "code": "ok",
    "time": "56ms"
}
```


# Branches

### GET /branches

Retrieve a list of branches

| Parameter | Type  | Required | Description                                    |
| --------- | ----- | -------- | ---------------------------------------------- |
| page      | query | No       | Number of the page returned. Default: 0        |
| limit     | query | No       | Items per page returned. Default: 10, Max: 100 |

#### Example <a href="#example" id="example"></a>

```
curl -X GET \
  'https://api.woowup.com/apiv3/branches?page=0&limit=1' \
  -H 'accept: application/json' \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -H 'cache-control: no-cache'
```

#### Response <a href="#response" id="response"></a>

```
{
    "payload": [
        {
            "id": 1,
            "name": "Palermo I",
            "display_name": "Palermo",
            "description": "",
            "status": "active",
            "created": "2018-04-13 15:12:50",
            "modified": null,
            "holder": null,
            "email": null,
            "telephone": null,
            "address": null,
            "working_hours": null,
            "notes": null,
            "branch_zone_name": null
        }
    ],
    "message": "ok",
    "code": "ok",
    "time": "25ms"
}
```

#### HTTP Response codes <a href="#http-response-codes" id="http-response-codes"></a>

| HTTP Code | Name               | Description                                    |
| --------- | ------------------ | ---------------------------------------------- |
| 200       | ok                 | Successful request                             |
| 400       | bad request        | Invalid parameters                             |
| 403       | forbidden          | Invalid or inexistent apikey                   |
| 405       | method not allowed | Use an invalid http verb in the request        |
| 500       | server error       | Internal error, explained in the json response |

### GET /branches/{id}

Retrieve a specific branch identified by id.

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| id        | uri  | Yes      | Branch ID   |

#### Example <a href="#example-1" id="example-1"></a>

```
curl -X GET \
  'https://api.woowup.com/apiv3/branches/1' \
  -H 'accept: application/json' \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -H 'cache-control: no-cache'
```

#### Response <a href="#response-1" id="response-1"></a>

```
{
    "payload": {
        "id": 1,
        "name": "Palermo I",
        "display_name": "Palermo",
        "description": "",
        "status": "active",
        "created": "2018-04-13 15:12:50",
        "modified": null,
        "holder": null,
        "email": null,
        "telephone": null,
        "address": null,
        "working_hours": null,
        "notes": null,
        "branch_zone_name": null
    },
    "message": "ok",
    "code": "ok",
    "time": "25ms"
}
```

#### HTTP Response codes <a href="#http-response-codes-1" id="http-response-codes-1"></a>

| HTTP Code | Name               | Description                                    |
| --------- | ------------------ | ---------------------------------------------- |
| 200       | ok                 | Successful request                             |
| 400       | bad request        | Invalid parameters                             |
| 403       | forbidden          | Invalid or inexistent apikey                   |
| 405       | method not allowed | Use an invalid http verb in the request        |
| 500       | server error       | Internal error, explained in the json response |

### POST /branches

Create a new branch.

The json with the branch should be valid with the following [json-schema](http://json-schema.org/)

**Request content format**

```
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A branch",
        "type": "object",
        "required": ["name"],
        "properties": {
            "name": { "type": "string", "minLenght": 1, "maxLength": 128 },
            "description": { "type": ["string", "null"], "minLenght": 1, "maxLength": 100 },
            "display_name": { "type": ["string", "null"], "minLenght": 1, "maxLength": 128 },
            "email": { "type": ["string", "null"] },
            "telephone": { "type": ["string", "null"] },
            "address": { "type": ["string", "null"] },
            "working_hours": { "type": ["string", "null"] },
            "notes": { "type": ["string", "null"] },
            "branch_zone": {
                "type": ["object", "null"],
                "properties": {
                    "code": { "type": "string" },
                    "name": { "type": "string" }
                }
            },
            "holder": { "type": ["string", "null"] },
            "status": { "type": ["string", "null"], "enum": ["active", "inactive"] },
            "country": {
                "type": ["object", "null"],
                "properties": {
                    "code": { "type": "string" }
                }
            },
            "state": { "type": ["string", "null"] },
            "city": { "type": ["string", "null"] },
            "business_type": { "type": ["string", "null"], "enum": ["own", "franchisee", null] },
            "shopping_center": { "type": ["string", "null"] },
            "location_type": { "type": ["string", "null"] },
            "m2": { "type": ["integer", "null"] },
            "m2_cost": { "type": ["integer", "null"] },
            "employees_quantity": { "type": ["integer", "null"] },
            "group": { "type": ["string", "null"] },
            "format": { "type": ["string", "null"], "enum": ["brand_branch", "multibrand_branch", "brand_island", "multibrand_island", "outlet", null] },
            "is_web": { "type": "boolean" }
        }
    }
```

**Example**

This is a valid branch according to the previous [json-schema](http://json-schema.org/):

```
{
    "name" : 'Shopping de Prueba',
    "description" : "Este Shopping es una prueba para el endpoint de creación de sucursales",
    "working_hours" : "Lunes a Viernes 9.00 a 22.00 hs",
    "email" : "shopping@marca.com.ar",
    "telephone" : "01132392300",
    "holder" : "Gerente Juan Perez",
    "branch_zone_name" : "Buenos Aires",
    "country": ARG
}
```

**Errors**

| HttpCode | HttpCode Name  | Code            | Description                                       |
| -------- | -------------- | --------------- | ------------------------------------------------- |
| 201      | ok             | ok              | Branch successfully saved                         |
| 400      | bad request    | bad\_request    | Invalid parameters, view message for more details |
| 400      | bad request    | already\_exist  | The branch already exist                          |
| 500      | internal error | internal\_error | Unexpected error                                  |

### PUT /branches/{id}

Update a branch.

| Parameter | Type | Required | Description         |
| --------- | ---- | -------- | ------------------- |
| id        | URI  | Yes      | Branch Id in WoowUp |

The json with the branch should be valid with the following [json-schema](http://json-schema.org/)

**Request content format**

```
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A branch",
        "type": "object",
        "properties": {
            "name": { "type": "string", "minLenght": 1, "maxLength": 128 },
            "description": { "type": "string", "minLenght": 1, "maxLength": 100 },
            "display_name": { "type": ["string", "null"], "minLenght": 1, "maxLength": 128 },
            "email": { "type": "string" },
            "telephone": { "type": "string" },
            "address": { "type": "string" },
            "working_hours": { "type": "string" },
            "notes": { "type": "string" },
            "branch_zone_name": { "type": "string" },
            "holder": { "type": "string" },
            "status": { "type": "string", "enum": ["active", "inactive"] }
        }
    }
```

**Example**

This is a valid branch according to the previous [json-schema](http://json-schema.org/), We are going to change branch description, working hours and it's zoneN

```
{
    "description": "Este shopping es una prueba para el endpoint de actualización de sucursales",
    "working_hours": "Lunes a Viernes 11.00 a 22.00 hs",
    "branch_zone_name": "Pilar"
}
```

**Errors**

| HttpCode | HttpCode Name  | Code            | Description                                       |
| -------- | -------------- | --------------- | ------------------------------------------------- |
| 200      | ok             | ok              | Branch successfully updated                       |
| 400      | bad request    | bad\_request    | Invalid parameters, view message for more details |
| 404      | not found      | not\_found      | The branch doesn't exist                          |
| 500      | internal error | internal\_error | Unexpected error                                  |

## Delete branch

<mark style="color:red;">`DELETE`</mark> `https://api.woowup.com/apiv3/branches`

Delete a branch and its purchases

#### Request Body

| Name       | Type    | Description                       |
| ---------- | ------- | --------------------------------- |
| id         | integer | Branch Id in WoowUp               |
| notify\_to | string  | email to receive the confirmation |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "payload": {
        "request_id": "xxxx"
    },
    "message": "ok",
    "code": "ok",
    "time": "62ms"
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
{
    "payload": {
        "errors": [
            "Required properties missing: [\"id\"]"
        ]
    },
    "message": "bad request",
    "code": "bad_request",
    "time": "240ms"
}
```

{% endtab %}

{% tab title="403 " %}

```javascript
{
    "payload": [],
    "message": "forbidden: authentication failed",
    "code": "forbidden",
    "time": "7ms"
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{
    "payload": {
        "errors": "The branch doesn't exist"
    },
    "message": "not found",
    "code": "not_found",
    "time": "891ms"
}
```

{% endtab %}

{% tab title="500 " %}

```javascript
{
    "payload": [],
    "message": "",
    "code": "internal_error",
    "time": "72ms"
}
```

{% endtab %}
{% endtabs %}

**Example**

```bash
curl -X DELETE \
  https://api.woowup.com/apiv3/branches \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
	"id": 00000,
	"notify_to": "test@email.com"
}'
```

**Response**

```javascript
{
    "payload": {
        "request_id": "XXXX"
    },
    "message": "ok",
    "code": "ok",
    "time": "62ms"
}
```


# Blacklist

## Importar Blacklist

Para poder cargar teléfonos o e-mails al blacklist es necesario envíar un archivo de tipo csv cuyo contenido sea un listado de todos los teléfonos o e-mails (uno por linea) según corresponda.

| Parameter | Type  | Values                     | Required | Description              |
| --------- | ----- | -------------------------- | -------- | ------------------------ |
| file      | query |                            | Si       | Listado de teléfonos     |
| blacklist | query | 'email' o 'telephone'      | Si       | Tipo de blacklist        |
| type      | query | 'create' o 'delete-create' | Si       | Indica acción a realizar |

#### Request

```bash
$ curl 
  -F 'file=@/ruta/al/archivo.csv'
  -F 'blacklist=email'
  -F 'type=create'
  'https://api.woowup.com/apiv3/account/blacklist'
  -H 'accept: application/json' \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -H 'cache-control: no-cache'
```

#### Response

```javascript
{
    "payload": null,
    "message": "ok",
    "code": "ok",
    "time": "99ms"
}
```

## Eliminar Blacklist

Permite vaciar la lista de blacklist de teléfonos o e-mails

| Parameter | Type  | Values                | Required | Description       |
| --------- | ----- | --------------------- | -------- | ----------------- |
| blacklist | query | 'email' o 'telephone' | Si       | Tipo de blacklist |

#### Requeset

```bash
$ curl -X DELETE \
  'https://api.woowup.com/apiv3/account/blacklist'
    -d '{
  	  "blacklist" : "email"
    }'
  -H 'accept: application/json' \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -H 'cache-control: no-cache'
```

#### Response

```javascript
{
    "payload": null,
    "message": "ok",
    "code": "ok",
    "time": "99ms"
}
```


# Abandoned carts

Upload your abandoned carts to WoowUp

## Create abandoned cart

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/apiv3/multiusers/abandoned-cart`

Create an abandoned cart

#### Request Body

| Name         | Type    | Description                                                                                               |
| ------------ | ------- | --------------------------------------------------------------------------------------------------------- |
| document     | string  | Customer's document                                                                                       |
| email        | string  | Customer's email                                                                                          |
| service\_uid | string  | Customer's id                                                                                             |
| total\_price | number  | Total cart's price                                                                                        |
| external\_id | string  | Cart's identifier                                                                                         |
| source       | string  | Source of the cart (e.g. "web")                                                                           |
| recovered    | boolean | If cart was already recovered                                                                             |
| recover\_url | string  | URL of the cart so the customer can recover it                                                            |
| products     | array   | List of products. Available properties for each one: sku (mandatory), quantity, unit\_price, offer\_price |
| createtime   | string  | Create time of the cart. Format: ISO-8061                                                                 |

{% tabs %}
{% tab title="201 Cart successfully created." %}

```javascript
{
    "payload": [],
    "message": "ok",
    "code": "ok",
    "time": "56ms"
}
```

{% endtab %}

{% tab title="400 Malformed JSON" %}

```javascript
{
    "payload": {
        "errors": [
            "[An error]"
        ]
    },
    "message": "bad request",
    "code": "bad_request",
    "time": "35ms"
}
```

{% endtab %}

{% tab title="404 Could not find customer." %}

```javascript
{
    "payload": [],
    "message": "User not found",
    "code": "user_not_found",
    "time": "34ms"
}
```

{% endtab %}
{% endtabs %}

**Example**

```javascript
curl -X POST \
  https://api.woowup.com/apiv3/multiusers/abandoned-cart \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic xxxxxxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "email": "email@example.com",
    "external_id": "Cart-001",
    "source": "web",
    "recovered": false,
    "recover_url": "http://www.my-store.com/my-abandoned-cart",
    "createtime": "2019-07-10T19:12:53-03:00",
    "products": [
        {
            "sku": "12345",
            "quantity": 1,
            "unit_price": 699.0,
            "offer_price": 399.0
        }
    ],
    "total_price": 699.0
}'
```

**JSON schema**

```javascript
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A representation of an abandoned cart",
        "type": "object",
        "required": ["products"],
        "properties": {
            "service_uid": { "type": "string" },
            "email": { "type": "string" },
            "document": { "type": "string" },
            "total_price": { "type": "number"},
            "external_id": { "type": "string" },
            "source": { "type": "string" },
            "recovered": { "type": "boolean" },
            "recover_url": { "type": "string" },
            "products": {
                "type": "array",
                "items": {
                    "type": "object",
                    "required": [ "sku" ],
                    "properties": {
                        "sku": { "type": "string" },
                        "quantity": { "type": "number" },
                        "unit_price": { "type": "number" },
                        "offer_price": { "type": "number" }
                    }
                }
            },
            "createtime": { "type": "string" }
        }
    }
```


# Integration Stats

Retrieve and upload your data synchronization stats

## Create Stats

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/apiv3/integration-stats`

Create stats in WoowUp based on your processing stats. This includes files stats (eg. read lines, valid lines, invalid lines) and API Stats (e.g created/updated/failed customers). Below is the JSON-schema definition for each body parameter.

#### Request Body

| Name         | Type   | Description                                                                |
| ------------ | ------ | -------------------------------------------------------------------------- |
| customers    | object | Customers API stats: created, updated, failed.                             |
| products     | object | Products API stats: created, updated, failed.                              |
| branches     | object | Branches API stats: created, updated, failed.                              |
| purchases    | object | Purchases API stats: created, updated, duplicated, failed, revenue, units. |
| files\_stats | array  | Files stats (array of objects, one object per file)                        |

{% tabs %}
{% tab title="201 Stats successfully created" %}

```javascript
```

{% endtab %}

{% tab title="400 " %}

```
```

{% endtab %}

{% tab title="500 " %}

```
```

{% endtab %}
{% endtabs %}

#### JSON schema

```javascript
{  
	"$schema":"http:\/\/json-schema.org\/draft-04\/schema#",
	"description":"A representation of a integrations stats",
	"type":"object",
	"properties":{  
	   "customers":{  
	      "type":"object",
	      "properties":{  
	         "created":{"type":"integer"},
	         "updated":{"type":"integer"},
	         "failed":{  
	            "type":"array",
	            "items":{  
	               "type":"object",
	               "required":["element"],
	               "properties":{  
	                  "element":{"type":"object"},
	                  "message":{"type":"string"}
	               }
	            }
	         }
	      }
	   },
	   "products":{  
	      "type":"object",
	      "properties":{  
	         "created":{"type":"integer"},
	         "updated":{"type":"integer"},
	            "failed":{  
	            "type":"array",
	            "items":{  
	               "type":"object",
	               "required":["element"],
	               "properties":{  
	                  "element":{"type":"object"},
	                  "message":{"type":"string"}
	               }
	            }
	         }
	      }
	   },
	   "branches":{  
	      "type":"object",
	      "properties":{  
	         "created":{"type":"integer"},
	         "updated":{"type":"integer"},
	         "failed":{  
	            "type":"array",
	            "items":{  
	               "type":"object",
	               "required":["element"],
	               "properties":{  
	                  "element":{"type":"object"},
	                  "message":{"type":"string"}
	               }
	            }
	         }
	       }
	   },
	   "purchases":{  
	      "type":"object",
	      "properties":{  
	         "created":{"type":"integer"},
	         "updated":{"type":"integer"},
	         "duplicated":{"type":"integer"},
	         "revenue":{"type":"number"},
	         "units":{"type":"integer"},
	         "failed":{  
	            "type":"array",
	            "items":{  
	               "type":"object",
	               "required":["element"],
	               "properties":{  
	                  "element":{"type":"object"},
	                  "message":{"type":"string"}
	               }
	            }
	         }
	      }
	   },
	   "createtime":{"type":"string"},
	   "files_stats":{  
	      "type":"array",
	      "items":{  
	         "type":"object",
	         "required":["filename"],
	         "properties":{  
	            "filename":{"type":"string"},
	            "read_lines":{"type":"integer"},
	            "valid_lines":{"type":"integer"},
	            "unique_registers":{"type":"integer"},
	            "invalid_lines":{
	               "type":"array",
	               "items":{  
	                  "type":"object",
	                  "required":["line"],
	                  "properties":{  
	                     "line":{"type":"integer"},
	                     "message":{"type":"string"},
	                     "additional_details":{"type":"object"}
	                  }
	               }
	            },
	            "revenue":{"type":"number"},
	            "units":{"type":"integer"},
	            "orders_customers":{"type":"integer"}
	         }
	      }
	   }
	}
}
```

## List stats

<mark style="color:blue;">`GET`</mark> `https://api.woowup.com/apiv3/integration-stats`

Retrieve your sync stats

#### Query Parameters

| Name  | Type   | Description                          |
| ----- | ------ | ------------------------------------ |
| from  | string | Date from. Format yyyy-mm-dd         |
| to    | string | Date to. Format yyyy-mm-dd           |
| page  | string | <p>Current page. Starts at 0<br></p> |
| limit | string | Items per page. Limit 100            |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}

{% tab title="400 " %}

```
```

{% endtab %}

{% tab title="500 " %}

```
```

{% endtab %}
{% endtabs %}


# Categories

## Delete category

<mark style="color:red;">`DELETE`</mark> `https://api.woowup.com/apiv3/categories`

Delete a parent category and their childs

#### Request Body

| Name       | Type   | Description                       |
| ---------- | ------ | --------------------------------- |
| code       | string | Category code                     |
| notify\_to | string | email to receive the confirmation |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "payload": {
        "request_id": "xxxx"
    },
    "message": "ok",
    "code": "ok",
    "time": "62ms"
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
{
    "payload": {
        "errors": [
            "Required properties missing: [\"code\"]"
        ]
    },
    "message": "bad request",
    "code": "bad_request",
    "time": "57ms"
}
```

{% endtab %}

{% tab title="403 " %}

```javascript
{
    "payload": [],
    "message": "forbidden: authentication failed",
    "code": "forbidden",
    "time": "7ms"
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{
    "payload": {
        "errors": [
            "category not found"
        ]
    },
    "message": "category not found",
    "code": "not_found",
    "time": "114ms"
}
```

{% endtab %}

{% tab title="500 " %}

```javascript
{
    "payload": [],
    "message": "",
    "code": "internal_error",
    "time": "72ms"
}
```

{% endtab %}
{% endtabs %}

**Example**

```bash
curl -X DELETE \
  https://api.woowup.com/apiv3/categories \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
	"code": "abcd",
	"notify_to": "test@email.com"
}'
```

**Response**

```javascript
{
    "payload": {
        "request_id": "XXXX"
    },
    "message": "ok",
    "code": "ok",
    "time": "62ms"
}
```

## Delete categories (bulk)

<mark style="color:red;">`DELETE`</mark> `https://api.woowup.com/apiv3/categories/bulk`

Delete all categories

#### Request Body

| Name       | Type   | Description                       |
| ---------- | ------ | --------------------------------- |
| notify\_to | string | email to receive the confirmation |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "payload": {
        "request_id": "xxxx"
    },
    "message": "ok",
    "code": "ok",
    "time": "62ms"
}
```

{% endtab %}

{% tab title="403 " %}

```javascript
{
    "payload": [],
    "message": "forbidden: authentication failed",
    "code": "forbidden",
    "time": "7ms"
}
```

{% endtab %}

{% tab title="500 " %}

```javascript
{
    "payload": [],
    "message": "",
    "code": "internal_error",
    "time": "72ms"
}
```

{% endtab %}
{% endtabs %}

**Example**

```bash
curl -X DELETE \
  https://api.woowup.com/apiv3/categories/bulk \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
	"notify_to": "test@email.com"
}'
```

**Response**

```javascript
{
    "payload": {
        "request_id": "XXXX"
    },
    "message": "ok",
    "code": "ok",
    "time": "62ms"
}
```


# Segment Export

## Find Segment

## Obtains the customers of a previously scheduled segment

<mark style="color:blue;">`GET`</mark> `https://api.woowup.com/apiv3/export/segments/{id}`

Use last\_update attribute to check if segment was updated

#### Headers

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Basic {{API-KEY}} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json  |
| Accept<mark style="color:red;">\*</mark>        | String | application/json  |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "payload": {
        "segment": {
            "id": 1,
            "title": "test",
            "url": "https://example.com",
            "last_update": "YYYY-MM-DD HH:mm:ss"
        }
    },
    "message": "",
    "code": "ok",
    "time": "1ms"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```json
{
    "payload": [],
    "message": "The segment does not exist | The segment is not available for download at this time, please try again in 24 hours.",
    "code": "not_found",
    "time": "45ms"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "payload": [],
    "message": "parameters required",
    "code": "client_error",
    "time": "45ms"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    "payload": [],
    "message": "something happened",
    "code": "server_error",
    "time": "45ms"
}
```

{% endtab %}
{% endtabs %}

## Schedule Segment

## The export will be updated daily with clients who meet the conditions of the segment

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/apiv3/export/segments/{id}`

#### Headers

| Name          | Type   | Description       |
| ------------- | ------ | ----------------- |
| Authorization | String | Basic {{API-KEY}} |
| Content-Type  | String | application/json  |
| Accept        | String | application/json  |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "payload": [],
    "message": "Scheduled segment, in 24 hs the segment is going to be ready to export",
    "code": "ok",
    "time": "17ms"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "payload": [],
    "message": "Export already scheduled",
    "code": "client_error",
    "time": "19ms"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    "payload": [],
    "message": "something happened",
    "code": "server_error",
    "time": "45ms"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```json
{
    "payload": [],
    "message": "The segment does not exist",
    "code": "not_found",
    "time": "13ms"
}
```

{% endtab %}
{% endtabs %}

## Unschedule Segment

## The export will stop updating and will no longer be available

<mark style="color:red;">`DELETE`</mark> `https://api.woowup.com/apiv3/export/segments/{id}`

#### Headers

| Name          | Type   | Description       |
| ------------- | ------ | ----------------- |
| Authorization | String | Basic {{API-KEY}} |
| Content-Type  | String | application/json  |
| Accept        | String | application/json  |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "payload": [],
    "message": "Unscheduled segment",
    "code": "ok",
    "time": "21ms"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    "payload": [],
    "message": "something happened",
    "code": "server_error",
    "time": "45ms"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```json
{
    "payload": [],
    "message": "The segment does not exist",
    "code": "not_found",
    "time": "13ms"
}
```

{% endtab %}
{% endtabs %}


# Configuración Navegación Web

Cómo conectar nuestro script de seguimiento web a su sitio de comercio electrónico para hacer un seguimiento de los productos que visitan sus clientes.

## Configuración Web Tracking  / Navegación Web&#x20;

Habilitar el seguimiento de seguimiento de la navegación web en el Ecommerce requiere de la inserción 2 Scripts; una librería que se encarga de todo el proceso y un script encargado de tomar el SKU y realizar el envío de la información a tu cuenta en WoowUp.

### Agregar el Script #1 (Librería) en TODAS las páginas de su sitio.

```markup
<script src="https://assets-cdn.woowup.com/js/webtracking.min.js" type="text/javascript"></script>
```

{% hint style="warning" %}
**ADVERTENCIA:** Es necesario agregar el script #1 debajo del cierre del \</body> en **TODAS** las páginas para no perder el tracking a medida que los usuarios vayan cambiando de página.&#x20;
{% endhint %}

### Agregar el Script #2 (Capturador del SKU) en TODAS las páginas de PRODUCTO.

Existen 3 variantes de este Script, una específica para tiendas **VTEX Legacy, VTEX IO, Tienda Nube** y otra para el resto de las plataformas custom.

{% tabs %}
{% tab title="Custom" %}

```markup
<script type="text/javascript">
    let metadata = {
        sku: "XXXXXXX", // required
        price: 543.21, // required
        offer_price: 123.45 //optional, can be null
        /* if you need to send more metadata add it here */
    };

    let callback = function () {
        /* Optional: if you need to call a function after tracking put it here */
    }
    WU.track('{Your-PublicKey}', 'product-view', metadata, callback);
</script>
```

{% endtab %}

{% tab title="VTEX Legacy" %}

```markup
<script type="text/javascript">
    let metadata = {
        /* Optional: if you need to send metadata put it here */
    };

    let callback = function () {
        /* Optional: if you need to call a function after tracking put it here */
    }

    WU.trackProductVTEX('{Your-PublicKey}', metadata, callback);
    
</script>
```

{% hint style="info" %}
Debe llamar a la función WU.trackProductVTEX solo una vez por página de producto cargada.
{% endhint %}
{% endtab %}

{% tab title="VTEX IO" %}
{% code title="" %}

```javascript
<script type="text/javascript">
    let metadata = {
        sku: "XXXXXXX", // required
        price: xxxx, // required
        offer_price: xxxx //optional, can be null
        /* if you need to send more metadata add it here */
    };

    let callback = function () {
        /* Optional: if you need to call a function after tracking put it here */
    }
    WU.track('{Your-PublicKey}', 'product-view', metadata, callback);
</script>
```

{% endcode %}
{% endtab %}

{% tab title="Tienda Nube" %}

```markup
<script src="https://assets-cdn.woowup.com/js/webtracking.min.js" type="text/javascript"></script>

<script>
$( document ).ready(function(){
  if (LS.product){
    loadScript();
    setTimeout(sendSku, 1500);
  }
});
function loadScript(_callback){
   var script = document.createElement('script');
   script.src = 'https://assets-cdn.woowup.com/js/webtracking.min.js';
   var body = document.getElementsByTagName("body")[0];
   body.appendChild(script);
}
  function sendSku(){
        let skuVal = JSON.parse(document.getElementById('single-product').dataset.variants)[0].sku;
        let metadata = {
            sku: skuVal, // required
            price: 543.21, // required
            offer_price: 123.45 //optional, can be null
            /* if you need to send more metadata add it here */
        };
        let callback = function () {
            /* Optional: if you need to call a function after tracking put it here */
        };
        WU.track('{Your-PublicKey}', 'product-view', metadata, callback);
  }
</script>
```

{% endtab %}

{% tab title="E.Tres" %}
Enviar solicitud a <soporte@e3stores.com> con clave pública de la cuenta.
{% endtab %}
{% endtabs %}

{% hint style="info" %}
El script de VTEXIO se puede insertar vía Google Tag Manager
{% endhint %}

{% hint style="warning" %}
En ambas variantes **DEBES** reemplazar "{Your-PublicKey}" por la clave pública de WoowUp. La puedes encontrar en la página de configuración de WoowUp, en la sección "Mi cuenta".

**EJEMPLO**: Si tu clave pública es "12345" debe quedar asi :

```markup
WU.track('12345', 'product-view', metadata, callback);
```

{% endhint %}

{% hint style="warning" %}
**DEBES** reemplazar en  el valor sku: "XXXXXX" por la variable que almacena el SKU del producto (asegurate que es el mismo valor que está asociado a tu producto en Woowup).&#x20;
{% endhint %}

{% hint style="warning" %}
**DEBES** reemplazar en el valor `price: xx.xx` por el precio de lista del producto reemplazar el valor de `offer_price: xx.xx` por el precio de oferta.

**NOTA** si no tuviese precio oferta, simplemente no envíes este campo o puedes enviarlo con valor null.
{% endhint %}

{% hint style="warning" %}
El Script #2 **SIEMPRE** debe cargar luego de la librería para funcionar.
{% endhint %}

## Pasos a seguir en **VTEX LEGACY**

* Ingresar al CMS

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LXK8RgwLDmeqwF2H0cg%2F-LXK95WAqKVsGGlVo5ZO%2Fimage.png?alt=media\&token=56f0b9b0-2adf-4cf7-9a88-cc2bc466bfae)

* Ir al Template de Producto listado en la barra de la izquierda

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LXK8RgwLDmeqwF2H0cg%2F-LXK9Fb5XhIkd7CCdHMh%2Fimage.png?alt=media\&token=19b4d5f1-e716-46f4-afe3-4a02a3fe3745)

* Agregar el Script #2 al final de todo el código.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LXK8RgwLDmeqwF2H0cg%2F-LXK9Ml3fDrjghDvy3Xh%2Fimage.png?alt=media\&token=1ea6f224-f2f8-4d94-b3cf-34f1cf5d4202)

## Pasos a seguir Tienda Nube

* Ingresa a tu Tienda > Configuraciones > Códigos Externos&#x20;
* Busca la sección CÓDIGOS DE TRACKING
* Copia y pega el Script#2 de Tienda Nube indicado al principio del instructivo.

{% hint style="warning" %}
No te olvides de reemplazar "{Your-PublicKey}" por la clave pública de WoowUp. La puedes encontrar en la página de configuración de WoowUp, en la sección "Mi cuenta".
{% endhint %}

* Guarda los cambios

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MAg0qHFpAJ66KqMUnV9%2F-MAg2JXEXFmszFruPq0i%2Funnamed.png?alt=media\&token=191ad714-6b51-4e24-b248-b849193630a8)

## Pasos a seguir para Campaña Automatizada de Baja de Precios

Esto no es necesario en integraciones de tipo VTEX.&#x20;

Hay que agregar dos campos a la hora de realizar la sincronización en el objeto `metadata` :

`price` y `offer_price`

Ambos campos deben tener valores de tipo *float*, `offer_price` puede ser nulo.

Resultará en algo de este estilo:

{% tabs %}
{% tab title="Custom" %}

```html
<script type="text/javascript">
    let metadata = {
        sku: "XXXXXXX", // required
        price: 43.21, // must be float 
        offer_price: 12.34, //must be float or null
        /* if you need to send more metadata add it here */

    let callback = function () {
        /* Optional: if you need to call a function after tracking put it here */
    }
    WU.track('{Your-PublicKey}', 'product-view', metadata, callback);
</script>
```

{% endtab %}

{% tab title="Tienda Nube" %}

```html
<script src="https://assets-cdn.woowup.com/js/webtracking.min.js" type="text/javascript"></script>

<script>
$( document ).ready(function(){
  if (LS.product){
    loadScript();
    setTimeout(sendSku, 1500);
  }
});
function loadScript(_callback){
   var script = document.createElement('script');
   script.src = 'https://assets-cdn.woowup.com/js/webtracking.min.js';
   var body = document.getElementsByTagName("body")[0];
   body.appendChild(script);
}
  function sendSku(){
        let skuVal = JSON.parse(document.getElementById('single-product').dataset.variants)[0].sku;
        let metadata = {
            sku: skuVal, // required
            price: priceVal, // must be float
            offer_price: offerPriceVal // must be float or null
            /* if you need to send more metadata add it here */
        };
        let callback = function () {
            /* Optional: if you need to call a function after tracking put it here */
        };
        WU.track('{Your-PublicKey}', 'product-view', metadata, callback);
  }
</script>
```

{% endtab %}
{% endtabs %}


# Configuración Navegación Web en VTEX FastStore

Esta guía explica cómo activar el registro de navegación de WoowUp en una tienda FastStore. Al terminar, la tienda enviará a WoowUp los productos y las categorías que visita cada cliente identificado.

Toda la instalación se realiza desde Google Tag Manager. No es necesario modificar el código de la tienda.

***

### Requisitos

Antes de comenzar, confirma que tienes:

* [ ] La **Public Key** de la cuenta de WoowUp del cliente
* [ ] Acceso de **edición** al contenedor de Google Tag Manager de la tienda
* [ ] Un **contacto de prueba** en la cuenta de WoowUp, para verificar al final

El acceso al Tag Manager es del cliente o de su agencia. Si no lo tienes, solicítalo antes de continuar: sin ese acceso no es posible avanzar.

> **Antes de comenzar, escríbenos con la URL de la tienda.** Nosotros confirmamos que la tienda es FastStore y cuál es su contenedor de Tag Manager, y te indicamos si puedes ir directo al Paso 1 o si primero hay que agregar Tag Manager. No necesitas revisar nada por tu cuenta.

***

### Si la tienda todavía no tiene Tag Manager

Omite esta sección si ya te confirmamos el identificador del contenedor.

Agregar Tag Manager se hace **una sola vez** y es la única parte que requiere una intervención de la agencia en el proyecto de la tienda:

1. Crear un contenedor de Google Tag Manager para la tienda.
2. En el archivo `discovery.config.js` del proyecto, cargar su identificador:

   ```js
   analytics: {
     gtmContainerId: 'GTM-XXXXXXX',
   }
   ```
3. Publicar el cambio.

Una vez hecho, la agencia no vuelve a intervenir: el resto de la instalación y cualquier cambio futuro se realizan desde el Tag Manager.

***

### Paso 1 · Crear el tag en Google Tag Manager

1. En el contenedor de la tienda, crea un **nuevo tag** de tipo **HTML personalizado**.
2. Pega esta única línea, reemplazando `PUBLIC_KEY` por la Public Key de la cuenta:

   ```html
   <script src="https://assets-cdn.woowup.com/js/webtracking-faststore.min.js?k=PUBLIC_KEY"></script>
   ```
3. Asígnale el activador **Initialization** o **All Pages**.
4. Nómbralo de forma reconocible, por ejemplo `WoowUp — Webtracking`.
5. **Publica el contenedor.**

No es necesario ningún activador adicional. El conector detecta por sí mismo cada cambio de página.

Publicarlo es seguro: el conector no registra nada de los visitantes que WoowUp no reconoce, de modo que para el resto de la tienda no cambia nada.

***

### Paso 2 · Verificar

El registro de navegación solo aplica a visitantes que WoowUp ya reconoce, así que para probarlo hay que ingresar a la tienda como uno de ellos:

1. Envía una campaña de prueba a tu contacto de prueba.
2. Ingresa a la tienda haciendo clic en un enlace de ese correo. Con eso el visitante queda identificado.
3. Navega haciendo clic en: una categoría, un producto, otra categoría.

Después, en el panel de WoowUp, busca tu contacto de prueba. En unos minutos deberían aparecer:

* Los **productos vistos** que visitaste
* La **categoría visitada**

Si eso aparece, la instalación es correcta y no hay nada más que hacer.

Si no aparece nada, revisa la tabla de problemas frecuentes antes de escribirnos.

***

### Problemas frecuentes

Revisa estos casos en orden: cada uno supone que el anterior ya quedó descartado.

| Síntoma                                                                | Causa probable                                                      | Qué hacer                                                                                                                               |
| ---------------------------------------------------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| El perfil del contacto de prueba no registra ninguna visita            | No ingresaste a la tienda desde un enlace de campaña                | El registro solo aplica a visitantes que WoowUp ya reconoce. Repite el Paso 2 entrando desde un enlace del correo.                      |
| Sigue sin registrar nada, aunque ingresaste desde un enlace de campaña | La línea del tag quedó sin la Public Key                            | En el tag de Tag Manager, verifica que hayas reemplazado `PUBLIC_KEY` por la Public Key de la cuenta.                                   |
| El perfil registra la visita pero no aparecen los productos            | El código de producto no coincide con el catálogo                   | Escríbenos: hay que revisar con qué código está cargado el catálogo de esa cuenta.                                                      |
| Nada de lo anterior aplica y el perfil sigue vacío                     | El correo no es contacto de esa cuenta, o la tienda no es FastStore | Los contactos son por cuenta: verifica que el correo exista en **esa** cuenta de WoowUp. Si existe, escríbenos con la URL de la tienda. |

***

### Alcance

Esta guía cubre la instalación del registro de navegación: productos y categorías visitadas. De esos datos dependen el abandono de navegación, la fila de "más vendidos de la categoría visitada" y los segmentos por comportamiento de navegación.

**No cubre** las notificaciones push, que en FastStore se evalúan por separado.

***

### Soporte

Si algo no coincide con lo descrito en esta guía, escríbenos con estos dos datos:

* La **URL de la tienda**
* El **identificador del contenedor** de Google Tag Manager (`GTM-XXXXXXX`)

Con eso reproducimos el diagnóstico de nuestro lado. No necesitas ejecutar nada ni enviarnos ningún dato técnico adicional.


# Configuración Notificaciones Web Push en Magento / Web Custom

Cómo conectar nuestro script de notificaciones push a tu sitio de comercio electrónico para habilitar el envío de notificaciones push web.

### Instrucciones para activar notificaciones push

Habilitar el envío de notificaciones push en la web requiere de la creación de un service worker y de la inserción de dos scripts.

***Aclaración**: Es un requisito excluyente tener habilitada la funcionalidad de* [***Web Tracking***](/woowup-developer-docs/web-tracking/web-tracking) *para poder identificar al usuario y permitirle ver el pop up de suscripción.*

Es necesario que manejes las notificaciones entrantes del navegador en un Service Worker alojado en tu sitio. Los pasos a seguir son los siguientes:

1. Descarga y descomprime el siguiente archivo:

{% file src="/files/wLlBNu20dtPOW3tqtQbW" %}

&#x20;2\. Sube el archivo service-worker.js a tu sitio en la ubicación:\
&#x20;     `https://your-site.com/service-worker.js`

&#x20;3\. Abre service-worker.js en tu navegador para verificar que el archivo haya subido correctamente.

#### Ya poseo un Service Worker

En cuyo caso, solo deberías modificar tu service worker agregándole esta sentencia.

```
importScripts("https://assets-cdn.woowup.com/js/service-worker.js");
```

#### Agregar el script #1

```html
<script src="https://assets-cdn.woowup.com/js/push-notifications.min.js" type="text/javascript"></script>
```

#### Agregar el script #2

```svg
<script type="text/javascript">
    WU.pushNotifications('Your-PublicKey', 'Your-InstanceID');
</script>
```

{% hint style="warning" %}
Debes agregar los scripts en el encabezado de la página de entrada.
{% endhint %}

{% hint style="warning" %}
Es importante que respetes el orden de los scripts.
{% endhint %}

{% hint style="warning" %}
En el script #2 **DEBES** reemplazar "Your-PublicKey" por la **clave pública** de WoowUp. La puedes encontrar en la página de configuración de WoowUp, en la sección "Mi cuenta".
{% endhint %}

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2F3YrjilxTBRQHvm3OujKh%2Fimage.png?alt=media\&token=afb36251-bfbc-449b-b498-0028442020e3)

{% hint style="warning" %}
En el script #2 **DEBES** reemplazar "Your-InstanceID" por tu Instance ID de WoowUp. Lo puedes encontrar en la página de configuración de WoowUp, en la sección “Notificaciones Push".
{% endhint %}

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FTPARAAMDaRZ8Gj2Sp7mH%2Fimage.png?alt=media\&token=8964995e-a44b-485a-93c6-3e5e960255c7)

Para probar la correcta instalación y configuración de la app, puedes dirigirte al siguiente instructivo: [¿Cómo saber si la configuración fue exitosa?](/woowup-developer-docs/push-notifications/como-saber-si-la-configuracion-fue-exitosa)

#### ***Próximamente disponible en Tienda Nube, Shopify y Mercadoshops***&#x20;


# Configuración Push en VTEX Legacy

Cómo conectar nuestro script de notificaciones push a tu sitio VTEX Legacy para habilitar el envío de notificaciones push web.

### Instrucciones para activar notificaciones Push

Habilitar el envío de notificaciones push en la web requiere de la creación de un service worker y de la inserción de dos scripts.

***Aclaración**: Es un requisito excluyente tener habilitada la funcionalidad de* [***Web Tracking***](/woowup-developer-docs/web-tracking/web-tracking) *para poder identificar al usuario y permitirle ver el pop up de suscripción.*

#### Crear un Service Worker

{% hint style="info" %}
Si tienes un Service Worker ya en funcionamiento, dirígete hacía [*Ya poseo un Service Worker*](#ya-poseo-un-service-worker)
{% endhint %}

Es necesario que manejes las notificaciones entrantes del navegador en un Service Worker alojado en tu sitio. Los pasos a seguir son los siguientes:

1. Descarga y descomprime el siguiente archivo:

{% file src="/files/Igcl4mKNa0rLy4X1nc67" %}

&#x20;2\. Accede a tu portal de administración en vtex. Esto se hace ingresando a&#x20;

`https://{{tu-sitio-vtex}}.myvtex.com/admin/portal`

&#x20;3\. Ingresa a configuración de tu sitio (con el ícono de la tuerca).

![En el caso ejemplo la tienda se llama WoowUp](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FGvoSbt9aDrbFGm2ODxCv%2Fimage.png?alt=media\&token=1b3421b4-b868-44ec-aefe-423d8dca85e2)

4\. Ingresa en la pestaña Código

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2Fiu9wcQwJFTCosQQ7lGMW%2Fimage.png?alt=media\&token=bf68bd38-0158-4d52-8147-b9f70dd94b9c)

5\. Dirígete a Nuevo, y selecciona Cargar Archivo

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FaApQiNa1WcWmxwLUpx8u%2Fimage.png?alt=media\&token=a0e8c6f1-946c-4721-beee-d415168439c2)

6\. Carga el archivo nuevo.

7\. Dirígete a nuestra página principal y haz click derecho. Selecciona Inspeccionar. (Puede cambiar según el navegador y su idioma).

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FISwZ0dRYVVQhD3W0W4KR%2Fimage.png?alt=media\&token=ccbb6e35-7d4c-4c93-8d91-1ec6040965f1)

8\. Aparecerá una nueva ventana llamada Herramientas del desarrollador. Ir hacia la pestaña Aplicación. Si el service worker cargó bien, se mostrará el siguiente mensaje:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FrQIHaPph3LpFfZeIHrCC%2Fimage.png?alt=media\&token=d8ac1801-c072-4a91-9051-b3f59ef6195a)

9\. En caso contrario, sigue los siguientes pasos:

9.1: Ir hacia el panel de administración. `https://{{tu-sitio-vtex}}.myvtex.com/admin`

9.2: Dirigirse hacia:

![ ](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2Ffzwgiab2SYQkwI1kZgei%2Fimage.png?alt=media\&token=c4668f2a-2f4d-45be-bbb4-1e9939ef933b)

9.3: Nos aparecerá una pantalla, hacemos click en CMS -> HTML Templates -> Home

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FkWBp5B90au1xlybuxyjJ%2Fimage.png?alt=media\&token=333bc8dc-3d47-42c9-aeef-d58baa6381ea)

9.4 Aparecerá un texto largo donde deberas insertar el siguiente texto, antes de la linea `</head>`

```
<script type="text/javascript">
    navigator.serviceWorker.register("files/service-worker.js", { scope: "/" })
</script>
```

9.5 Presiona el botón Save Template y reintente el paso 8.

#### Ya poseo un Service Worker

En cuyo caso, solo deberías modificar tu service worker agregandole esta sentencia.

```
importScripts("https://assets-cdn.woowup.com/js/service-worker.js");
```

### Agregar Scripts a VTEX.

1: Ir hacia el panel de administración. `https://{{tu-sitio-vtex}}.myvtex.com/admin`

2: Dirigirse hacia:

![ ](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2Ffzwgiab2SYQkwI1kZgei%2Fimage.png?alt=media\&token=c4668f2a-2f4d-45be-bbb4-1e9939ef933b)

3: Nos aparecerá una pantalla, hacemos click en CMS -> HTML Templates -> Home

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FkWBp5B90au1xlybuxyjJ%2Fimage.png?alt=media\&token=333bc8dc-3d47-42c9-aeef-d58baa6381ea)

4\. Agregamos los siguiente antes de la linea `</head>`

```html
<script src="https://assets-cdn.woowup.com/js/push-notifications.min.js" type="text/javascript"></script>
<script type="text/javascript">
    WU.pushNotifications('Your-PublicKey', 'Your-InstanceID');
</script>
```

{% hint style="warning" %}
Debes agregar los scripts en el encabezado de la página de entrada.
{% endhint %}

{% hint style="warning" %}
Es importante que respetes el orden de los scripts.
{% endhint %}

{% hint style="warning" %}
En el script #2 **DEBES** reemplazar "Your-PublicKey" por la **clave pública** de WoowUp. La puedes encontrar en la página de configuración de WoowUp, en la sección "Mi cuenta".
{% endhint %}

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2F3YrjilxTBRQHvm3OujKh%2Fimage.png?alt=media\&token=afb36251-bfbc-449b-b498-0028442020e3)

{% hint style="warning" %}
En el script #2 **DEBES** reemplazar "Your-InstanceID" por tu Instance ID de WoowUp. Lo puedes encontrar en la página de configuración de WoowUp, en la sección “Notificaciones Push".
{% endhint %}

Para probar la correcta instalación y configuración de la app, puedes dirigirte al siguiente instructivo: [¿Cómo saber si la configuración fue exitosa?](/woowup-developer-docs/push-notifications/como-saber-si-la-configuracion-fue-exitosa)


# Configuración Push en VTEX IO

Cómo conectar nuestro script de notificaciones push a tu sitio VTEX IO para habilitar el envío de notificaciones push web.

### Instrucciones para activar notificaciones Push

#### Requisitos previos

Antes de realizar la instalación de la app de WoowUp es necesario que desactives la opción *Service Worker* en el panel de administrador de tu tienda VTEX. Esta opción lo encuentras en las opciones avanzadas.

<figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2F0yTSK9NSnzkFLDq8JmW7%2Fimage.png?alt=media&amp;token=fdcd3b6f-f386-4a4b-9677-eec6828cd5a2" alt=""><figcaption></figcaption></figure>

#### Instalar App de WoowUp en VTEX

Es necesario que instales la aplicación de WoowUp desde el panel de administrador de tu tienda VTEX, para ello deberás seguir los siguientes pasos:

1. Dirigite al siguiente enlace: <https://apps.vtex.com/woowup-woowup/p>
2. Pulsa el botón OBTENER APP que se encuentra en la esquina superior derecha
3. VTEX te solicitará que selecciones tu cuenta:

   <figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FJEF3eyBuzFeq427Ybbnd%2Fimage.png?alt=media&amp;token=e896f860-ad52-490b-8df3-c640284c4f00" alt=""><figcaption></figcaption></figure>
4. Confirma el pedido pulsando el botón FINALIZAR COMPRA

   <figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FHvrMG5uivfq3K1BTw9ST%2Fimage.png?alt=media&amp;token=d41cd416-ce3e-4134-8d9a-5da1f6db4c4c" alt=""><figcaption></figcaption></figure>
5. La aplicación de WoowUp ya está en tu cuenta! Ahora debes instalarla. Pulsa el botón IR A LA PÁGINA DE INSTALACIÓN

   <figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FNeOm7aRhzJXcqmTtCfoY%2Fimage.png?alt=media&amp;token=15201913-820b-43f3-9563-1f02429e43ab" alt=""><figcaption></figcaption></figure>
6. Pulsa el botón INSTALAR que está en la parte superior derecha del recuadro:

   \[insertar captura]
7. Se abrirá una pantalla de configuración. Aquí debes añadir tu **Clave Pública** y tu **Instance Id** de WoowUp y habilitar la función de *Push Notifications.*

   <figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FqNAsyhkBL7RmbqfOMoG6%2Fimage.png?alt=media&amp;token=08406457-3d8f-4333-941c-fd0b03ec0790" alt=""><figcaption></figcaption></figure>

   La **Clave Pública** de WoowUp la puedes obtener ingresando a la página de Configuración de WoowUp, en la sección "Mi cuenta"

   <figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FIluG4uJNaQhC402KFAZx%2Fimage.png?alt=media&amp;token=fc741cfd-bd83-4448-9642-70c415126b4c" alt=""><figcaption></figcaption></figure>

   El **Instance Id** de Woowup, lo puedes encontrar en la página de configuración de WoowUp, en la sección “Notificaciones Push"

   <figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FkROrAAaCJK90CWkdEfeR%2Fimage.png?alt=media&amp;token=9f9f1779-0549-4035-9837-831181350128" alt=""><figcaption></figcaption></figure>

***Aclaración**: Es un requisito excluyente tener habilitada la funcionalidad de* [***Web Tracking***](/woowup-developer-docs/web-tracking/web-tracking) *para poder identificar al usuario y permitirle ver el pop up de suscripción.*

Para probar la correcta instalación y configuración de la app, puedes dirigirte al siguiente instructivo: [¿Cómo saber si la configuración fue exitosa?](broken://pages/muVuroCqcJ6XqjpTpaEX)


# ¿Cómo saber si la configuración fue exitosa?

En este instructivo se detallan los pasos a seguir para verificar la correcta configuración de Notificaciones Push

**Paso 1**

Para probar el flujo completo del envío de Notificaciones Push, deberás simular un caso en el que un contacto haya abierto y hecho click en una campaña enviada previamente desde WoowUp.&#x20;

Para ello, se debe crear en tu cuenta de WoowUp un nuevo cliente con el email *<pruebaspush@woowup.com>*. Recuerda que pueden pasar unos minutos hasta que el nuevo cliente se vea reflejado en WoowUp.

<figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2F4QDZoTkDfDgCoAZqgZ5v%2Fimage.png?alt=media&amp;token=a0fb5c62-5d56-43ca-aa3b-246dfa4e0a9f" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Es importante que respetes el email dado, ya que a partir de él se genera un identificador único para vincularlo a la notificación push.
{% endhint %}

**Paso 2**

1. Verifica que tanto tu navegador web como tu sistema operativo tengan habilitada la configuración para poder recibir Notificaciones Push.
2. Elimina las *cookies* y la *caché* de tu navegador web.

{% hint style="warning" %}
El navegador web debe ser Google Chrome, Opera o Firefox&#x20;
{% endhint %}

**Paso 3**

Ingresa a tu tienda VTEX, al final de la URL de la tienda deberás agregar \
`"?wuid=707275656261737075736840776f6f7775702e636f6d"`, por ejemplo:

<mark style="color:blue;"><https://woowup.com/?wuid=707275656261737075736840776f6f7775702e636f6d></mark>

Al ingresar verás el Pop-Up de suscripción a Notificaciones Push.

<figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FG0Bsksc7XBizZtM9DF3M%2Fimage.png?alt=media&amp;token=2cc9be37-c8e0-4f9a-9c71-c05f39a61578" alt=""><figcaption></figcaption></figure>

Dependiendo de cómo hayas configurado las Notificaciones Push desde la configuración de WoowUp, deberás esperar cierta cantidad de *segundos* o refrescar el sitio tantas veces como hayas configurado el parámetro de *page-views*.

Debes aceptar la suscripción del pop-up presionando el botón "Si quiero!" (o el que hayas configurado para tu cuenta) y luego los permisos del navegador:

<figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FTQ8ELYYEI6GcOydGrHau%2Fimage.png?alt=media&amp;token=48f01fb2-7d8f-49d0-9fda-05297e4e3854" alt=""><figcaption></figcaption></figure>

Recomendamos comprobar que los permisos fueron concedidos ingresando a la Configuración de Notificaciones de tu navegador. Además, ingresando al perfil del usuario de prueba deberás ver habilitado el envío de Push sobre el recuadro de la izquierda:

<figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2Fz0ndb3P3gq49XMv1W5un%2Fimage.png?alt=media&amp;token=9b11e6ff-8d72-46ab-9cd6-3e6d01e0b37f" alt=""><figcaption></figcaption></figure>

Si en este paso no ves el pop-up:

* Verifica nuevamente los permisos de notificaciones push tanto del sistema operativo como del navegador web. Algunos links útiles:
  * [Google Chrome](https://support.google.com/chrome/answer/3220216)
  * [Firefox](https://support.mozilla.org/en-US/kb/push-notifications-firefox)
  * [Opera](https://help.opera.com/en/latest/web-preferences/#notifications)
  * [Mac](https://support.apple.com/en-us/HT204079)
  * [Windows](https://support.microsoft.com/en-us/windows/change-notification-settings-in-windows-8942c744-6198-fe56-4639-34320cf9444e)
* Elimina cookies y caché del navegador.
  * [Google Chrome](https://support.google.com/accounts/answer/32050)
  * [Firefox](https://support.mozilla.org/en-US/kb/clear-cookies-and-site-data-firefox)
  * [Opera](https://www.opera.com/use-cases/clean-browser-and-remove-trackers)
* Verifica que el Service Worker esté correctamente instalado:
  * Ingresa al sitio de tu tienda, haz click derecho y selecciona la opción "Inspeccionar"

    <figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FEIN6e6SRtSG8WzgtqOzF%2Fimage.png?alt=media&amp;token=d7598793-c008-41dd-b995-88e6f80056c3" alt=""><figcaption></figcaption></figure>
  * Aparecerá una nueva ventana llamada Herramientas del desarrollador. Ir hacia la pestaña Aplicación. Si el service worker cargó bien, se mostrará lo siguiente:

    <figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FFSq55np10t3yHyUe715L%2Fimage.png?alt=media&amp;token=e75ed7f2-92ff-42f7-a8f1-44afa70dfd40" alt=""><figcaption></figcaption></figure>
  * Haz click en <mark style="color:blue;">service-worker.js</mark>. Se abrirá una pestaña en el navegador, verifica que contenga la línea:

    ```
    importScripts("https://assets-cdn.woowup.com/js/service-worker.js");
    ```

{% hint style="info" %}
Puedes probar enviar un mensaje de prueba con la opción de *Enviar Test* desde el módulo de Campañas
{% endhint %}


# Formulario HTML / Script JS Newsletter

## Cómo enviar contactos a Woowup desde el popup de registro en tu web mediante un script

Si tienes un popup o landing en el cual pides datos a tus usuarios para que se registren al newsletter o a alguna promocion, es posible enviar este usuario a Woowup mediante un llamado simple de AJAX.&#x20;

{% hint style="warning" %}
Es necesario tener la **Clave Pública** de tu programa en Woowup. La puedes conseguir con rol de **Super-Admin** en la parte de configuración.
{% endhint %}

### Ejemplo jQuery

```markup
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>My Ecommerce</title>
	<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
	<script>
		var settings = {
			"async": true,
			"crossDomain": true,
			"url": "https://events.woowup.com/events/users",
			"type": "POST",
			"headers": {
				"cache-control": "no-cache",
				"content-type": "application/json"
			},
			"data": JSON.stringify({
				"app": "CLAVE_PUBLICA_WOOWUP",
				"service_uid": "9988776655",
				"document": "1122334455",
				"email": "john@doe.com",
				"tags": "ecommerce,newsletter",
				"birthdate": "1989-06-22",
				"telephone": "+549116655443322",
				"gender": "M",
				"first_name": "John",
				"last_name": "Doe",
				"custom_attributes": {
	                "one_attribute": "one value",
		            "other_attribute": "other value",
	            }
			})
		}

		$.ajax(settings).done(function (response) {
			console.log(response);
		}).fail(function (error){ 
		        console.log(JSON.stringify(error)) 
		});
	</script>
</head>
<body>
</body>
</html>
```

{% hint style="warning" %}
En el caso de los Custom\_attributes tipo **FECHA** deben ir en formato AAAA-MM-DD
{% endhint %}

### Parámetros disponibles para enviar

| Parameter                | Required |                                                                      |
| ------------------------ | -------- | -------------------------------------------------------------------- |
| app                      | yes      | Account identificator                                                |
| service\_uid             | No       | Customer's identificator                                             |
| email                    | No       | Customer's email                                                     |
| telephone                | No       | Customer's telephone                                                 |
| tags                     | No       | Comma separated tags                                                 |
| birthdate                | No       | Customer's birthday Format: YYYY-MM-DD                               |
| gender                   | No       | Customer's gender. Must be "F" or "M"                                |
| first\_name              | No       | Customer's first name                                                |
| last\_name               | No       | Customer's last name                                                 |
| mailing\_enabled         | No       | The user can or can't receive emails. Values: "enabled", "disabled". |
| mailing\_enabled\_reason | No       | Reason why the user can't receive emails.                            |
| sms\_enabled             | No       | The user can or can't receive SMS. Values: "enabled", "disabled".    |
| sms\_enabled\_reason     | No       | Reason why the user can't receive SMS.                               |

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/apiv3/users`

#### Request Body

| Name             | Type   | Description                                                                     |
| ---------------- | ------ | ------------------------------------------------------------------------------- |
| mailing\_enabled | string | <p>The user can or can't receive emails. <br>Values: "enabled", "disabled".</p> |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/apiv3/users`

#### Request Body

| Name             | Type   | Description                                                                     |
| ---------------- | ------ | ------------------------------------------------------------------------------- |
| mailing\_enabled | string | <p>The user can or can't receive emails. <br>Values: "enabled", "disabled".</p> |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

### HTTP Response Codes

| HTTP Code | Name        | Description           |
| --------- | ----------- | --------------------- |
| 200       | Ok          | Everything is ok      |
| 400       | Bad Request | Invalid parameters    |
| 403       | forbidden   | Account doesn't exist |

### Ejemplo funcional jQuery 2.2.4

{% hint style="info" %}
El código  "app": "XXXXXX" lo conseguís dentro de Configuración > Claves para desarrolladores. Es necesario tener permiso de super admin para ver las claves.
{% endhint %}

```markup
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <script
  src="https://code.jquery.com/jquery-2.2.4.min.js"
  crossorigin="anonymous"></script>
</head>
<body>
  <form action="">
    <table>
      <tr>
        <td>Email:</td>
        <td><input type="text" name="email"/></td>
      </tr>
      <tr>
        <td>Nombre:</td>
        <td><input type="text" name="first_name"/></td>
      </tr>
      <tr>
        <td>Apellido:</td>
        <td><input type="text" name="last_name"/></td>
      </tr>
      <tr>
        <td>Como nos encontraste?:</td>
        <td>
          <select name="source">
              <option value="recomendacion">Recomendación</option>
              <option value="via_publica">Publicidad vía pública</option>
              <option value="internet">Publicidad Internet</option>
          </select>
        </td>
      </tr>
      <tr><td colspan=2><button type="button" id="sent">Enviar</button></td></tr>
    </table>
  </form>
  <script>
    $(document).ready(function(){
      $("#sent").click(function(){
        var settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://events.woowup.com/events/users",
              "type": "POST",
              "headers": {
                "cache-control": "no-cache",
                "content-type": "application/json"
              },
              "data": JSON.stringify({
              "app": "CLAVE_PUBLICA_WOOWUP",
              "email": $('input[name=email]').val(),
              "tags": "ecommerce,facebook,pantalon,popup",
              "first_name": $('input[name=first_name]').val(),
              "last_name": $('input[name=last_name]').val(),
              "custom_attributes": {
	                "source": $( "select[name=source]" ).val()
	            }
            })
        }

        $.ajax(settings).done(function (response) {
          console.log(response);
        });
      });

    });
  </script>
</body>
</html>
```


# Conectar Cuenta

En esta guía paso a paso te explicaremos como conectar tu eCommerce Vtex con WoowUp

## Crear el appKEY y appTOKEN

Cada integración VTEX necesita autenticarse a través de un appKey y un appToken.

{% hint style="warning" %}
**Importante!** Solo el usuario Master de la tienda tiene permisos para trabajar con tokens.
{% endhint %}

Para crear las claves, siga estos pasos:

1. Ingrese al módulo de **License Manager** y clickee en el tab de **Accounts**.
2. Enter your account.
3. En la sección de **Security**, haga click en **Generate appKey and appToken**.

![](https://images.contentful.com/alneenqid6w5/2bpVTLrMJaigU8GCMsW66Q/8818e83c4a8b19c5780710c48f886b32/Tokens1.png)

1. Ingrese el nombre "WoowUpVTEX" para el par appKey y appToken que está creando.

![](https://images.contentful.com/alneenqid6w5/1fMVTw0E8UeS82QKWkMi8U/f5f42ed95e6c1348f96df5c08f2a66a5/Tokens2.png)

1. Click en **Generate new Tokens**.
2. El token está en el campo remarcado en la siguiente imagen. Por cuestiones de seguridad este campo es mostrado **1 sola vez**. Copie el token y guárdelo en un lugar seguro.

![](https://images.contentful.com/alneenqid6w5/1bQIctvd888suYwuQcMoqc/944b63002c7456d9228b5cd3b8b7d1ae/Tokens3.png)

**Importante:** cada par appKey y appToken, una vez que es creado, no está linkeado a ningún perfil de acceso. Por lo que se debe crear el perfil de acceso para otorgar los permisos básicos que necesita WoowUp para poder trabajar.

1. En la sección **Security**, dentro del tab Account, copiar el appKey que está en la columna "Application key column".

![](https://images.contentful.com/alneenqid6w5/11fgEJ3ymI0U6QAMK2GKcW/af0b0a303364f27951dc8fcbb2fe32be/Tokens4.png)

Con esto ya tenemos el appKey (en el paso 7) y el appToken (en el paso 6) que los utilizaremos posteriormente dentro de WoowUp para configurar la cuenta.

## Crear un perfil de acceso VTEX <a href="#creando-un-perfil-de-acceso-vtex" id="creando-un-perfil-de-acceso-vtex"></a>

En este tutorial se explicará cómo crear un perfil de acceso para poder integrar su tienda VTEX con WoowUp. Básicamente lo que vamos a intentar hacer es crear un nuevo perfil de acceso en tu panel de VTEX con los permisos necesarios como para tomar la información del catálogo.

### Creación del perfil

Primero debemos entrar a License Manager de mi tienda

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LTwYzh2Wi2pNraJoqrE%2F-LTwUr0cQH7QJd69yUgh%2Fperfil_acceso_1.png?alt=media\&token=72335409-e9c0-4a13-99bd-041da713bd2b)

Luego hacer click en "Nuevo Perfil"

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LTwYzh2Wi2pNraJoqrE%2F-LTwV1vVwScw0R8druB0%2Fperfil_acceso_2.png?alt=media\&token=7f83c457-7c8a-4de2-8f3a-82451fbb9965)

Se nos abrirá el formulario para crear el nuevo perfil de acceso. Primero ingresamos un nombre para este perfil que puede ser "Acceso WoowUp" o el nombre que desee. Luego debemos asinarle los permisos necesarios para poder acceder a la información.

Primero le daremos acceso dentro de **OMS** a los permisos que se ven a continuación, con esto ya podemos descargar las ventas realizadas.

<figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FAUqqYPKykiStZzHPVWXb%2FScreenshot_2.png?alt=media&amp;token=33db4f4f-a73c-4884-922e-9be57dd1aa41" alt=""><figcaption></figcaption></figure>

Luego necesitamos acceso para poder descargar el árbol de categorías de la tienda. Para esto daremos acceso a la administración de categorías dentro de **E-Commerce** como se muestra en la imagen.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FMKE49TGUfBcbFFJczqqx%2FScreenshot_1.png?alt=media\&token=ebfbef4a-9c6a-48cd-ab4a-fbea336fb95c)

También para poder configurar los Triggers de carrito abandonado necesitamos acceso a **Dynamic Storage**, para esto agregaremos un nuevo permiso y haremos click en el botón de **Agregar todos los recursos**

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LTwYzh2Wi2pNraJoqrE%2F-LTwVjMPxxwZ89N3XtvX%2Fperfil_acceso_4_2.png?alt=media\&token=1824ef1c-6823-4399-961f-a766204d7393)

Por último lo que tenemos que hacer es agregar un usuario, aquí buscaremos el appKey que creamos previamente.

![](https://images.contentful.com/alneenqid6w5/GbnyArnJEyII6WISiakG6/5333d7dfe7aae3c46f28376b56b0a87e/Tokens5.png)

Una vez agregado el usuario guardaremos el perfil de acceso creado y listo! ya tenemos nuestro perfil de acceso configurado.

## Ingresar los datos de acceso VTEX en WoowUp

Para cargar estos datos e deben realizar los siguientes pasos:

1.Entrar en la pantalla de configuración desde la barra superior:

<div align="left"><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LTwdLqOfcVRBFRB_2qQ%2F-LTwdiyf4Yu4uk4zXij9%2FScreenshot%202018-12-17%20at%2011.51.25.png?alt=media&amp;token=1cc30485-a4ba-457c-9336-e2e2d5fd0fdd" alt=""></div>

2.En la sección de Integraciones, entrar en VTEX:

<div align="left"><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LumK6BnFxjhpvXgR1Af%2F-LumKEGUyY9WACut9KTo%2FScreen%20Shot%202019-11-28%20at%2010.58.16.png?alt=media&amp;token=254f9f32-eb10-448b-875f-311a0d532039" alt=""></div>

3.Completar la URL de la tienda, AppKey, AppToken y el Nombre de la Tienda.

4\. Activar la integración desde el botón activado/desactivado.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LumJWoIDICMgTem7_Fn%2F-LumJxAQBsBEZyjPvexf%2FScreen%20Shot%202019-11-28%20at%2011.03.50.png?alt=media\&token=90e805d1-71db-42ef-bf7d-2f2ed5d49209)

Si conoce los estados de las facturas puede ingresarlo en el campo "Estados de ventas para descargar" (separados por "," y sin espacios)

Estos son los estados disponibles para descargar:

waiting-for-sellers-confirmation&#x20;

payment-pending&#x20;

payment-approved&#x20;

ready-for-handling&#x20;

handling&#x20;

invoiced&#x20;

canceled

Haz click en **Guardar** y así guardará los datos ingresados.


# Trigger Carrito Abandonado

Configuración del trigger que envía carritos abandonados de clientes en VTEX a Woowup.

## Como configurar:&#x20;

En este tutorial se explicará cómo crear y activar un trigger para detectar los carritos abandonados por los usuarios. El motivo de este trigger es enviar un request  con la información del carrito abandonado a Woowup para poder disparar distintas campañas basadas en esta actividad.

### Creación del trigger

* Entrar a DS (dynamic storage) [http://TIENDA.ds.vtexcrm.com.br/](http://tienda.ds.vtexcrm.com.br/)
* Click en el tab **Trigger**;
* Click en el botón **Novo**;
* Escriba el nombre del trigger (por ejemplo Carrito WoowUp);
* En Entidade, seleccione el valor **Cliente**;
* En Status, marque **Ativo**;
* En Condição do trigger, seleccione **O valor de um atributo for alterado**;
* En Informe o atributo, seleccione **Última sessão**;

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LU6wpB_PnMyUxsd-9WV%2F-LU6wulz57_0T1Qf7G1T%2Fimage.png?alt=media\&token=f52a93c4-0b81-4df9-958c-8b04ee510806)

Una vez configurado el filtro adicional con sus valores, siga los pasos siguientes:&#x20;

1\. Haga clic en la pestaña **Agendamento**;&#x20;

2\. Seleccione una de las opciones de envío.&#x20;

Agendar ejecución para una fecha dinámica, [FECHA ACTUAL](https://help.vtex.com/es/tutorial/configurando-carrito-abandonado) más 2 horas;![ConfiguraçãoAgendamento](https://images.contentful.com/alneenqid6w5/1geardBUo2OSUyCAeYMoM2/9b177821fd32a2fb71c3f39460dd48c4/Configura_C3_A7_C3_A3oAgendamento.png)<br>

### Acción en caso Positivo

En la solapa de "Acciones en caso positivo" poner los siguientes datos:&#x20;

Acción: **Realizar un request HTTP**

**URL**:

```
https://admin.woowup.com/Webhooks/VtexAbandonedCart?app_id={APP_ID} 
```

{% hint style="warning" %}
Reemplazar {APP\_ID} por el numero que aparece en la URL de tu programa
{% endhint %}

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LyZfJsOYbmZzGz0pMZC%2F-LyZvtHcQGtuT3oGmlY2%2FScreen%20Shot%202020-01-14%20at%2012.28.58.png?alt=media\&token=49a551d2-8568-45a9-b5e8-ef8f491847b0)

Verbo: **POST**&#x20;

**JSON**: (Copiar y pegar todo el código de llave a llave)

```javascript
{
    "email": "{!email}",
    "firstName": "{!firstName}",
    "lastName": "{!lastName}",  
    "interestBrands": "{!interestBrands}",
    "isNewsletterOptIn": "{!isNewsletterOptIn}",
    "isCorporate": "{!isCorporate}",
    "rclastcart": "{!rclastcart}",
    "rclastcartvalue": "{!rclastcartvalue}",
    "rclastsession": "{!rclastsession}",
    "rclastsessiondate": "{!rclastsessiondate}",
    "homePhone": "{!homePhone}",
    "phone": "{!phone}",
    "userId": "{!userId}",
    "document": "{!document}",
    "carttag": {!carttag},
    "checkouttag": {!checkouttag},
    "corporateDocument": "{!corporateDocument}",
    "corporateName": "{!corporateName}",
    "documentType": "{!documentType}",
    "gender": "{!gender}",
    "id": "{!id}",
    "accountId": "{!accountId}",
    "accountName": "{!accountName}",
    "dataEntityId": "{!dataEntityId}"
}
```


# Trigger Newsletter

Debes agregar la entidad en la que almacenes los registros de Newsletter, puede ser en la entidad Cliente o nuevas entidades que hayan creado.

## Como configurar: Trigger de Newsletter en VTEX

En este tutorial se explicará cómo crear y activar un trigger para usuarios que se registran al newsletter.&#x20;

El motivo de este trigger es enviar la información de registro a Woowup para poder disparar distintas campañas basadas en actividad de lista.

### Creación del trigger

Entrar a DS (dynamic storage) [http://TIENDA.ds.vtexcrm.com.br/](http://tienda.ds.vtexcrm.com.br/) y crear un nuevo trigger con los siguientes parámetros: (Reemplaza TIENDA por el nombre de tu tienda VTEX)

* Entidad de datos: Cliente
  * Debes agregar la entidad en la que almacenes los registros de Newsletter, puede ser en la entidad *Cliente* o nuevas entidades que hayan creado.
* Condición de trigger: Un registro fue insertado
* Agendamiento: Marcar la opción "Ejecutar lo más rápido posible"

### Acción en caso Positivo

Como acción en caso positivo crear un request HTTP con los siguientes parámetros:

* **URL**:&#x20;

```
https://admin.woowup.com/webhooks/vtexregister?app_id=APP_ID
```

{% hint style="warning" %}
El ID de tu cuenta lo puedes conseguir ingresando en WoowUp, sección de configuraciones, específicamente en *Mi Cuenta* y encontrarás el *ID Cuenta*
{% endhint %}

<figure><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FOZMlyO87N1AhK83QfLE2%2Fimagen.png?alt=media&amp;token=a237f0f9-1e2e-45da-a4ef-305fb98a2540" alt=""><figcaption></figcaption></figure>

* **Verbo**: POST&#x20;
* **JSON**: Pegar el JSON  en el lugar correspondiente. No es obligatorio que estén todos los datos.

```javascript
{
    "first_name": "{!firstname}",
    "last_name": "{!lastname}",    
    "email": "{!email}",
    "tags": "{!tags}",
    "gender": "{!gender}",
    "mailing_enabled": "{!mailing_enabled}"
}
```

{% hint style="info" %}
TAGS: Puedes agregar más de 1 tag si colocas una “**,**” entre ellos, te permitirá identificar mejor a tus registros.

Ten presente que los únicos datos válidos para este trigger son los enumerados previamente.\
Si quieres sumar otros datos como la fecha de nacimiento o el teléfono, recomendamos que utilices la documenctación de nuestro "Formulario HTML / Script JS Newsletter".
{% endhint %}


# VTEX APP Instalación

En esta guía se te detallará paso a paso como instalar la aplicación de Woowup en VTEX

### INSTALACIÓN DE LA APLICACIÓN EN VTEX

Ingresamos a nuestro panel de administración de VTEX, en la parte izquierda, desplazamos a la sección de **Configuración de cuenta**, desacoplamos la opción **Apps** e ingresamos a **Tienda de aplicaciones.**

![Sección Configuración de Cuenta](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FUCABSKfBRCytAvDPfuUC%2Fimage.png?alt=media\&token=0994c24d-89a2-4aaf-898a-9841007d67a2) ![Tienda de aplicaciones](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FA2iqQfTlYVWBvwdE6pea%2Fimage.png?alt=media\&token=46e5039a-c1b5-445c-93c7-9349af2cb05d)

Una vez ingresado a la Tienda de aplicaciones, desplazamos al fondo de la página, y en la parte superior del buscador ingresamos *Woowup*.&#x20;

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2F4CUvqBe5VoGC0uNIstx6%2Fimage.png?alt=media\&token=a60c6785-ecf4-4d5a-871e-2049a01007f6)

Nos aparecerá la aplicación de Woowup, ponemos **instalar** esto nos redireccionara a la página de la aplicación

![HAY QUE CAMBIAR ESTA IMAGEN POR LA DE WOOWUP CUANDO LA TENGAMOS](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FP4AdBqAU7JjcPRSh5icD%2Fimage.png?alt=media\&token=fa919da9-941a-455b-8cc3-5115f679d9e5)

Ponemos **OBTENER APP** y luego nos figurara un cartel preguntándonos a qué tienda queremos instalar la aplicación.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2F8fjOCJAIuXc9o9NUCoWF%2Fimage.png?alt=media\&token=4089dac1-ff89-4fed-8257-17b5d3aad370)

Elegimos la tienda y confirmamos. Una vez confirmado nos redireccionará y nos mostrara la siguiente ventana. Seleccionamos **FINALIZAR COMPRA.**

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FUEzPKadUFpeD1EEGqOig%2Fimage.png?alt=media\&token=1071a5c5-71b3-46c7-a0b5-3b980767bf72)

Esta nos llevará a la siguiente pantalla

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FwsULTE6uICNdqFNUgIb9%2Fimage.png?alt=media\&token=6535222b-0baa-47ca-a5eb-8c5fc65a2a29)

Una vez pulsado el botón de **Ir a la página de instalación** ya estaremos listos para realizar la configuración de la aplicación.

### CONFIGURANDO LA APLICACIÓN


# VTEX APP Configuración

En esta guía se te detallará paso a paso como configurar la aplicación de Woowup en VTEX

{% hint style="warning" %}
Antes que nada, tenemos que haber instalado la aplicación de Woowup en la Store de VTEX. En caso de no haberla instalado, puede acceder a nuestra [guía de instalación](/woowup-developer-docs/vtex/vtex-app-instalacion) de la aplicación.
{% endhint %}

Primero, entrar al panel de administración de la tienda e ingresar en **Apps instaladas** en la opción **Woowup**

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2F36cC5k6x3gziD3qoZjdE%2Fimage.png?alt=media\&token=fb1c6d7e-ee7a-4b56-a7a8-ae7ad28fce66)

Aparecerá un formulario con distintos campos. Se debe completar con la siguiente información.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FY0ttyoeuzW7uL6E4U45q%2Fimage.png?alt=media\&token=6afcc4ba-25c3-4774-8a32-013100cb992e)

**URL**: Ingresamos la dirección web de tu tienda.

**Estados de venta para descargar**: Si conoce los estados de las facturas puede ingresarlo en el campo "Estados de ventas para descargar" (separados por "," y sin espacios)

Estos son los estados por defecto disponibles para descargar:

* waiting-for-sellers-confirmation
* payment-pending&#x20;
* payment-approved&#x20;
* ready-for-handling&#x20;
* handling&#x20;
* invoiced&#x20;
* canceled

{% hint style="info" %}
Puede darse el caso que estos campos estén modificados. En caso de que sea así, modificar segun corresponda.
{% endhint %}

&#x20;

**Nombre de la tienda**: Aquí ingresamos el nombre de la tienda VTEX. \
Viene dado como prefijo en los dominios `.vtexcommercestable.com.br`

**Seller:** *Opcional***.** Ingresamos el nombre del seller.

**App Key/App Token**: Estas claves las obtenemos siguiendo [esta guía](/woowup-developer-docs/vtex/vtex-connect-account).

**Descarga de categorias**: Elegimos si activamos o desactivamos esta opción.

**Sales Channel**: *Opcional*. Ingresamos el canal de ventas si es que existiese.

**Woowup VTEX Token**: Este campo lo obtenemos ingresando a Woowup, ir a configuración, ir a la sección integraciones y seleccionar la integración VTEX. Copiar el código VTEX Token provisto.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FyXiK1S7oQ60kj7IpH61j%2Fimage.png?alt=media\&token=0b60694d-fa57-40f0-bda6-9b1e6783915b)

Una vez completado el formulario. Hacemos click en Guardar y esto se integrará con Woowup.


# Conectar Cuenta

### How to integrate Magento with WoowUp? <a href="#how-to-integrate-magento-with-woowup" id="how-to-integrate-magento-with-woowup"></a>

#### Create a Role <a href="#create-a-role" id="create-a-role"></a>

The first step in this process is to create a Role.

To create a Role:

* From the Magento dashboard, go to **System > Web Services > SOAP/XML-RPC - Roles**

<div align="left"><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LTwg6_Sl9B5HNLUumex%2F-LTwk9m847Dn6fKyd37l%2Fimage.png?alt=media&amp;token=befbf5d5-f72e-4822-8f93-be89ea087821" alt=""></div>

* Click Add New Role:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LTwkysBn9gxenyejOWb%2F-LTwlwYbslaxZgRE-vh8%2Fimage.png?alt=media\&token=c32a53d4-c3e0-4db3-9d5f-99eab79a2a8d)

* Under **Role Information**, click **Role name** and type in the word **Everything**.
* Click **Save Role**:
* Under **Role Information**, click **Role Resources**.
* From the dropdown list, select All.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LTwkysBn9gxenyejOWb%2F-LTwn9c-w4jRbQTF2cBb%2Fimage.png?alt=media\&token=d5910da6-23bd-46b3-b7f1-405e29a06ce2)

* Click **Save Role**:

#### Create a User <a href="#create-a-user" id="create-a-user"></a>

After the **Role** has been created, you need to create a **User**.

To create a User:

* Click **System** in the top menu and go to **Web Services > SOAP/XML-RPC - Users**:
* Click **Add New User**:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LTwnLuH7qTwInAoYy5e%2F-LTwnRZMQkB63O22BiH-%2Fimage.png?alt=media\&token=d0326dc9-eaab-4f27-aece-0f73a9ee602f)

* Fill out the data fields. The **Username** and **New API Key** fields hold the information you need to integrate with **WoowUp Brain**.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LTwqYWS0sczBow-qJMA%2F-LTwqbPX8syASGp6F4Gr%2Fimage.png?alt=media\&token=24deb609-878d-4dc9-af45-d5333877e6f1)

* Click **Save User**

#### Add User to Role <a href="#add-user-to-role" id="add-user-to-role"></a>

After you've created a Role and a User, you need to associate the two together.

To add a User to a Role:

* Under **User Information** click **User Role**.
* Select the Role you created.
* Click **Save User**:

\
**Important:**&#x4F;nce you have finished this steps, send the **Username** and **API Key** to the WoowUp team.

### How do you get your orders status? <a href="#how-do-you-get-your-orders-status" id="how-do-you-get-your-orders-status"></a>

\
1 - Login to Magento Admin Panel, go to System -> Order Statuses:![](http://docs.woowup.com/howto/src/magento/magento-order-status1.png)\
2 - In the list you can see your order statuses.![](http://docs.woowup.com/howto/src/magento/magento-order-status2.png)\
3 - Choose what statuses you want to download into WoowUp and send to us the values of the "Status Code" column to <developers@woowup.com>


# Extension Carrito Abandonado

## Extensión de carritos de compra abandonados

En este tutorial se explicará cómo instalar la extensión para detectar los carritos abandonados por los usuarios. El objetivo de la extensión es enviar la información del carrito abandonado a WoowUp para poder disparar distintas campañas basadas en esta actividad.

#### Requisitos para la instalación <a href="#requisitos-para-la-instalacin" id="requisitos-para-la-instalacin"></a>

* Un representante de Woowup le haya enviado el paquete de la extensión
* Tener acceso al panel de administración de la tienda.
* **Configuración técnica:** consultar con los representantes técnicos de su tienda si se encuentra en funcionamiento la herramienta “Cron” en el servidor donde está configurada su tienda. \
  Tener esta herramienta configurada es necesaria para el funcionamiento de la extensión. \
  Puede solicitarle la configuración a su proveedor de Soluciones Ecommerce o al administrador técnico de su tienda. \
  [*Link de referencia para la configuración*](http://devdocs.magento.com/guides/m1x/install/installing_install.html#install-cron)

Descarga la extensión desde aquí:

{% file src="/files/-MVXv-JheZJPmDG5ngFZ" %}

#### Pasos para la instalación <a href="#pasos-para-la-instalacin" id="pasos-para-la-instalacin"></a>

1. Iniciar sesión en el panel de administración de la tienda y entrar desde la barra de opciones a la sección: **System** > **Magento Connect** > **Magento Connect Manager** \
   (Si le pide autenticación, por favor ingrese sus credenciales de administrador)&#x20;

\
Debería aparecer en una sección como esta:

1. En la sección “Direct package file upload”:![](http://docs.woowup.com/howto/src/magento/magento_ac_2.png)

   Seleccione el archivo que le envió nuestro representante (o descargue directamente de la página) y haga clic en el botón “Upload” para instalar la extensión. <br>
2. En la parte inferior, en un recuadro como el de abajo le va a mostrar el estado de la instalación:![](http://docs.woowup.com/howto/src/magento/magento_ac_3.png)

   \
   Una vez instalada la extensión, si recarga la página o hace click en el botón "Refresh" abajo del recuadro negro, en el listado con todas las extensiones instaladas, va a encontrar a WoowUp de esta forma:![](http://docs.woowup.com/howto/src/magento/magento_ac_4.png)

   \
   Una vez hecho esto, la extensión queda configurada y comenzará a enviar a la plataforma WoowUp la información relacionada con los carritos abandonados por los clientes.&#x20;

{% hint style="info" %}
***En caso de encontrar un problema con la instalación o con el proceso, o incluso cualquier inquietud sobre el funcionamiento de la extensión, por favor comunicarse con el*** [***soporte***](mailto:ayuda@woowup.com) ***de WoowUp así le brindan la ayuda necesaria.***
{% endhint %}


# Conectar Cuenta

En esta guía paso a paso te explicaremos como conectar tu eCommerce Magento 2 con WoowUp

### Crear un Rol de usuario <a href="#crear-un-rol-de-usuario" id="crear-un-rol-de-usuario"></a>

El primer paso en este proceso es crear un Rol de usuario.

Para crear un rol:

* Desde el panel de Magento, ir a **System > Permissions > User Roles**:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI52OH0hDTDk2cGQHu%2F-MHI5TVhH4fbZHC_PibI%2Fimage.png?alt=media\&token=e14dcbbf-14b3-4e66-a451-103f3d357a9c)

* Clickear **Add New Role**:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI52OH0hDTDk2cGQHu%2F-MHI5WnANWWh86LX_5Gl%2Fimage.png?alt=media\&token=7ae3fb57-8fc6-4317-bb90-42026cbf26c3)

* Bajo **Role Information**, clickear **Role info** y escribir en **Role name** un nombre para el rol que vamos a crear, por ejemplo, "WoowUp". En el cuadro llamado **Your password** coloca tu contraseña de administrador de Magento.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI52OH0hDTDk2cGQHu%2F-MHI5ZybhLyoNYNyoE_G%2Fimage.png?alt=media\&token=33e40c07-c39e-42c0-a00c-11d4d254edb6)

* En **Role Information**, selecciona **Role Resources**.
* En el menú de selección **Resource Access**, elige la opción **All**.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI52OH0hDTDk2cGQHu%2F-MHI5eAd-YjlRuvBISy1%2Fimage.png?alt=media\&token=48086c0a-a5c3-45dc-8df0-af6ca2b25561)

* Clickea **Save Role**:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI52OH0hDTDk2cGQHu%2F-MHI5iMKtIeku1zmC21R%2Fimage.png?alt=media\&token=6fbfc4ad-f8be-4729-837e-49f593e0e5da)

### Crear un Usuario <a href="#crear-un-usuario" id="crear-un-usuario"></a>

Luego de crear un Rol, debemos crear un Usuario.

Para crear un usuario:

* Clickea **System** en el menú lateral izquierdo y selecciona **Permissions > All Users**:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI52OH0hDTDk2cGQHu%2F-MHI5m7Er33RDqPJ1s-x%2Fimage.png?alt=media\&token=2acf37ec-0ed5-4a08-8028-c01af6e4e1ac)

* Clickea **Add New User**:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI52OH0hDTDk2cGQHu%2F-MHI5rVyBBk5_cxpU735%2Fimage.png?alt=media\&token=87698ed9-d0b3-4402-9817-9801bc82ab60)

* Rellena los datos. Los campos **User Name** y **Password** son los que vamos a necesitar para conectarnos a WoowUp, así que por favor cópialos o **anótalos aparte**. Debajo, en el campo **Your Password** escribe tu contraseña de administrador de Magento.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI52OH0hDTDk2cGQHu%2F-MHI5wxKgsGwikb-H99J%2Fimage.png?alt=media\&token=563e59b9-a33a-435c-bbe4-4d3eaaef3a80)

* A la izquierda, en **User Information**, selecciona la pestaña **User Role**.
* Selecciona el Rol que habíamos creado anteriormente.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI52OH0hDTDk2cGQHu%2F-MHI60BasvcVuYe7Yqrf%2Fimage.png?alt=media\&token=61e6623c-6a03-413e-a492-03e6734cfae8)

* Clickea **Save User**:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI52OH0hDTDk2cGQHu%2F-MHI632TTJE6Drmmr6PP%2Fimage.png?alt=media\&token=72655ddb-3102-4b3e-afad-f51186ce4470)

**Importante: una vez que hayas completado los pasos, envía el Username y la Password, junto con la URL de tu admin de Magento al equipo de WoowUp.**

### ¿Cómo ver los posibles estados de mis ventas? <a href="#cmo-ver-los-posibles-estados-de-mis-ventas" id="cmo-ver-los-posibles-estados-de-mis-ventas"></a>

1 - En el panel de Magento, ve a **Stores -> Settings -> Order Status**:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI52OH0hDTDk2cGQHu%2F-MHI66sbdPcHa3Z0_Uqy%2Fimage.png?alt=media\&token=bd98624f-9cdb-4134-8eed-740fd34790d5)

2 - En la lista puedes ver los distintos estados.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI52OH0hDTDk2cGQHu%2F-MHI69bh12E6mWyLOT2O%2Fimage.png?alt=media\&token=8f420a8d-86b2-4249-b700-90dab4f3fcb9)

## Ingresar las credenciales de Magento 2 en WoowUp

Para cargar estos datos e deben realizar los siguientes pasos:

1.Entrar en la pantalla de configuración desde la barra superior:

<div align="left"><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LTwdLqOfcVRBFRB_2qQ%2F-LTwdiyf4Yu4uk4zXij9%2FScreenshot%202018-12-17%20at%2011.51.25.png?alt=media&amp;token=1cc30485-a4ba-457c-9336-e2e2d5fd0fdd" alt=""></div>

2.En la sección de Integraciones, entrar en Magento:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI52OH0hDTDk2cGQHu%2F-MHI7VVngId7Wyr7JfvN%2Fimage.png?alt=media\&token=c85499be-abde-4054-a701-1142cb9da57d)

\
3.Completar:‌

* Versión=2
* URL de la Tienda de Magento
* Nombre de Usuario
* Contraseña
* Estados de venta a Descargar
* ID de la tienda en caso de que tenga varias.
* Tipo de productos a descargar
* Activar Extensión del carrito abandonado
* Seleccionar si desea descargar las categorías

‌

4\. Activar la integración desde el botón activado/desactivado y guardar los datos.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI52OH0hDTDk2cGQHu%2F-MHI7ZCIgRINQjKZPsst%2Fimage.png?alt=media\&token=5b8fb951-1825-4726-8c09-1ed7ed2f8e5a)


# Conectar Cuenta

Crea las credenciales necesarias y conecta tu cuenta de Shopify a Woowup.

## Generar credenciales desde el administrador de Shopify.&#x20;

Antes de que pueda autenticar una aplicación privada en Shopify, deberá generar las credenciales requeridas del administrador de Shopify de la tienda que desea conectar con su aplicación.&#x20;

Desde tu administrador de Shopify, ve a Aplicaciones.

* Haga clic en **Desarrollar aplicaciones para tu tienda**, en la parte inferior de la página.
* Haga clic en **Crear una Aplicación**
* En la sección de detalles de la aplicación, ingrese un nombre para la aplicación y una dirección de correo electrónico de contacto.

Shopify usa la dirección de correo electrónico para ponerse en contacto con el desarrollador si hay un problema con la aplicación privada.

Deberás configurar el alcance de la API del panel de control y ahí deberás seleccionar todos los permisos que contengan la palabra **READ**

Una vez realizado, harás clic en **Instalar Aplicación** y Shopify te releva el **TOKEN** por única vez:<br>

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2F76EgOxHGuvE8HItCOoy0%2Fimage.png?alt=media\&token=bda9575a-e2d6-4f4d-967f-4924d8998860)

Este dato será tu **contraseña** de Shopify, lo guardaras para completarlo en WoowUp.

Y el campo **Clave API** será tu **APP KEY** que lo completaras en WoowUp&#x20;

Una vez que tengas las credenciales creadas, ingresa a Woowup > Configuración > Integraciones > Shopify e ingresa estos datos en la pantalla.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRNHU4Ej62060lN40uV%2Fuploads%2FfLA7n6xORsUuPmKo2irA%2Fimage.png?alt=media\&token=32fdd4c3-5416-49ea-b469-fd054910e012)

* Dominio de la tienda: es la URL de tu WEB para el cliente
* Nombre de la tienda: Es el nombre que te asigna Shopify para tu tienda
* App Key: Es la Clave API KEY
* Contraseña: Es el token que te lo indica una sola vez Shopify
* Descargar Categorías: Indicas si quieres obtener las Smart Collections desde Shopify

*Por la integración entre WoowUp y Shopify, actualmente solo es posible descargar las categorías denominadas "Smart Collections".*

*Ten en cuenta que las demás categorías o colecciones creadas manualmente en Shopify no están disponibles para descargar directamente a través de la integración con WoowUp.*

Haz clic en el botón de Activar y luego Guarda la configuración.

En caso de tener alguna duda con este proceso, contactar al equipo de [soporte](mailto:ayuda@woowup.com) de Woowup.


# Conectar Cuenta

En esta guía paso a paso te explicaremos como conectar tu eCommerce Woocommerce con WoowUp

## How to integrate Woocomerce with WoowUp?

### Requirements <a href="#section-1" id="section-1"></a>

WordPress permalinks must be enabled at: **Settings > Permalinks**.

### Generate API keys <a href="#section-2" id="section-2"></a>

The WooCommerce REST API works on a key system to control access. These keys are linked to WordPress users on your website.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MFCSbuWn3LhGVSMaDks%2F-MFCTOTagKX7wCMUsoiq%2Fimage.png?alt=media\&token=88dadca9-233a-4862-8333-76d537d37a12)

To create or manage keys for a specific WordPress user:

1. Go to: **WooCommerce > Settings > Advanced > REST API**.\
   *Note: Keys/Apps was found at **WooCommerce > Settings > API > Key/Apps** prior to WooCommerce 3.4*.
2. Select **Add Key**. You are taken to the **Key Details** screen.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MFCSbuWn3LhGVSMaDks%2F-MFCTVqe7SMsyCOk5ZhB%2Fimage.png?alt=media\&token=84bd50e6-9972-4435-955b-1919f4dd531d)

1. Add a **Description**.
2. Select the **User** you would like to generate a key for in the dropdown.
3. Select a level of access for this API key — **Read** access, **Write** access or **Read/Write** access.
4. Select **Generate API Key**, and WooCommerce creates API keys for that user.

&#x20;Now that keys have been generated, you should see **Consumer Key** and **Consumer Secret** keys, a QRCode, and a Revoke API Key button.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MFCSbuWn3LhGVSMaDks%2F-MFCTkg_HgCTkMBlPQOO%2Fimage.png?alt=media\&token=bf687d75-ca5c-4e2e-af0a-596f6453a9ee)

&#x20;The **Consumer Key** and **Consumer Secret** may be entered in the application using the WooCommerce API, and the app should also request your URL.

{% hint style="info" %}
&#x20;Technical documentation for the REST API [can be found here](https://woocommerce.github.io/woocommerce-rest-api-docs/).&#x20;
{% endhint %}

## Ingresar las credenciales de Woocomerce en WoowUp

Para cargar estos datos e deben realizar los siguientes pasos:

1.Entrar en la pantalla de configuración desde la barra superior:

<div align="left"><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LTwdLqOfcVRBFRB_2qQ%2F-LTwdiyf4Yu4uk4zXij9%2FScreenshot%202018-12-17%20at%2011.51.25.png?alt=media&amp;token=1cc30485-a4ba-457c-9336-e2e2d5fd0fdd" alt=""></div>

2.En la sección de Integraciones, entrar en Woocomerce:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MFCW0mho84ETrVnaqv2%2F-MFCWbtniclhbGFEFVKP%2Fimage.png?alt=media\&token=c6ac583e-b4fc-46c5-949a-74ba092dc91f)

3.Completar:

* URL de la Tienda de Woocomerce
* Consumer Key
* Consumer Secret
* Estados de venta a Descargar
* Seleccionar si desea descargar las categorías

4\. Activar la integración desde el botón activado/desactivado.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MFCW0mho84ETrVnaqv2%2F-MFCWoJA8IhifC4iM35T%2Fimage.png?alt=media\&token=307ef511-4663-42d6-ba10-d8586c3425e4)

5\. Comunicar a tu Project Manager para obtener la información histórica.


# Extensión Carrito Abandonado

## ¿Cómo instalar el carrito abandonado de Woocomerce?

Ingresar a la tienda de Woocomerce de tu marca y dirígete a **Plugins**->**Agregar nuevo**

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-M_2G-p09q3rDNq92_Nn%2F-M_2G2D2VVpEvrxARrwr%2Fimage.png?alt=media\&token=7f338856-595b-4a64-8011-ea074aefc9ab)

Busca **WoowUp** en la tienda de Plugins

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-M_2G-p09q3rDNq92_Nn%2F-M_2GA7vAXFyFeyY0edt%2Fimage.png?alt=media\&token=d5125a13-9bb6-4fb3-b919-889ed358a793)

Presiona **Instalar ahora**

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-M_5vdFMzYhWNMGL0gx2%2F-M_5xgI_ErxVT3UJiJMx%2Fimage.png?alt=media\&token=9b69a735-ff31-4da6-9232-b141d999a238)

Una vez instalado lo verás de la siguiente manera:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-M_2Ah1cpaKNJPcXV9ZA%2F-M_2EqmeTEKIowCsVK3d%2Fimage.png?alt=media\&token=77de06cd-ff44-4801-986a-523aa878cbac)

Deberas ingresar a WoowUp y colocar su APIKEY

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-M_2Ah1cpaKNJPcXV9ZA%2F-M_2EyAgcAQMyRFgTp-1%2Fimage.png?alt=media\&token=55db83cf-0b87-429c-99d8-4a890683dd71)

La misma se encuentra dentro de **WoowUp** en Ajustes -> Mi cuenta.


# Conectar Cuenta

Deberá ingresar con sus credenciales a Prestashop e ir a la siguiente dirección:

*Configurar -> Parametros Avanzados -> WebServices*

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MfY34lo7kerIkiVpG_9%2F-MfY3KWz6cuaUGGFHsju%2Fimage.png?alt=media\&token=31ba2c4e-1483-46fd-a9d1-41268d553cc2)

En dicha página deberá generar la key del webservices.

Además deberas agregar todos los permisos de la columna (GET/VIEW), como se muestra a continuación:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MfY34lo7kerIkiVpG_9%2F-MfY3DP8Im4hYpMsMARH%2Fimage.png?alt=media\&token=b05e0202-eb53-4cc3-acc8-b4c6993e8b6c)

Una vez que tengas las credenciales creadas, ingresa a Woowup > Configuración > Integraciones > Prestashop e ingresa estos datos en la pantalla.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MHI2w9s5yskAsXJMubD%2F-MHI4byzxVXvSQdqfozD%2Fimage.png?alt=media\&token=2bc6f891-4ba5-43fd-9cd8-6998642ddb62)

Una vez finalizado, activa la integración y guarda los cambios.

{% hint style="info" %}
Solicita al equipo de integraciones traer información histórica si es necesaria.
{% endhint %}


# Conecta tu eCommerce E3

Para poder segmentar desde WoowUp tus clientes de E3, es necesario que configures una instancia muy importante. Sigue la guía paso a paso a continuación donde te explicaremos cómo conectar tu tienda e

## **Especificación de los servicios de la API**

Para poder acceder a los parámetros de la cuenta de E3 primero deberás ingresar a la siguiente URL, reemplazando el nombre de la tienda por la que corresponde a tu eCommerce: <https://tienda.xxxxxxxxxxxxx.com/api>.

&#x20;Luego, deberás acceder al Menú desde el Panel e ingresar desde la opción >Sistema. Una vez posicionado en la opción >Sistema, deberás seleccionar la opción >Administradores:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MYBN9TVMnuEmGs-1D7o%2F-MYBO5q1f0Xhwr6oEk4e%2Fimage.png?alt=media\&token=37b484a7-27e4-4ee3-9094-45111b295016)

Se abrirá una ventana que se muestra a continuación.

Dirígete a la barra superior y selecciona la opción >Nuevo Administrador:<br>

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MYBN9TVMnuEmGs-1D7o%2F-MYBOFM2jYze6mFQg8-o%2Fimage.png?alt=media\&token=a39f4f47-7cad-4a7a-a246-2ef1b1e539e6)

Verifica el campo Username donde aparecerá tu nombre de usuario y debajo la contraseña. Se habilitará el usuario como activo junto con el uso de la API:<br>

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MYBN9TVMnuEmGs-1D7o%2F-MYBOOr_-YYzF1ZWo8Tr%2Fimage.png?alt=media\&token=9ee6977a-1acf-4a6d-abde-da623d053f39)

## Ingresar las credenciales de E3 en WoowUp

Ahora vamos a ver el paso a paso para cargar las credenciales de E3 en WoowUp.<br>

Para cargar estos datos se deben realizar los siguientes pasos:

1. Primero deberás ingresar en WoowUp luego ir a la sección de >Configuración desde el menú de la barra superior:

<div align="left"><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LTwdLqOfcVRBFRB_2qQ%2F-LTwdiyf4Yu4uk4zXij9%2FScreenshot%202018-12-17%20at%2011.51.25.png?alt=media&amp;token=1cc30485-a4ba-457c-9336-e2e2d5fd0fdd" alt=""></div>

2.En la sección de Integraciones, entrar en **E3**:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MYBN9TVMnuEmGs-1D7o%2F-MYBOtdGK62gHzA6-MhP%2Fimage.png?alt=media\&token=b0784db9-488b-40b9-b773-0f3630680b8b)

3.Completar:

* URL de la Tienda de E3
* Nombre de Usuario
* Contraseña
* IDs de tiendas para descargar
* Seleccione si descarga las categorías
* Estado de los carritos abandonados a descargar

4\. Activar la integración desde el botón activado/desactivado.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MYBN9TVMnuEmGs-1D7o%2F-MYBPEtnKDqjlopSRayS%2Fimage.png?alt=media\&token=7823a8ea-97f5-4a2b-83ff-912652b9b593)

5\. Comunicar a tu Project Manager para obtener la información histórica.

[ <br>](<https://tienda.previsoradelparana.com/api&#xD;&#xA;>)


# Conectar Cuenta

Para realizar la instalación de la integración entre WooowUp y Tienda nube se deben seguir los siguientes pasos:

1. Dirígete a [https://www.tiendanube.com/apps/85](https://www.tiendanube.com/apps/859/authorize)[9/authorize](https://www.tiendanube.com/apps/859/authorize), en caso de que solicite ingresar a la cuenta, colocar usuario y clave.
2. Va a aparecer una ventana donde debe aceptar los permisos que pide nuestra app.
3. &#x20;Se lo va a redirigir a un sitio del estilo [admin.woowup.com/tiendanube?code=abcd](http://admin.woowup.com/tiendanube?code=abcd). Nosotros necesitamos ese código "abcd". **Importante: el código es temporal, expira en 30 segundos.**
4. Con el code, nuestro client\_id y nuestro client\_secret hacemos la siguiente request:

*`curl`* [*`https://www.tiendanube.com/apps/authorize/token`*](https://www.tiendanube.com/apps/authorize/token) *`--data 'client_id=`*`859`*`&client_secret=`*&#x42;8rFu3FHJLajDeAastRkOh2Z6NOGF88KGlHyZQ559Pg5aQ7&#x43;*`&grant_type=authorization_code&code=abcd'`*

Vamos a obtener una respuesta de la forma:

*`{"access_token":"281f028a24116a3a412","token_type":"bearer","scope":"read_products,read_coupons,read_customers,read_orders","user_id":1010101}`*

Donde **user\_id** va a ser lo que ingresemos en el campo "**Store ID**" de la configuración de WoowUp y **access\_token** el código de autorización.

{% hint style="warning" %}
Para realizar este tipo de tarea, vas a necesitar tener conocimientos de APIs y en la plataforma Postman
{% endhint %}


# SendGrid: Conectar Cuenta

Como integrar tu cuenta de SendGrid a Woowup.

## Connect SendGrid

### Crear API KEY

* Ingresar a [app.sendgrid.net](https://app.sendgrid.net) y acceda a su cuenta.
* En el menu de la izquierda ingresar a Settings > API Keys

<div align="center"><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LUAyfSY2VCglQ5x0ti3%2F-LUB-CW4mYiPrmqJn_xg%2Fimage.png?alt=media&amp;token=b604e17e-4210-40d1-8423-a409bae48c9f" alt=""></div>

* Haz click en el botón Create API Key

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LUAyfSY2VCglQ5x0ti3%2F-LUB-mGQMAnSplTPAgJJ%2FScreenshot%202018-12-20%20at%2011.25.40.png?alt=media\&token=06173b2c-395e-4961-b141-91a68424a3f4)

* Crear una API Key con Restricted Access a Mail Send.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LUAyfSY2VCglQ5x0ti3%2F-LUB-zXi95k8r6sNgcWW%2FScreenshot%202018-12-20%20at%2011.26.00.png?alt=media\&token=15462176-4daa-4f7a-898f-56e1a8e0d397)

* Copia la API KEY y guárdala en un lugar seguro y resérvala para luego utilizarla en la pantalla de integraciones en Woowup.

{% hint style="warning" %}
Solo te deja ver la API KEY una única vez por seguridad. Guárdala en un lugar seguro!
{% endhint %}

{% hint style="info" %}
En caso de estar utilizando una parent account, realizar esta misma configuración luego de crear un Subuser en Settings > Subuser Management
{% endhint %}

### Notificación de Eventos (Event Webhook)

* Ingresar a Settings > Mail settings en el menu de la izquierda
* Selecciona - Click en Event Webhook.
* En HTTP POST URL ingresar la siguiente dirección :&#x20;

```
https://api.woowup.com/webhooks/sendgrid?account=<NOMBRE DE CUENTA>
```

{% hint style="info" %}
Reemplazar \<NOMBRE DE CUENTA> con el nombre de tu programa en Woowup.
{% endhint %}

* En la sección de EVENTS TO BE POSTED, hacer click en SELECT ALL en AMBAS columnas (Deliverabilty y Engagement)

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-M4KI2oG50ua_Qu7Butc%2F-M4KISwTcEKyWczHDg4V%2FScreen%20Shot%202020-04-07%20at%2012.41.27.png?alt=media\&token=36d450be-d622-487a-9c25-be6c2431dc77)

* Una ve finalizado, guardar la configuración y activar Event Webhook Status (Enabled)

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-M4KI2oG50ua_Qu7Butc%2F-M4KIb2udZBuUrB81OAO%2FScreen%20Shot%202020-04-07%20at%2012.42.05.png?alt=media\&token=29640ab9-1b03-432b-8e08-f83670938516)

{% hint style="success" %}
Listo! Ya están configurados para que los eventos se envíen a Woowup.
{% endhint %}

### Grupos de desuscripción

* Ingresar a Supressions > Unsuscribe Groups

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LUAyfSY2VCglQ5x0ti3%2F-LUB3LRXm5BCKxTSBe62%2Fimage.png?alt=media\&token=1f380b21-ef89-4a42-b7d5-6e22a137c38c)

* Crea un nuevo grupo

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LUAyfSY2VCglQ5x0ti3%2F-LUB40Xq07S3lOuVbsqS%2FScreenshot%202018-12-20%20at%2011.44.52.png?alt=media\&token=f4302eb5-f509-42d7-bb4d-df4a656f983f)

* Asignarle nombre y descripción al grupo

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LUAyfSY2VCglQ5x0ti3%2F-LUB47RiBLU07dM7aO9y%2FScreenshot%202018-12-20%20at%2011.44.58.png?alt=media\&token=0d83a375-f73d-477e-ad86-b06bac789d9e)

* Guarda el numero del Group ID para utilizar luego en la configuración en Woowup.

### Tracking y Link de Desuscripción

Este ítem es opcional dependiendo del método de desuscripción elegido. Se puede tanto utilizar el link de Woowup, como activar el link de forma automática en Sendgrid.

#### Woowup Subscription Tracking

Para utilizar el de Woowup, ingresar y leer la siguiente [documentación](http://help.woowup.com/editor-de-campanas/configuracion-filas-and-columnas/como-colocar-el-link-de-desuscripcion).&#x20;

#### SendGrid Subscription Tracking

Para activar el link automático que inserta Sendgrid en todos los correos salientes, sigue los siguientes pasos:

* Ingresar a Settings > Tracking
* Activar Suscription Tracking luego de editar el mensaje.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-M4KL_yFf6OHZuPUJKjf%2F-M4KMh8-NWpWFbtRSTfA%2FScreen%20Shot%202020-04-07%20at%2012.55.39.png?alt=media\&token=f6f73407-6e32-4270-acc4-71be3a8b8cfe)

{% hint style="success" %}
Listo! Ya tienes el link de desuscripción activa.
{% endhint %}

## Configurar la integración en Woowup

* Ingresar a Configuración&#x20;

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LUAyfSY2VCglQ5x0ti3%2F-LUB5CxalUshnOjPuv0e%2Fimage.png?alt=media\&token=854a0b72-0632-41a1-ba44-4c3a9b1269e7)

* Luego ingresar a Integraciones > SendGrid

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LUB5gWBAIOBt1Y2LI1m%2F-LUB5iVrFBtkR_W3--la%2Fimage.png?alt=media\&token=4d310c1e-7042-42f2-a7da-3885186512a4)

* Llenar el formulario con los datos generados y de cuenta.
* Una vez finalizado, elegir de forma opcional si quieres que SendGrid sea el servicio de email predeterminado.
* Activa la integración

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LUB5gWBAIOBt1Y2LI1m%2F-LUB6DtnvQh76foznN0n%2Fimage.png?alt=media\&token=488c063a-57d1-4f6d-bc36-3135dff37e38)

* Haz click en GUARDAR.

{% hint style="warning" %}
Recuerda que si eres ún enviador de alto volumen es sumamente importante verificar y autenticar los dominios de envio para poder optimizar al maximo la entregabilidad.
{% endhint %}

{% hint style="success" %}
Listo! Ya estas listo para comenzar a enviar.
{% endhint %}


# Perfit: Conectar Cuenta

Cómo integrar tu cuenta de emails transaccionales de Perfit a Woowup.

{% hint style="success" %}
Para empezar a utilizar el servicio de emails transaccionales, primero **escribir a** [**dev@myperfit.com** ](mailto:dev@myperfit.com)solicitando el alta su cuenta,  se le deberá indicar que e-mail  utilizará para los envíos y con qué nombre se visualizarán. \
Perfit le brindará su **API key.**
{% endhint %}

## Configurar la integración en Woowup

* Ingresar a **Configuración**&#x20;

<div align="left"><img src="https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LUAyfSY2VCglQ5x0ti3%2F-LUB5CxalUshnOjPuv0e%2Fimage.png?alt=media&amp;token=854a0b72-0632-41a1-ba44-4c3a9b1269e7" alt=""></div>

* Luego ingresar a **Integraciones > Perfit**

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LXtYBPBg2uSvtwoEltt%2F-LXtZrQGR5BjCAJjzJPh%2Fperfit_integracion.png?alt=media\&token=2ff98c54-01ba-44e1-98d4-4ed9838e68e0)

* Llenar el formulario con los datos de su cuenta.
* Una vez finalizado, elegir de forma opcional si quieres que Perfit sea el servicio de email predeterminado.
* Activa la integración

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LXtYBPBg2uSvtwoEltt%2F-LXt_8__V7z4Q9uhxbOP%2Fperfit_active.png?alt=media\&token=b4e9a3f3-501d-4f71-8c46-f0393c1c855c)

* Haz click en **GUARDAR**.

{% hint style="warning" %}
No te olvides de configurar el Webhook de Eventos URL:<https://api.woowup.com/webhooks/perfit>

Esto puedes realizarlo dentro de tu cuenta **Perfit** en la sección **Integraciones > Webhooks**
{% endhint %}

{% hint style="success" %}
Listo! Ya estas listo para comenzar a enviar.
{% endhint %}


# Infobip: Conectar Cuenta

Como integrar tu cuenta de Infobip a WoowUp

## Obtener la URL base de Infobip

Primero tienes que obtener tu URL base para conectarse vía API, para esto debes entrar a la siguiente URL estando logueado en tu cuenta de Infobip:

{% embed url="<https://dev.infobip.com/getting-started/base-url>" %}

Dentro de esta página verás el link base

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LXdORi9kD87620hWA5P%2F-LXdQF8_xk8TzeEu2gdy%2Fimage.png?alt=media\&token=f40f1fe6-1ab5-4586-9c65-86e958dc7bc2)

Luego copias y pegas dentro de WoowUp en la sección Configuración > Integraciones > Infobip junto con tu usuario y contraseña

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-LXdORi9kD87620hWA5P%2F-LXdQ_1RixJAdY2Qr5oP%2Fimage.png?alt=media\&token=3a242e25-b03e-46a6-aecc-1ec4b2bb10be)

Por último activas la integración y  clickeas el botón Guardar.


# Motor de template de emails

Breve descripción de las funcionalidades del motor de templates de emails

## Twig Parser

WoowUp internamente utiliza una versión del motor de templates [Twig](https://twig.symfony.com) ejecutándose en un Sandbox para que el entorno sea completamente seguro de ejecutarse.

A continuación se detallan los tags, filtros y funciones disponibles para utilizar:

## Tags

| Tag | Descripción |
| --- | ----------- |
| if  |             |
| for |             |
| set |             |

## Filtros

Las variables pueden modificarse con **filtros**. Los filtros se separa de las variables por un símbolo pipe "|" y puede tener argumentos opcionales en paréntesis. Los filtros pueden ser encadenados de forma múltiple donde la salida del primer filtro es aplicado al siguiente filtro.

| Filtro         | Descripción                                                                            |
| -------------- | -------------------------------------------------------------------------------------- |
| upper          | Convierte a mayúscula un texto                                                         |
| lower          | Convierte a minúscula un texto                                                         |
| escape         | Escapea un texto en un formato dado                                                    |
| raw            | Imprime el texto sin escapear en entidades HTML                                        |
| slice          | Corta un texto a partir de un inicio y una longitud                                    |
| capitalize     | Convierte a mayúscula la primer letra del texto                                        |
| title          | Convierte a mayúscula la primer letra de cada palabra del texto                        |
| trim           | Elimina ciertos caracteres al inicio, al final o en ambas posiciones de un texto       |
| url\_encode    | Codifica como URL una cadena de texto                                                  |
| default        | Retorna un valor default y el valor de la variable es vacío o nulo                     |
| replace        | Busca un texto y lo reemplaza por otro                                                 |
| number\_format | Formatea un número con separadores de miles y decimales                                |
| truncate       | Corta un texto a una cierta longitud, si lo corta le agrega por default "..." al final |
| first\_word    | Retorna la primera palabra de una String                                               |

## Funciones

Las funciones pueden llamarse para generar contenido. Las funciones son invocadas por su nombre seguido por paréntesis () y pueden contener argumentos de forma opcional.

| Función                             | Descripción                                                    |
| ----------------------------------- | -------------------------------------------------------------- |
| now                                 | Retorna la fecha actual con formato dd/mm/yyyy                 |
| date\_format                        | Formatea una fecha en un cierto formato                        |
| hex                                 | Convierte a hexadecimal un texto                               |
| number\_format                      | Formatea un número con separadores de miles y decimales        |
| product\_by\_sku                    | Busca un producto por SKU                                      |
| purchase\_by\_invoice\_number       | Busca una venta por número de factura                          |
| new\_products\_by\_category         | Busca los productos nuevos por categorías                      |
| best\_sellers\_by\_category         | Busca los productos mas vendidos por categoría                 |
| recommended\_products               | Busca los productos recomendados para un cliente               |
| recommended\_products\_by\_category | Busca los productos recomendados para un cliente por categoría |
| range                               | Genera un listado de números a partir de un intervalo          |
| chunks                              | Divide un array en pedazos                                     |
| json\_encode                        | Encoder en formato JSON un array                               |
| json\_decode                        | Decoder un JSON en un array                                    |
| base64\_encode                      | Encoder en base 64 un texto                                    |
| base64\_decode                      | Decoder texto en base 64                                       |

## Operadores

Los mismos operadores que posee Twig por defecto


# WoowUp Connectors

## Get total account stats

<mark style="color:blue;">`GET`</mark> `https://api.woowup.com/apiv3/stats`

#### Query Parameters

| Name   | Type   | Description                                     |
| ------ | ------ | ----------------------------------------------- |
| to     | string | Filter by createtime of customers and purchases |
| from   | string | Filter by createtime of customers and purchases |
| branch | string | Filter by branch name                           |

{% tabs %}
{% tab title="200 " %}

```javascript
{
	"total_customers": 100,
	"total_purchases": 200,
	"total_revenue": 300000,
	"total_invoice_items": 600,
	"per_branches": [
		{
			"branch": "Shopping Unicenter",
			"total_customers": 100,
			"total_purchases": 200,
			"total_revenue": 300000,
			"total_invoice_items": 600,
		}
	]
}
```

{% endtab %}
{% endtabs %}

## Create a data processing record

<mark style="color:green;">`POST`</mark> `https://connectors.woowup.com/v1/log`

#### Headers

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| Authorization | string | Bearer \[WoowUp API KEY] |

#### Request Body

| Name          | Type   | Description                                     |
| ------------- | ------ | ----------------------------------------------- |
| processedtime | string | Processing time (DateTime ISO-8601)             |
| stats         | object | Processed entities and their related statistics |
| files         | array  | Processed file names                            |

{% tabs %}
{% tab title="200 " %}

```javascript
{
	"files": ["customers-2019_03_11.csv", "purchases-2019_03_11.csv"],
	"processingtime": "2019-03-12T12:30:00+00:00",
	"createtime": "2019-03-12T12:30:00+00:00",
	"stats": {
		"customers": {
			"total_created": 200,
			"total_updated": 10,
			"total_failed": 2,
			"per_branches": [
				{
					"branch": "Shopping Unicenter",
					"created": 200,
					"updated": 10,
					"failed": 2
				}
			]
		},
		"purchases": {
			"total_created": 300,
			"total_updated": 1,
			"total_failed": 1,
			"total_revenue": 300000,
			"total_invoice_items": 5000,
			"per_branches": [
				{
					"branch": "Shopping Unicenter",
					"total_created": 300,
					"total_updated": 1,
					"total_failed": 1,
					"total_revenue": 300000,
					"total_invoice_items": 5000
				}
			]
		},
		"products": {
			"total_created": 20,
			"total_updated": 5,
			"total_failed": 0
		},
		"branches": {
			"total_created": 1,
			"total_updated": 3
		}
	}
}
```

{% endtab %}
{% endtabs %}

```javascript
{
	"files": ["customers-2019_03_11.csv", "purchases-2019_03_11.csv"],
	"processingtime": "2019-03-12T12:30:00+00:00",
	"stats": {
		"customers": {
			"total_created": 200,
			"total_updated": 10,
			"total_failed": 2,
			"per_branches": [
				{
					"branch": "Shopping Unicenter",
					"created": 200,
					"updated": 10,
					"failed": 2
				}
			]
		},
		"purchases": {
			"total_created": 300,
			"total_updated": 1,
			"total_failed": 1,
			"total_revenue": 300000,
			"total_invoice_items": 5000,
			"per_branches": [
				{
					"branch": "Shopping Unicenter",
					"total_created": 300,
					"total_updated": 1,
					"total_failed": 1,
					"total_revenue": 300000,
					"total_invoice_items": 5000
				}
			]
		},
		"products": {
			"total_created": 20,
			"total_updated": 5,
			"total_failed": 0
		},
		"branches": {
			"total_created": 1,
			"total_updated": 3
		}
	}
}
```

#### JSON SCHEMA

```javascript
{
  "definitions": {},
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "http://example.com/root.json",
  "type": "object",
  "required": [
    "files",
    "processingtime",
    "stats"
  ],
  "properties": {
    "files": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^(.*)$"
      }
    },
    "processingtime": {
      "type": "string",
      "pattern": "^(.*)$"
    },
    "stats": {
      "type": "object",
      "properties": {
        "customers": {
          "type": "object",
          "required": [
            "total_created",
            "total_updated",
            "total_failed"
          ],
          "properties": {
            "total_created": {
              "type": "integer"
            },
            "total_updated": {
              "type": "integer"
            },
            "total_failed": {
              "type": "integer"
            },
            "per_branches": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "branch",
                  "total_created",
                  "total_updated",
                  "total_failed"
                ],
                "properties": {
                  "branch": {
                    "type": "string",
                    "pattern": "^(.*)$"
                  },
                  "total_created": {
                    "type": "integer"
                  },
                  "total_updated": {
                    "type": "integer"
                  },
                  "total_failed": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "purchases": {
          "type": "object",
          "required": [
            "total_created",
            "total_updated",
            "total_failed",
            "total_revenue",
            "total_invoice_items",
            "per_branches"
          ],
          "properties": {
            "total_created": {
              "type": "integer"
            },
            "total_updated": {
              "type": "integer"
            },
            "total_failed": {
              "type": "integer"
            },
            "total_revenue": {
              "type": "integer"
            },
            "total_invoice_items": {
              "type": "integer"
            },
            "per_branches": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "branch",
                  "total_created",
                  "total_updated",
                  "total_failed",
                  "total_revenue",
                  "total_invoice_items"
                ],
                "properties": {
                  "branch": {
                    "type": "string",
                    "pattern": "^(.*)$"
                  },
                  "total_created": {
                    "type": "integer"
                  },
                  "total_updated": {
                    "type": "integer"
                  },
                  "total_failed": {
                    "type": "integer"
                  },
                  "total_revenue": {
                    "type": "integer"
                  },
                  "total_invoice_items": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "products": {
          "type": "object",
          "required": [
            "total_created",
            "total_updated",
            "total_failed"
          ],
          "properties": {
            "total_created": {
              "type": "integer"
            },
            "total_updated": {
              "type": "integer"
            },
            "total_failed": {
              "type": "integer"
            }
          }
        },
        "branches": {
          "type": "object",
          "required": [
            "total_created",
            "total_updated"
          ],
          "properties": {
            "total_created": {
              "type": "integer"
            },
            "total_updated": {
              "type": "integer"
            }
          }
        }
      }
    }
  }
}
```

## List the stats processed by your connector

<mark style="color:blue;">`GET`</mark> `https://connectors.woowup.com/v1/logs`

#### Query Parameters

| Name   | Type   | Description                                              |
| ------ | ------ | -------------------------------------------------------- |
| entity | string | Can be: "customers", "purchases", "products", "branches" |
| page   | number | Default: 0                                               |
| limit  | number | Default: 25                                              |
| to     | string | Filter by processing date (YYYY-MM-DD)                   |
| from   | string | Filter by processing date (YYYY-MM-DD)                   |

#### Headers

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| Authorization | string | Bearer \[WoowUp API KEY] |

{% tabs %}
{% tab title="200 " %}

```javascript
[
{
	"files": ["customers-2019_03_11.csv", "purchases-2019_03_11.csv"],
	"processingtime": "2019-03-12T12:30:00+00:00",
	"createtime": "2019-03-12T12:30:00+00:00",
	"stats": {
		"customers": {
			"total_created": 200,
			"total_updated": 10,
			"total_failed": 2,
			"per_branches": [
				{
					"branch": "Shopping Unicenter",
					"created": 200,
					"updated": 10,
					"failed": 2
				}
			]
		},
		"purchases": {
			"total_created": 300,
			"total_updated": 1,
			"total_failed": 1,
			"total_revenue": 300000,
			"total_invoice_items": 5000,
			"per_branches": [
				{
					"branch": "Shopping Unicenter",
					"total_created": 300,
					"total_updated": 1,
					"total_failed": 1,
					"total_revenue": 300000,
					"total_invoice_items": 5000
				}
			]
		},
		"products": {
			"total_created": 20,
			"total_updated": 5,
			"total_failed": 0
		},
		"branches": {
			"total_created": 1,
			"total_updated": 3
		}
	}
}
]
```

{% endtab %}
{% endtabs %}


# Migración a Multi - ID

Como realizar los cambios necesarios en los datos enviados para adaptarse al sistema de multi identificación de clientes de Woowup

**El objetivo de esta migración, es remover el identificador externo de los clientes y aprovechar el motor de búsqueda de multi-identificación de WoowUp.**<br>

### **PASO 1**

#### Actualizar las llamadas de creación de entidades a la API

a) Ajustar el código que exporta clientes a /apiv3/customers y unsetear la clave "service\_uid" del json que viaje a WoowUp

b) Ajustar el código que exporta ventas a /apiv3/purchases como se hizo con /customers

\*\*\* Si en alguno de los dos casos de arriba, se estaba completando el service\_uid con algún otro identificador, poner ese identificador en su llave correspondiente, Ej: customer.document = document;

### **PASO 2**

#### Actualizar las llamadas de actualización a la API

En clientes, actualizar la URL y el payload del PUT para actualizar clientes como muestra la documentación:

{% content-ref url="/pages/-LRO0wv5zB6hpfGUvuYE" %}
[Users](/woowup-developer-docs/api/users)
{% endcontent-ref %}

[ https://docs.woowup.com/api/users#update-an-user](< https://docs.woowup.com/api/users#update-an-user>)

\*\*\* Ya no se envía el service\_uid en base64 en la query, sino que la api actualiza directamente a partir de los identificadores que vengan en el payload

### PASO 3

* Configurar el MultiIdentificador desde la plataforma

Desde [admin.woowup.com ](http://admin.woowup.com)se dirigen a Configuración > Multi-Identificador, y desactivan el "identificador externo" desde el toggle a la derecha

### PASO 4

#### De duplicación y actualización histórica de identificadores

Una vez implementen los cambios correspondientes, nos avisan y ajustamos la info histórica en la plataforma

### PASO 5

* &#x20;Stats de procesos **(OPCIONAL)**

Hace poco implementamos los Stats de procesos, en la pantalla:

<https://admin.woowup.com/app/brain/#!/{account}/account/data-sync-stats> para tener más visibilidad de la ingesta de datos en cada proceso, ustedes al terminar cada importación, nos pueden enviar las estadísticas que recolectaron del proceso (en el formato que acepta la API) via request, y luego puedan consultar las sincronizaciones desde esa la pantalla<br>

Documentación de los API Stats:

{% content-ref url="/pages/-Lqfs1-c-qFuW2Ebggx9" %}
[Integration Stats](/woowup-developer-docs/api/integration-stats)
{% endcontent-ref %}


# SurveyKiwi: Conectar Cuenta

### Generación de API Keys <a href="#surveykiwi-generacin-de-api-keys" id="surveykiwi-generacin-de-api-keys"></a>

En este tutorial se explicará cómo obtener las API keys necesarias para realizar la integración con SurveyKiwi.

#### Requisitos para la integración <a href="#requisitos-para-la-integracin" id="requisitos-para-la-integracin"></a>

* Tener acceso a una cuenta de [surveykiwi.com](http://surveykiwi.com/) con un plan Gold. Los planes Bronze y Silver no cuentan con la posibilidad de generar las api keys.

#### Pasos para la obtención de las keys <a href="#pasos-para-la-obtencin-de-las-keys" id="pasos-para-la-obtencin-de-las-keys"></a>

1. Iniciar sesión en el [panel de administración de Surveykiwi](https://surveykiwi.com/clients) y entrar desde la barra de opciones a la sección: **Mi cuenta** en el menú desplegable de la parte superior derecha. \
   (Si le pide autenticación, por favor ingrese sus credenciales de administrador)

Debería aparecer en una sección como esta:

1. Dirijase a la parte inferior donde encontrará la sección **Apis**:![](http://docs.woowup.com/howto/src/surveykiwi/api-keys.png)

   De no aparecer los códigos de las API keys, haga click en \*\*Regenerar keys\*\*. Si no encuentra la sección, asegúrese que cuenta con un plan Silver o Gold. El plan Bronze no cuenta con la posibilidad de generar las API keys, y la integración no es realizable. El plan lo puede encontrar en la parte superior de la página.
2. Dirijase a [WoowUp](https://woowup.com/). Haga click en el icono de configuración en la parte superior derecha del menú. <br>

Luego en la pantalla de configuración, en la sección de Encuestas agregamos la Api key y la Secret Key que obtuvimos anteriormente.![](http://docs.woowup.com/howto/src/surveykiwi/woowup-surveykiwi-config-2.png)

Por último, hacemos click el botón de Guardar.

{% hint style="info" %}
***En caso de encontrar un problema con el proceso o incluso cualquier inquietud sobre el funcionamiento de la integración, por favor comunicarse con el soporte de WoowUp a*** [***developers@woowup.com***](mailto:developers@woowup.com) ***así le brindan la ayuda necesaria.***
{% endhint %}


# Untitled


# Snappy: Conectar Cuenta

Esta integración te permitirá recibir en tu cuenta de WoowUp, los nuevos suscriptores al newsletters registrados a través del asistente virtual de Snappy.

**¿Cómo integrar el asistente virtual de Snappy con WoowUp?**

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fapi%2F-M-KzDUyp9E9YbKsUQZS%2F-M-KzZHgNY6zB5W-veva%2F0.png?generation=1580916950768439\&alt=media)

**Paso 1**. Haz Login en la plataforma de Snappy Labs en <https://app.snappylabs.io/>

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fapi%2F-M-KzDUyp9E9YbKsUQZS%2F-M-KzZHhbjQLnRMmpxKE%2F1.png?generation=1580916950764287\&alt=media)

**Paso 2**. Ingresa a AI Assistant → Integrations → WoowUp

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fapi%2F-M-KzDUyp9E9YbKsUQZS%2F-M-KzZHiJH9yEjnAYEWD%2F2.jpeg?generation=1580916950756358\&alt=media)![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fapi%2F-M-KzDUyp9E9YbKsUQZS%2F-M-KzZHjZWJQkQosxBEg%2F3.png?generation=1580916950794737\&alt=media)

**Paso 3.**&#x20;

Ingresa las credenciales de Woowup (API Key y Public Key).&#x20;

Estas las puedes conseguir estando logueado en Woowup (Super-Admin) en la sección de Configuración > General. &#x20;

Habilita la integración haciendo clic en “Enable integration”.

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fapi%2F-M-KzDUyp9E9YbKsUQZS%2F-M-KzZHkAnYCR3TCNt-o%2F4.png?generation=1580916950779723\&alt=media)

**Paso 4.** Haz clic en “SAVE” para guardar la integración y listo!

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fapi%2F-M-KzDUyp9E9YbKsUQZS%2F-M-KzZHlCyxNGZeyE8si%2F5.png?generation=1580916950758022\&alt=media)

Puedes hacer clic en “Test integration” para verificar que recibes correctamente los suscriptores en tu cuenta de WoowUp.


# Zendesk: Conectar Cuenta

### ¿Cómo integrar Zendesk con WoowUp? <a href="#cmo-integrar-zendesk-con-woowup" id="cmo-integrar-zendesk-con-woowup"></a>

#### Información necesaria para la integración <a href="#informacin-necesaria-para-la-integracin" id="informacin-necesaria-para-la-integracin"></a>

* Tener una cuenta con acceso de perfil administrador para iniciar sesión en el panel de Zendesk
* Tener una cuenta de acceso en WoowUp
* Generar un Api Token para que WoowUp pueda acceder a los tickets
* Configurar un destino HTTP en Zendesk
* Configurar un disparador en Zendesk

En las próximas secciones le explicamos como realizar cada uno de los pasos técnicos.

#### ¿Cómo generar un API Token en Zendesk? <a href="#cmo-generar-un-api-token-en-zendesk" id="cmo-generar-un-api-token-en-zendesk"></a>

1. Primero iniciar sesión en Zendesk con la cuenta de perfil administrador
2. En la barra lateral encontraremos la opción "Administrador" o "Admin" con el ícono (![](http://docs.woowup.com/howto/src/zendesk/manage_icon.png))
3. En el menú desplegado elegir "Canales" o "Channels", y luego seleccionar "API"
4. En la pestaña de "Configuración" o "Settings", asegurarse de que está activo el "Acceso con Token" o "Token Access". Si no lo está, activarlo.
5. Hacer clic al signo "+" al lado de "Tokens de API activos" o "Active API Tokens"
6. Ingrese un nombre para el token. Por ejemplo: WoowUp.&#x20;
7. Abajo le aparecerá el Token de acceso, por favor copielo haciendo clic en el botón de "Copiar" y peguelo en un lugar seguro porque luego tendrá que ingresarlo en WoowUp. \
   **Importante: El token no volverá a mostrarse después de hacer clic en Guardar o de salir de la página de Zendesk.**
8. Una vez copiado el token, puede hacer clic en Guardar y el token quedará generado.
9. Diríjase a [WoowUp](https://woowup.com/). Haz click en el icono de configuración en la parte superior derecha del menú. <br>
10. En la sección de Soporte al cliente podrá configurar los datos de acceso: el sub-dominio de su cuenta de zendesk, el email de la cuenta administrador y el API Token generado en los pasos anteriores. Podrá elegir que etiquetas de los tickets no desea descargar y también el estado de los tickets que si quiera integrar a WoowUp.

{% hint style="info" %}
Una vez ingresados todos los datos, puede hacer clic en "Guardar" y comunicarse con el equipo de WoowUp a <developers@woowup.com> para que realice el chequeo definitivo de la información y se proceda a la descarga de los tickets.&#x20;
{% endhint %}

#### ¿Cómo crear un destino HTTP en Zendesk? <a href="#cmo-crear-un-destino-http-en-zendesk" id="cmo-crear-un-destino-http-en-zendesk"></a>

1. En Zendesk Support, haga clic en el icono Administrador (![](http://docs.woowup.com/howto/src/zendesk/manage_icon.png)) en la barra lateral izquierda y luego seleccione Configuración > Extensiones.
2. Haga clic en la pestaña Destinos y haga clic en Agregar destino.
3. Seleccione Destino de HTTP.
4. Configure el destino con la siguiente información:

* **Título**: WoowUp
* **URL**: [https://api.woowup.com/webhooks/zendesk?app\_id=WoowUpAccountId](https://api.woowup.com/webhooks/Zendesk?app_id={WoowUpAccountId)
* Debe fijarse el id de su cuenta en la URL de su panel en WoowUp o consultarlo a soporte por el chat o a <ayuda@woowup.com>
* Quedaria asi: &#x20;
  * [https://api.woowup.com/webhooks/zendesk?app\_id=](https://api.woowup.com/webhooks/Zendesk?app_id={WoowUpAccountId)1234
* **Método**: GET
* **Autenticación básica**: Desactivada

1. Guarde el destino

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-M2KIwJSNRuHZ3p0-HYz%2F-M2KJ3qC9H9HxMFqJNd_%2Fimage.png?alt=media\&token=f44c1ae7-c1c1-47b7-aaa6-9a7870406ef3)

Cualquier información extra puede encontrarse en [este articulo ](<https://support.zendesk.com/hc/es/articles/204890268 >)

#### ¿Cómo crear un disparador en Zendesk? <a href="#cmo-crear-un-disparador-en-zendesk" id="cmo-crear-un-disparador-en-zendesk"></a>

1. En Zendesk Support, haga clic en el icono Administrador (![](http://docs.woowup.com/howto/src/zendesk/manage_icon.png)) en la barra lateral izquierda y luego seleccione Reglas de Negocio > Disparadores.
2. Haga clic en Agregar disparador
3. Ingrese un nombre para el disparador. Por ejemplo: "WoowUp - Ticket Resuelto". Luego elija las condiciones que desea que disparen tickets a WoowUp. En el caso de querer enviar tickets resueltos, la imagen muestra esta situación:

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-M2KIwJSNRuHZ3p0-HYz%2F-M2KJATpVqx1kbvaCgYx%2Fimage.png?alt=media\&token=6041c58c-8ff3-45b7-ab5c-4e5764883e1b)

Luego deberá crear una acción que se ejecutará al cumplirse la condición anterior:![](http://docs.woowup.com/howto/src/zendesk/zendesk_disparador_accion.png)

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-M2KIwJSNRuHZ3p0-HYz%2F-M2KJYtc1xAlMkIPZWmc%2Fimage.png?alt=media\&token=3480ca9c-40f2-47cf-ab9d-1f918fe82701)

Esta acción tiene que enviar al destino el ID del ticket para el cual se cumple la condición. (como ejemplo en la imagen el nombre del destino es WoowUpTest)&#x20;

\
Necesitamos que configure un parámetro de URL llamado **"ticket\_id"** y como valor: **{{ticket.id}}**![](http://docs.woowup.com/howto/src/zendesk/zendesk_disparador_accion2.png)

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-M2KIwJSNRuHZ3p0-HYz%2F-M2KJHBikH3GdbIKYQXs%2Fimage.png?alt=media\&token=b94870d3-a220-4e8a-ae37-3c91582166b1)

Una vez configurados esos datos, clic en "Guardar".

1. En el listado de disparadores, encontrará el nuevo item. Parándose sobre el mismo, encontrará las opciones en el icono (...) donde podrá activar el disparador en caso de que no se haya activado en la creación.

Cualquier información extra pueden consultar la [documentación](https://support.zendesk.com/hc/es/articles/203662106-Creaci%C3%B3n-y-administraci%C3%B3n-de-disparadores-para-actualizaciones-de-tickets-y-notificaciones) propia de Zendesk.

{% hint style="info" %}
***En caso de encontrar un problema con el proceso o incluso cualquier inquietud sobre el funcionamiento de la integración, por favor comunicarse con el soporte de WoowUp a*** [***developers@woowup.com***](mailto:developers@woowup.com) ***así le brindan la ayuda necesaria.***
{% endhint %}


# Primeros pasos

## Objetivo

Dar la posibilidad a los clientes poder migrar la información de los clientes, tiendas, productos y ventas a través de una integración sencilla. Se puede elegir cualquiera de las integraciones, funcionan muy similares.

## Proceso de Implementación vía FTP

El cliente debe confeccionar todos los documentos solicitados y enviarlos para su aprobación al equipo de Integración. Luego, se les dará acceso a un FTP con sus respectivas credenciales donde deberá alojar el grupo de archivos.

{% hint style="info" %}
Recordá que todos los archivos deben contener todos los datos de cabeceras para que este procese sin problemas.
{% endhint %}

## Aspectos Generales vía FTP

### Nombre de Archivos

Los archivos **CSV** deberán tener los siguientes nombres:

**Archivo de Clientes**

*clientes\_#grupo\_#fecha.csv*

**Archivo de Ventas**

*ventas\_#grupo\_#fecha.csv*

**Archivo de Productos**

*productos\_#grupo\_#fecha.csv*

**Archivo de Categorías**

*categorias\*#grupo*#fecha.csv\*

**Archivo de Tiendas**

*tiendas\_#grupo\_#fecha.csv*

**Archivo de&#x20;*****Medios de pago (opcional)***

*payments\_#grupo\_#fecha.csv*\
\
**Archivo de&#x20;*****Miembros de Familia (opcional)***

*member\_family\_#grupo\_#fecha.csv*

{% hint style="info" %}
*El #grupo solo aplica para multimarcas/multicuentas*
{% endhint %}

**Ejemplo:**

* `clientes_woowup_20200128.csv`
* `ventas_woowup_20200128.csv`
* `productos_woowup_20200128.csv`
* `tiendas_woowup_20200128.csv`
* `categorias_woowup_20200128.csv`
* `payments_woowup_20200128.csv`

Si el archivo de ventas a procesar es histórico, debe agregarse el termino "historical" al nombre del archivo.

Ejemplo:

`ventas_woowup_20200128_historical.csv`

### ¿Como procesar los archivos vía FTP?

WoowUp les proveerá un **ftp** para que depositen los archivos que necesiten ser procesados, van a dejar el conjunto de archivos en la carpeta **pending** (con los nombres previamente acordados) y WoowUp tendrá un cron automático para procesar los archivos

Ruta: `**<ftp_root>**/pending/juego_de_archivos_para_procesar/(todos los archivos)`

Se enviarán los archivos históricos una sola vez y luego se enviaran la información actualizada de cada día, según el horario acordado en el blueprint.

## Formato de Archivos vía FTP

Los archivos deben estar separados por ";" y en formato UTF 8. Todos los archivos deben respetetar las cabeceras. Se pueden alterar las cabeceras pero no cambiar el nombre.&#x20;

{% hint style="danger" %}
El tamaño máximo de la suma de todos los archivos debe ser de **20 MB**. \
Para procesar más de ese tamaño debe coordinarlo con el equipo de WoowUp.
{% endhint %}

## Proceso de Implementación vía SQL

El cliente debe confeccionar todos las querys/Store Procedure/Vistas solicitados y enviarlos para su aprobación al equipo de Integración. Además, deberá dar acceso al equipo de WoowUp al SQL de forma lectura brindando la siguiente información:

* Host
* Port
* Username
* Password
* DatabaseName

{% hint style="info" %}
Recordá que todos las querys deben contener todos los datos de cabeceras para que este procese sin problemas.
{% endhint %}

## Aspectos Generales vía SQL

Las querys deben estar armadas para consultar de manera eficiente, por lo tanto, pedimos que tenga un campo de filtrado de fecha\_update para no procesar más de una vez toda la información. Este campo debe agregarse en todas las tablas.

Se debe armar una query especial que tenga toda la información histórica para poder traer el histórico de cada entidad.

El procesamiento será acordado con el cliente el blueprint.

{% hint style="info" %}
La conexión vía SQL **NO** contempla VPN
{% endhint %}

###


# Archivo de Tiendas

El archivo CSV o la Query SQL de tiendas contiene todas las tiendas del ente con información de las mismas.&#x20;

{% hint style="warning" %}
Tener en cuenta que si la tienda de ecommerce la envían por otra integración ejemplo: Vtex esta se repetirá.
{% endhint %}

| Nombre del Campo / Cabeceras | Tipo de Campo | Descripción                                                                                                         |             Ejemplo             | Obligatorio |
| ---------------------------- | :-----------: | ------------------------------------------------------------------------------------------------------------------- | :-----------------------------: | :---------: |
| name                         |     String    | Código de la Tienda                                                                                                 |               A101              |      SI     |
| description                  |     String    | Descripción de la Tienda                                                                                            | Tienda Palermo II numero 1 A101 |      NO     |
| display\_name                |     String    | Nombre de la Tienda                                                                                                 |            Palermo II           |      SI     |
| email                        |     String    | Email de contacto de la Tienda                                                                                      |       <palermo@tienda.com>      |      NO     |
| telephone                    |     String    | Teléfono de contacto de la Tienda                                                                                   |           01123934544           |      NO     |
| address                      |     String    | Dirección                                                                                                           |           armenia 1111          |      NO     |
| working\_hours               |     String    | Horario de atención                                                                                                 | Lunes a Viernes 9.00 a 22.00 hs |      NO     |
| notes                        |     String    | Texto libre                                                                                                         |                                 |      NO     |
| branch\_zone\_code           |     String    | Código de la zona                                                                                                   |                11               |      NO     |
| branch\_zone\_name           |     String    | Nombre de la zona                                                                                                   |           Buenos Aires          |      NO     |
| holder                       |     String    | Responsable de la Tienda                                                                                            |      Gerente Pedro Gonzalez     |      NO     |
| status                       |      Enum     | \["active", "inactive"]                                                                                             |              active             |      NO     |
| country\_code                |     String    | Country's ISO 3166-1 alpha-3 code                                                                                   |               ARG               |      NO     |
| state                        |     String    | Estado/Provincia                                                                                                    |           Buenos Aires          |      NO     |
| city                         |     String    | Ciudad                                                                                                              |      Ciudad de Buenos Aires     |      NO     |
| business\_type               |      Enum     | \["own", "franchisee", ""]                                                                                          |               own               |      NO     |
| shopping\_center             |     String    | Centro Comercial                                                                                                    |            Unicenter            |      NO     |
| location\_type               |     String    | Tipo de ubicación                                                                                                   |              Centro             |      NO     |
| m2                           |    Integer    | Superficie en m2                                                                                                    |               300               |      NO     |
| m2\_cost                     |     float     | Costo por m2                                                                                                        |               1000              |      NO     |
| employees\_quantity          |    Integer    | Cantidad de empleados                                                                                               |                30               |      NO     |
| group                        |     String    | Grupo                                                                                                               |              WoowUp             |      NO     |
| format                       |      Enum     | Formato de la Tienda: \["brand\_branch", "multibrand\_branch", "brand\_island", "multibrand\_island", "outlet", ""] |          brand\_branch          |      NO     |
| is\_web                      |    Boolean    | \["true", "false", 1, 0]                                                                                            |              false              |      NO     |

{% file src="/files/-MKfCuTQbRPcJBtgySH3" %}
Archivo de Tiendas de Ejemplo
{% endfile %}


# Archivo de Categorías

El archivo de Categorías o Query SQL contiene todas las categorías del ente. En dicho CSV se podrá armar el árbol de Categorías.&#x20;

{% hint style="info" %}
WoowUp solo soporta un producto por categoría. Las hojas de los arboles puede tener una sola rama.
{% endhint %}

{% hint style="warning" %}
Si tenes otra fuente de datos que llegan las categorías como un Ecommerce podes llegar a repetir la información, el equipo de marketing deben definir que fuente de datos alimentará las categorías.
{% endhint %}

| Nombre del Campo / Cabeceras | Tipo de Campo | Descripción            |                    Ejemplo                   | Obligatorio |
| ---------------------------- | :-----------: | ---------------------- | :------------------------------------------: | :---------: |
| id                           |     String    | id de la categoría     |                       2                      |      SI     |
| name                         |     String    | Nombre de la Categoría |                    Zapatos                   |      SI     |
| parent\_id                   |     String    | Padre de la Categoría  |                       1                      |      SI     |
| url                          |     String    | URL de la categoría    |    <http://www.example.com/categorias/1/2>   |      NO     |
| image\_url                   |     String    | Url de la imagen       | "<http://www.example.com/categorias/2.jpgNO> |      NO     |
|                              |               |                        |                                              |             |

{% file src="/files/-MKfNiuvcd0igsVj48Fe" %}
Archivo de Categorías de ejemplo
{% endfile %}


# Archivo de Productos

El archivo de Productos o Query SQL contiene todos los productos/SKUs de la empresa.

{% hint style="info" %}
Si tenes otra fuente de datos que llegan los Productos como un Ecommerce, puede que no haga falta enviarlo o enviar las productos no existentes en dicha fuente de datos.
{% endhint %}

{% hint style="danger" %}
En caso de enviar mismos SKU que el ecommerce, los mismos deben coincidir tanto en las tiendas físicas como en la tienda online.
{% endhint %}

| Nombre del Campo / Cabeceras | Tipo de Campo | Descripción                                                                                                                               |                             Ejemplo                            | Obligatorios |
| ---------------------------- | :-----------: | ----------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------: | :----------: |
| sku                          |     String    | Código de Producto                                                                                                                        |                             123215                             |      SI      |
| name                         |     String    | Nombre del producto                                                                                                                       |                            Notebook                            |      SI      |
| brand                        |     String    | Marca                                                                                                                                     |                               BGH                              |      NO      |
| description                  |     String    | Descripción del producto                                                                                                                  |                        Notebook bgh 14"                        |      No      |
| url                          |     String    | Url del producto                                                                                                                          |        <http://www.example.com/notebook-bgh-6786896868>        |      NO      |
| image\_url                   |     String    | Url de la imgen                                                                                                                           |      <http://www.example.com/notebook-bgh-6786896868.png>      |      NO      |
| thumbnail\_url               |     String    | url de la imagen miniatura                                                                                                                | <http://www.example.com/thumbnail_notebook-bgh-6786896868.png> |      NO      |
| price                        |     String    | Precio de Lista                                                                                                                           |                              12200                             |      SI      |
| offer\_price                 |     String    | Precio de Oferta                                                                                                                          |                              12000                             |      NO      |
| stock                        |     String    | Stock del Producto                                                                                                                        |                               20                               |      NO      |
| available                    |     String    | ¿Está disponible?                                                                                                                         |                              true                              |      NO      |
| category\_id                 |     String    | ID de la Categoría del anterior documento                                                                                                 |                              AC20                              |      SI      |
| specifications               |     String    | Características del producto que no sirven para agrupar. Ejemplos: peso, altura, capacidad (Formato llave valor, separados por pipe "\|") |                 Peso : 2.2 kg \| Pantalla : 15'                |      No      |

{% file src="/files/-MKfU0A11ThQjBR0cCeR" %}
Archivo de productos de ejemplo
{% endfile %}

{% hint style="success" %}
Esta entidad permite agregar atributos extendidos. ¿Que son? Son campos que no son nativos en WoowUp. Por Ejemplo: Tipo de tela del producto/Tamaño/Tipo de producto. Para parametrizarlo en Woowup Puedes seguís las instrucciones: <https://bit.ly/3e2892r>
{% endhint %}

### Atributos Extendidos

La cabecera para un atributo extendido se envía en formato `custom_attributes.{nombre_atributo}` ese atributo se va a crear en woowup con el nombre que se encuentre en la cabecera, es decir si yo quiero crear el atributo para productos "tipo\_de\_tela" la cabecera seria `custom_attributes.tipo_de_tela`


# Archivo de Clientes

El archivo de clientes y contactos o Query SQL contiene todos los datos de los consumidores.

{% hint style="info" %}
Recordá tener configurado el Multi-identificador. <https://bit.ly/3juLKfj>
{% endhint %}

{% hint style="info" %}
Para crear un clientes debe tener mínimo un identificador que pueden ser: Service\_uid, Document, telephone o Email
{% endhint %}

| Campo / Cabeceras         | Tipo de Campo | Descripción                                                                           |         Ejemplo        | Obligatorios |
| ------------------------- | :-----------: | ------------------------------------------------------------------------------------- | :--------------------: | :----------: |
| service\_uid              |     String    | ID Externo                                                                            |        12312321        |      SI      |
| document                  |     String    | Documento                                                                             |        30300300        |      SI      |
| document\_type            |     String    | Tipo de Documento                                                                     |           DNI          |      SI      |
| email                     |     String    | Email                                                                                 | <christian@woowup.com> |      SI      |
| first\_name               |     String    | Nombre                                                                                |        Christian       |      NO      |
| last\_name                |     String    | Apellido                                                                              |         Vitale         |      NO      |
| telephone                 |     String    | Telefono                                                                              |       1173682446       |      NO      |
| birthdate                 |     String    | Fecha de Nacimiento                                                                   |       1992-03-31       |      NO      |
| gender                    |      Enum     | Genero \["M", "F"]                                                                    |            M           |      NO      |
| street                    |     String    | Calle                                                                                 |        ohm 2220        |      NO      |
| city                      |     String    | Ciudad                                                                                |          CABA          |      NO      |
| state                     |     String    | Estado                                                                                |          CABA          |      NO      |
| department                |     String    | Departamento                                                                          |      Villa Urquiza     |      NO      |
| country                   |     String    | País                                                                                  |        Argentina       |      NO      |
| marital\_status           |      Enum     | Estado civil \["single", "commited", "married", "divorced", "widowed"]                |         Single         |      NO      |
| postcode                  |     String    | Código Postal                                                                         |          1431          |      NO      |
| tags                      |     String    | Etiquetas                                                                             |   cliente\_suscripto   |      NO      |
| points                    |    Integer    | Puntos                                                                                |           100          |      NO      |
| mailing\_enabled          |      Enum     | Habilitación para enviar mail \["enabled", "disabled"]                                |        disabled        |      NO      |
| mailing\_disabled\_reason |      Enum     | Razón de deshabilitación \["bounce", "unsubscribe", "spamreport", "dropped", "other"] |         bounce         |      NO      |
| sms\_enabled              |      Enum     | Habilitación para enviar mail \["enabled", "disabled"]                                |        disabled        |      NO      |
| sms\_disabled\_reason     |      Enum     | Razón de deshabilitación \["bounce", "unsubscribe", "spamreport", "dropped", "other"] |         dropped        |      NO      |

{% file src="/files/-MKfZ93ThF5JQosYnrlE" %}
Archivo de Clientes de Ejemplo
{% endfile %}

### Atributos Extendidos

{% hint style="success" %}
Esta entidad permite agregar atributos extendidos. ¿Que son? Son campos que no son nativos en WoowUp. Por Ejemplo: Tipo de tela del producto/Tamaño/Tipo de producto. Para parametrizarlo en Woowup Puedes seguís las instrucciones: <https://bit.ly/3e2892r>
{% endhint %}

La cabecera para un atributo extendido se envía en formato `custom_attributes.{nombre_atributo}` ese atributo se va a crear en WoowUp con el nombre que se encuentre en la cabecera, es decir si yo quiero crear el atributo para clientes"categoria\_preferida" la cabecera seria `custom_attributes.categoria_preferida`


# Archivo de Ventas

El archivo de Ventas o Query SQL contiene todas las ventas del ente.

{% hint style="info" %}
Los campos de la cabecera se deben repetir por linea de factura. (Gross, Discount, tax, Total, Cost)
{% endhint %}

{% hint style="warning" %}
Verificar porque canal están enviando las ventas del E-commerce.
{% endhint %}

{% hint style="warning" %}
Al menos enviar un solo identificador.
{% endhint %}

| Campo / Cabeceras            | Tipo de Campo | Descripción                                                                                                                                  |                                                      Ejemplo                                                      | Obligatorios |
| ---------------------------- | :-----------: | -------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------: | :----------: |
| service\_uid                 |     String    | ID Externo                                                                                                                                   |                                                      12312321                                                     |      SI      |
| email                        |     String    | Email                                                                                                                                        |                                               <christian@woowup.com>                                              |      SI      |
| document                     |     String    | Documento                                                                                                                                    |                                                      36872489                                                     |      SI      |
| telephone                    |     String    | teléfono                                                                                                                                     |                                                     1173682446                                                    |      SI      |
| points                       |    Integer    | Puntos de la venta                                                                                                                           |                                                        100                                                        |      NO      |
| invoice\_number              |     String    | Número de la Factura                                                                                                                         |                                                     FAC0230321                                                    |      SI      |
| createtime                   |     String    | Fecha y Hora de la Venta                                                                                                                     |                                                2020-01-23 16:32:05                                                |      SI      |
| channel                      |      Enum     | Canal de venta \["web","telephone", "in-store", "corporate", "direct", "other"]                                                              |                                                      in-store                                                     |      SI      |
| branch\_name                 |     String    | Tienda donde se realizó la venta. Se debe utilizar el campo NAME del archivo de Tiendas. Este será el código de tiendas.                     |                                                        A101                                                       |      SI      |
| cost                         |     Float     | Costo del total de la factura                                                                                                                |                                                        6000                                                       |      NO      |
| shipping                     |     Float     | Costo de Envío                                                                                                                               |                                                        500                                                        |      NO      |
| gross                        |     Float     | Subtotal (Sin impuestos, sin envíos y sin descuentos)                                                                                        |                                                        9000                                                       |      SI      |
| tax                          |     Float     | Impuestos de la Factura                                                                                                                      |                                                        1400                                                       |      NO      |
| discount                     |     Float     | Descuento de la factura                                                                                                                      |                                                        2000                                                       |      NO      |
| total                        |     Float     | Total de la Factura                                                                                                                          |                                                        9400                                                       |      SI      |
| payment\_type                |      Enum     | Medio de pago \['credit', 'debit', 'mercadopago', 'todopago', 'cash', 'other']                                                               |                                                       debit                                                       |      SI      |
| payment\_brand               |     String    | Marca de la Tarjeta                                                                                                                          |                                                        Visa                                                       |      NO      |
| payment\_bank                |     String    | Banco emisor de la tarjeta                                                                                                                   |                                                   Banco Galicia                                                   |      NO      |
| payment\_installments        |    Integer    | Cantidad de cuotas                                                                                                                           |                                                         6                                                         |      NO      |
| payment\_total               |     Float     | Total por medio de pago                                                                                                                      |                                                        9400                                                       |      NO      |
| seller\_name                 |     String    | Nombre del Vendedor                                                                                                                          |                                                   Gil Gunderson                                                   |      NO      |
| seller\_email                |     String    | Email del vendedor                                                                                                                           |                                             <gil.gunderson@autos.com>                                             |      No      |
| seller\_external\_id         |     String    | Id externo del vendedor                                                                                                                      |                                                         10                                                        |      NO      |
| sku                          |     String    | Código del producto                                                                                                                          |                                                      AB123324                                                     |      SI      |
| product\_name                |     String    | Nombre del producto                                                                                                                          |                                                   Celular Moto Z                                                  |      SI      |
| category\_id                 |     String    | Id de la categoría del archivo de categorías                                                                                                 |                                                     ACEL12321                                                     |      SI      |
| quantity                     |    Integer    | Cantidad de unidades                                                                                                                         |                                                         2                                                         |      SI      |
| unit\_price                  |     Float     | Precio unitario del producto (Sin impuestos y descuentos)                                                                                    |                                                        1000                                                       |      SI      |
| variations                   |     String    | Características por las que se puede agrupar productos. Por ejemplo: color, talle, temporada (Formato llave valor, separados por pipes "\|") |                                            Color: Blanco \| Talle :XXXL                                           |      NO      |
| specifications               |     String    | Características del producto que no sirven para agrupar. Ejemplos: peso, altura, capacidad (Formato llave valor, separados por pipes "\|")   |                                    Pantalla:5.5 pulgadas \| Almacenamiento:32GB                                   |      No      |
| brand                        |     String    | Marca del producto                                                                                                                           |                                                      Motorola                                                     |      NO      |
| description                  |     String    | Descripción del Producto                                                                                                                     | El Motorola Moto Z Play es el smartphone de gama media de la serie Moto Z, compatible con los módulos Moto Mod... |      NO      |
| url                          |     String    | URL del producto                                                                                                                             |                                       <http://www.example.com/ART-0001.html>                                      |      NO      |
| image\_url                   |     String    | URL de la imagen                                                                                                                             |                                    <http://www.example.com/ART-0001-image.jpg>                                    |      NO      |
| thumbnail\_url               |     String    | URL de la imagen miniatura                                                                                                                   |                                  <http://www.example.com/ART-0001-thumbnail.jpg>                                  |      NO      |
| stock                        |    Integer    | Stock del artículo                                                                                                                           |                                                         10                                                        |      NO      |
| available                    |    Boolean    | ¿Está disponible? \["true", "false", 0, 1]                                                                                                   |                                                         1                                                         |      SI      |
| manufacturer\_warranty\_date |      Date     | Fecha de vencimiento de la garantía                                                                                                          |                                                     2021-02-01                                                    |      NO      |
| extension\_warranty\_date    |      Date     | Fecha de vencimiento de la garantía extendida                                                                                                |                                                     2022-02-01                                                    |      NO      |
| with\_extension\_warranty    |    Boolean    | ¿Garantía extendida? \["true", "false", 0, 1]                                                                                                |                                                         0                                                         |      NO      |

{% file src="/files/-MLrbANpLUuwXbV3tV3y" %}
Archivo de Ventas de Ejemplo
{% endfile %}

### Atributos Extendidos

{% hint style="success" %}
Esta entidad permite agregar atributos extendidos. ¿Que son? Son campos que no son nativos en WoowUp. Por Ejemplo: Tipo de tela del producto/Tamaño/Tipo de producto. Para parametrizarlo en Woowup Puedes seguís las instrucciones: <https://bit.ly/3e2892r>
{% endhint %}

La cabecera para un atributo extendido se envía en formato `custom_attributes.{nombre_atributo}` ese atributo se va a crear en WoowUp con el nombre que se encuentre en la cabecera, es decir si yo quiero crear el atributo para Ventas "cupon\_descuento" la cabecera seria `custom_attributes.cupon_descuento`


# Archivo de Medios de Pago

Este archivo o Query SQL se generará en caso de tener varios métodos de pago por factura.

| Nombre del Campo / Cabeceras | Tipo de Campo | Descripción                                                                         |    Ejemplo    | Obligatorios |
| ---------------------------- | :-----------: | ----------------------------------------------------------------------------------- | :-----------: | :----------: |
| invoice\_number              |     String    | Numero de factura tal cual esta en el archivo Orders                                |   FAC0123213  |      SI      |
| branch\_name                 |     String    | Tienda donde realizo la venta                                                       |      A101     |      SI      |
| type                         |     String    | Tipo de pago, valores posibles \['credit', 'debit', 'cash', 'mercadopago', 'other'] |     Credit    |      SI      |
| brand                        |     String    | Marca de la tarjeta                                                                 |      VISA     |      NO      |
| Bank                         |     String    | Banco emisor de la Tarjeta                                                          | Banco Galicia |      NO      |
| Total                        |     Float     | Total pagado por este medio de pago                                                 |      1299     |      SI      |
| Installments                 |    Integer    | Cantidad de Cuotas                                                                  |       2       |      NO      |
| card\_first\_digits          |     String    | Primeros 6 números de la tarjeta                                                    |     12321     |      NO      |

{% file src="/files/-MLrrfsw2zrh\_RGNpq1C" %}
Archivos de Método de pago de Ejemplo
{% endfile %}


# Archivo de Miembros de Familia

El archivo de Miembros de familia o Query SQL contiene los miembros de familia del cliente.

| Campo / Cabeceras | Tipo de Campo | Descripción                     |                                                           Ejemplo                                                           | Obligatorios |
| ----------------- | :-----------: | ------------------------------- | :-------------------------------------------------------------------------------------------------------------------------: | :----------: |
| id                |     String    | ID Externo                      |                                                           12312321                                                          |      SI      |
| email             |     String    | Email                           |                                                    <christian@woowup.com>                                                   |      SI      |
| document          |     String    | Documento                       |                                                           36872489                                                          |      SI      |
| telephone         |     String    | teléfono                        |                                                          1173682446                                                         |      SI      |
| uid\_member       |     String    | ID del miembro                  |                                                              1                                                              |      SI      |
| email\_member     |     String    | Email del miembro               |                                                      <pancho@gmail.com>                                                     |      NO      |
| first\_name       |     String    | Primero nombre del miembro      |                                                            Pancho                                                           |      SI      |
| last\_name        |     String    | Apellido del miembro            |                                                            Vitale                                                           |      NO      |
| telephone         |     String    | Telefono del Miembro            |                                                           11111111                                                          |      NO      |
| birthdate         |      Date     | Fecha de nacimiento del miembro |                                                          2017-03-03                                                         |      NO      |
| address           |     String    | Dirección del miembro           |                                                    Av Siempre viva 12345                                                    |      NO      |
| gender            |      Enum     | Género dle miembro              |                                                             F,M                                                             |      NO      |
| relationship      |      Enum     | Relación con el miembro         | "son", "parent", "grandparent", "sibling", "friend", "espose", "grandson", "nephew", "pet\_dog", "pet\_cat", "pet", "other" |      SI      |

{% file src="/files/-MN4xIyv9bjaTuSNXPBs" %}
Archivo de ejemplo de Member Family
{% endfile %}

###


# Validación de Datos

Este documento te guiará para que puedas validar los datos dentro de WoowUp

Este instructivo lo puede utilizar luego de finalizar las integraciones de tus fuentes de datos o también cuando estás utilizando WoowUp.

### Pasos para validar la información en WoowUp

#### Paso 1

Validar la cantidad de clientes y Leads. Dirígete al módulo de Segmentos y verifica tanto la cantidad de clientes como leads utilizando el botón :

![](https://2630140241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRNHU4Ej62060lN40uV%2F-MZUDi95JBK02yqa62en%2F-MZUGYXujolsGF4_60Xw%2Fimage.png?alt=media\&token=89732895-2b78-4082-9213-6a5a79b9cf1b)

En caso de que tengas diferencias de clientes se debe a que:

* El cliente no tiene un identificador.
* El mail no es válido.
* Dentro de la información hay un carácter especial.

Si no encuentras el error, puedes dirigirte a configuración -> sincronizaciones y encontrar el motivo del error. (Solo valido para ERP vía CSV o FTP). En caso de que no entiendas dicha pantalla te dejamos el [instructivo](http://help.woowup.com/es/articles/4708330-como-saber-si-tus-datos-diarios-se-procesaron-correctamentev)

**Paso 2**<br>

Validar la cantidad productos dentro de WoowUp. Dirígete al maestro de productos (Analytics -> Catálogo de Productos) y verifica la cantidad de productos enviados.

\
En caso de que tengas diferencias de clientes se debe a que:‌

* El producto no tiene SKU.
* Dentro de la información hay un carácter especial.

En caso de que tengan  URL y URL Imagen, pruebalos.

Si no encuentras el error, puedes dirigirte a configuración -> sincronizaciones y encontrar el motivo del error. (Solo valido para ERP vía CSV o FTP). En caso de que no entiendas dicha pantalla te dejamos el [instructivo](http://help.woowup.com/es/articles/4708330-como-saber-si-tus-datos-diarios-se-procesaron-correctamentev)​<br>

#### Paso 3

Validar las categorías dentro de WoowUp. Dirígete al maestro de categorías (Analytics->Catálogo de Categorías) y verifica la cantidad y la calidad de las categorías enviadas.

**Paso 4**

Validar las ventas dentro de WoowUp. Dirígete al listado de facturas (Analytics -> Listado de Facturas) y filtrar por un mes completo de ventas(intenta no elegir el mes en curso). Verifica que la cantidad de facturación, unidades y transacciones sean las mismas a las que tengas.&#x20;

En caso de que tengas diferencias te recomendamos hacer los siguientes pasos:

* Filtrar por una tienda específica dentro del mes filtrado.
* Comparar factura de WoowUp vs Factura de tu fuente de datos.

El resultado puede ser el siguiente:

1. No encontrar una factura
2. Encontrar que una factura tiene distinto monto a la real.

En ambos casos debes hablar con tu equipo de IT identificando el error para que vuelva a enviar nuevamente las facturas faltantes. (El error se replica en varias facturas, al encontrar un error se resuelven el 99,9% de las demás).

Si no encuentras el error, puedes dirigirte a configuración -> sincronizaciones y encontrar el motivo del error. (Solo valido para ERP vía CSV o FTP). En caso de que no entiendas dicha pantalla te dejamos el [instructivo](http://help.woowup.com/es/articles/4708330-como-saber-si-tus-datos-diarios-se-procesaron-correctamentev)​<br>

{% hint style="info" %}
Recuerda que puedes descargar en Excel el reporte de facturas y trabajarlo desde tu computadora.
{% endhint %}

**Paso 5**

Validar los carritos abandonados dentro de WoowUp. Para validarlos te deberas dirigir a Analytics -> Carritos Abandonado.

En dicho reporte se deberán ver reflejados todos tus carritos abandonados recientes. En caso de que no lo tengas, consulta a tu equipo de IT.

**Paso 6**

Validar los registro de Newsletter dentro de WoowUp. Para validarlos te deberas dirigir a Segmentos y filtrar por TAGs, en dicho filtro deberas encontrar el tag según tu Ecommerce, este puede variar entre Newsletter o Ecommerce o puede ser customizado.

En caso de que no tengas ninguno de ellos, consulta a tu equipo de IT para revisar la integración.


# ¿Cómo completar el Blueprint?

### ¿Qué es el Blueprint de WoowUp?

El Blueprint de WoowUp es un archivo para identificar todos los valores que debemos llevar desde nuestras fuentes de datos hacia WoowUp, de esta manera podemos identificar donde guardar cada dato en WoowUp.

### ¿Cómo completar el Blueprint?

Su Account Manager le entregar un GoogleSheet por cada cuenta que tenga en WoowUp y se deberá completar las columnas llamadas "COMPLETAR". Esta columna será completada con SI o NO, y puede agregar optativamente el nombre del campo de la fuente de datos.

### Estructura del Blueprint

WoowUp se separa en 4 entidades:

* Tiendas
* Productos
* Clientes
* Ventas

Donde cada una tiene información referida a su entidad, y las mismas se interrelacionan a través de sus campos claves y obligatorios. Ejemplo el SKU.\
Todas las entidades tienen campos nativos sobre la industria del retail, pero en las entidades, productos, clientes y ventas se pueden agregar atributos extendidos (Campos Custom) referenciados a la vertical/negocio que vaya a utilizar el software. Estos campos debe indicarlos en el blueprint.

{% hint style="success" %}
El campo Email es el utilizado para enviar correos a esa persona
{% endhint %}

{% hint style="success" %}
El campo telephone es el utilizado para enviar SMS
{% endhint %}

{% hint style="warning" %}
Respete los campos para la mejor experiencia de WoowUp
{% endhint %}

### ¿A quien puedo hacer consultas sobre campos?

Cada campo tiene una definición y un ejemplo, pero si aún tenes dudas, podes comentar sobre el mismo GoogleSheet y tu Account Manager te respondera a la brevedad, recordá etiquetarlo.

### &#x20;Recordatorios

* Las categorías debes traerla de una sola fuentes de datos (tienda física o ecommerce), WoowUp recomienda siempre usar la fuente de Ecommerce.
* Los campo de imágenes no hace falta enviarlos si tu ecommerce ya te brinda esa información.
* El service\_UID es un identificador externo, recomendamos no usarlo.
* Para saber que campo vas a agregar, puedes pensar por todos los campos que quisieras segmentar o usar en una campaña. Por Ejemplo: Si quiero saber si un cliente usó un cupón de descuento debo enviar ese cupón de descuento a WoowUp.&#x20;


