Segmento de usuarios

Es la entidad que almacena la información general de todos los segmentos de usuarios

Listado de segmentos de usuarios

GET https://tiendagoshop.com/api/v1/client_segments

Obtener listado de todos los segmentos de usuarioos del ecommerce. Filtros: Al igual que con la mayoría de entidades, es posible utilizar algunos parámetros en la URL para filtrar los resultados. Ver "Query Parameters" debajo para más información.

Query Parameters

NameTypeDescription

q[external_id_eq]

string

Filtro por id externo

q[id_eq]

string

Filtro por id interno

q[name_cont]

string

Filtrar por Nombre del segmento.

Headers

NameTypeDescription

X-Spree-Token*

string

Token generado desde el CMS de GS

{
  "users": [
    {
      "id": 1,
      "first_name": "Pedro",
      "last_name": "Guzman",
      "email": "pedro@goweb.com.do",
      "shipping_addresses": [
        {
          "id": 2,
          "firstname": "Pedro",
          "lastname": "Guzman",
          "address1": "Ave. 27 de Febrero 294",
          "address2": null,
          "city": "Santo Domingo",
          "zipcode": "",
          "phone": "8091112222",
          "state_name": null,
          "alternative_phone": null,
          "company": null,
          "state_id": 1,
          "country_id": 1,
          "geo_address": null,
          "geo_lat": null,
          "geo_lng": null,
          "fiscal_type": null,
          "rnc": null,
          "user_id": 1,
          "address_type": "shipping",
          "deleted_at": null,
          "last_used": "2020-09-30T15:44:30.312Z",
          "created_at": "2020-09-30T13:14:16.530Z",
          "updated_at": "2020-09-30T15:44:30.312Z"
        }
      ],
      "billing_addresses": [
        {
          "id": 1,
          "firstname": "Pedro",
          "lastname": "Guzman",
          "address1": "Ave. 27 de Febrero 294",
          "address2": null,
          "city": "Santo Domingo",
          "zipcode": "",
          "phone": "8091112222",
          "state_name": null,
          "alternative_phone": null,
          "company": null,
          "state_id": 1,
          "country_id": 1,
          "geo_address": null,
          "geo_lat": null,
          "geo_lng": null,
          "fiscal_type": "consumidor",
          "rnc": "",
          "user_id": 1,
          "address_type": "billing",
          "deleted_at": null,
          "last_used": "2020-09-30T15:44:30.310Z",
          "created_at": "2020-09-30T13:14:14.574Z",
          "updated_at": "2020-09-30T15:44:30.310Z"
        }
      ],
      "created_at": "2020-09-25T10:55:51.466Z",
      "updated_at": "2020-09-25T10:56:15.921Z",
      "confirmed_at": null,
      "ext_id": null,
      "has_payment_credit": false,
      "referral_credits": null,
      "referrer_benefit_enabled": true,
      "spree_roles": [
        {
          "id": 3,
          "name": "user",
          "ext_id": null,
          "label": "Cliente",
          "editable": true,
          "is_default": true,
          "admin_accessible": false
        },
        {
          "id": 2,
          "name": "admin",
          "ext_id": null,
          "label": "Admin",
          "editable": true,
          "is_default": false,
          "admin_accessible": true
        }
      ]
    },
    {
      "id": 2,
      "first_name": "Pablo",
      "last_name": "Gimenez",
      "email": "pablo@goweb.com.do",
      "shipping_addresses": [],
      "billing_addresses": [],
      "created_at": "2020-10-05T11:37:16.786Z",
      "updated_at": "2020-10-05T11:37:16.786Z",
      "confirmed_at": null,
      "ext_id": null,
      "has_payment_credit": false,
      "referral_credits": null,
      "referrer_benefit_enabled": true,
      "spree_roles": [
        {
          "id": 3,
          "name": "user",
          "ext_id": null,
          "label": "Cliente",
          "editable": true,
          "is_default": true,
          "admin_accessible": false
        }
      ]
    }
  ],
  "count": 2,
  "current_page": 1,
  "pages": 1
}

