# 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 %}