Obtener un segmento de usuario

GET https://tiendagoshop.com/api/v1/client_segments/:id

Path Parameters

NameTypeDescription

id*

String

Id del segmento

Headers

NameTypeDescription

X-Spree-Token*

String

Token generado desde el CMS de GS

Crear un segmento de usuario

POST https://tiendagoshop.com/api/v1/client_segments

Crear un nuevo segmento de usuario en el ecommerce.

Headers

NameTypeDescription

X-Spree-Token

string

Token generado desde el CMS de GS

Request Body

NameTypeDescription

name*

string

Nombre del segmento.

description*

string

Descripción del segmento

external_id

string

id externo

user_ids

array

Array de integers con los ids de usuarios

{
  "id": 23,
  "first_name": "Pablo",
  "last_name": "Gimenez",
  "email": "pablo@goweb.com.do",
  "shipping_addresses": [],
  "billing_addresses": [],
  "created_at": "2020-11-16T15:31:14.671-04:00",
  "updated_at": "2020-11-16T15:31:14.671-04:00",
  "confirmed_at": null,
  "ext_id": null,
  "has_payment_credit": false,
  "referral_credits": null,
  "referrer_benefit_enabled": true,
  "spree_roles": [
    {
      "id": 3,
      "name": "user",
      "ext_id": null,
      "label": "Cliente",
      "editable": true,
      "is_default": true,
      "admin_accessible": false
    },
    {
      "id": 4,
      "name": "affiliate",
      "ext_id": null,
      "label": "Afiliado",
      "editable": true,
      "is_default": false,
      "admin_accessible": false
    }
  ],
  "user_field_values": [
    {
      "id": 132,
      "user_field_id": 8,
      "value": "Valor personalizado"
    },
    {
      "id": 133,
      "user_field_id": 11,
      "value": "4"
    },
    {
      "id": 134,
      "user_field_id": 12,
      "value": "0"
    }
  ]
}

Modificar un segmento de usuario

PUT https://tiendagoshop.com/api/v1/client_segments/:id

Modificar un segmeto existente.

Path Parameters

NameTypeDescription

id

integer

ID del segmento de usuario.

Headers

NameTypeDescription

X-Spree-Token

string

Token generado desde el CMS de GS

Request Body

NameTypeDescription

name

string

Nombre del segmento

description

string

Descripción del segmento

external_id

string

Id externo

{
  "id": 24,
  "first_name": "Pablo",
  "last_name": "Gimenez",
  "email": "pablo@goweb.com.do",
  "shipping_addresses": [],
  "billing_addresses": [],
  "created_at": "2020-11-16T15:33:46.232-04:00",
  "updated_at": "2020-11-16T15:33:46.232-04:00",
  "confirmed_at": null,
  "ext_id": null,
  "has_payment_credit": false,
  "referral_credits": null,
  "referrer_benefit_enabled": true,
  "spree_roles": [
    {
      "id": 3,
      "name": "user",
      "ext_id": null,
      "label": "Cliente",
      "editable": true,
      "is_default": true,
      "admin_accessible": false
    },
    {
      "id": 4,
      "name": "affiliate",
      "ext_id": null,
      "label": "Afiliado",
      "editable": true,
      "is_default": false,
      "admin_accessible": false
    }
  ],
  "user_field_values": [
    {
      "id": 135,
      "user_field_id": 8,
      "value": "Valor personalizado mod"
    },
    {
      "id": 136,
      "user_field_id": 11,
      "value": "4"
    },
    {
      "id": 137,
      "user_field_id": 12,
      "value": "0"
    }
  ]
}

Eliminar un segmento de usuario

DELETE https://tiendagoshop.com/api/v1/client_segments/:id

Eliminar un segmento de usuario

Path Parameters

NameTypeDescription

id

integer

ID del segmento de usuario.

Headers

NameTypeDescription

X-Spree-Token

string

Token generado desde el CMS de GS

Última actualización