Client

Add client

Agrega un cliente

Resource URL

POST http://api.next-cloud.mx/v1/client.(format)
Parameters:
  • format – json o xml.
Request Headers:
 
Request JSON Object:
 
  • address (string) – Dirección del cliente.
  • area (string) – Área del teléfono.
  • birthday (string) – Fecha de nacimiento del cliente, formato YYYYMMDD.
  • business_name (string) – Razón social del cliente.
  • city (string) – Ciudad del cliente.
  • contact (string) – Nombre del contacto para envíos.
  • contact_2 (string) – Segundo nombre de contacto para envíos.
  • country (string) – País, ejemplo “MEX”.
  • email (string) – Correo electrónico del cliente.
  • fax (string) – Fax del cliente.
  • interior_number" (string) – Número interior de la dirección.
  • kind (string) – Tipo de cliente, ejemplo “F”.
  • last_name (string) – Apellido paterno del cliente.
  • last_name_2 (string) – Apellido materno del cliente.
  • location (string) – Detalles de la ubicación del cliente.
  • name (string) – Nombre del cliente.
  • outdoor_number (string) – Número exterior de la dirección.
  • phone (string) – Teléfono del cliente.
  • phone_2 (string) – Segundo teléfono del cliente.
  • postal_code (int) – Código postal de la dirección.
  • profession (string) – Profesión del cliente.
  • rfc (string) – RFC del cliente.
  • sex (string) – Género del cliente ( “M” o “F” ).
  • sort (string) – Clase del cliente.
  • state (string) – Estado de la dirección.
  • suburb (string) – Colonia de la dirección.
Response JSON Object:
 
  • id (int) – ID del cliente.
Status Codes:

Example request

POST http://api.next-cloud.mx/v1/client.json HTTP/1.1
Host: api.next-cloud.mx
Accept: application/json
Content-Type: application/json
Authorization: Token ( token del usuario )
{
    "address": "calle 123 colonia DF MEX",
    "area": "55",
    "birthday": "19850515",
    "business_name": "Quijote Alvarado Cruz",
    "city": "DF",
    "contact": "Luis omar Carballo",
    "contact_2": "",
    "country": "MEX",
    "email": "Correo@Dominio.com",
    "fax": "",
    "interior_number": "",
    "kind": "F",
    "last_name": "Alvarado",
    "last_name_2": "Cruz",
    "location": "entre calle 1 y calle 2",
    "name": "Quijote",
    "outdoor_number": "123",
    "phone": "123456789",
    "phone_2": "",
    "postal_code": 55555,
    "profession": "2",
    "rfc": "AACN751208HE4",
    "sex": "M",
    "sort": "S",
    "state": "DF",
    "suburb": "colonia"
}

Example Response

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
Allow: POST, PUT, OPTIONS
{
	"id": 123456
}

Example XML

Example request

POST http://api.next-cloud.mx/v1/client.xml HTTP/1.1
Host: api.next-cloud.mx
Accept: application/xml
Content-Type: application/xml
Authorization: Token ( token del usuario )
<?xml version="1.0" encoding="UTF-8"?>
<root>
	<last_name>Alvarado</last_name>
	<profession>2</profession>
	<sex>M</sex>
	<postal_code>55555</postal_code>
	<phone_2 />
	<city>DF</city>
	<area>55</area>
	<contact_2 />
	<state>DF</state>
	<location>entre calle 1 y calle 2</location>
	<last_name_2>Cruz</last_name_2>
	<email>Correo@Dominio.com</email>
	<sort>S</sort>
	<fax />
	<phone>123456789</phone>
	<birthday>19850515</birthday>
	<address>calle 123 colonia DF MEX</address>
	<business_name>Quijote Alvarado Cruz</business_name>
	<kind>F</kind>
	<name>Quijote</name>
	<suburb>colonia</suburb>
	<country>MEX</country>
	<interior_number />
	<rfc>AACN751208HE4</rfc>
	<outdoor_number>123</outdoor_number>
	<contact>Luis omar Carballo</contact>
</root>

Example Response

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/xml; charset=utf-8
Allow: POST, PUT, OPTIONS
<?xml version="1.0" encoding="UTF-8"?>
<root>
	<id>123456</id>
</root>

Edit client

Modifica los datos de un cliente.

Resource URL

POST http://api.next-cloud.mx/v1/client/(int: client_id).(format)
Parameters:
  • format – json o xml.
Request Headers:
 
Request JSON Object:
 
  • address (string) – Dirección del cliente.
  • area (string) – Área del teléfono.
  • birthday (string) – Fecha de nacimiento del cliente, formato YYYYMMDD.
  • business_name (string) – Razón social del cliente.
  • city (string) – Ciudad del cliente.
  • contact (string) – Nombre del contacto para envíos.
  • contact_2 (string) – Segundo nombre de contacto para envíos.
  • country (string) – País, ejemplo “MEX”.
  • email (string) – Correo electrónico del cliente.
  • fax (string) – Fax del cliente.
  • interior_number" (string) – Número interior de la dirección.
  • kind (string) – Tipo de cliente, ejemplo “F”.
  • last_name (string) – Apellido paterno del cliente.
  • last_name_2 (string) – Apellido materno del cliente.
  • location (string) – Detalles de la ubicación del cliente.
  • name (string) – Nombre del cliente.
  • outdoor_number (string) – Número exterior de la dirección.
  • phone (string) – Teléfono del cliente.
  • phone_2 (string) – Segundo teléfono del cliente.
  • postal_code (int) – Código postal de la dirección.
  • profession (string) – Profesión del cliente.
  • rfc (string) – RFC del cliente.
  • sex (string) – Género del cliente ( “M” o “F” ).
  • sort (string) – Clase del cliente.
  • state (string) – Estado de la dirección.
  • suburb (string) – Colonia de la dirección.
Response JSON Object:
 
  • detail (string) – Mensaje de respuesta.
Status Codes:

Example request

POST http://api.next-cloud.mx/v1/client.json HTTP/1.1
Host: api.next-cloud.mx
Accept: application/json
Content-Type: application/json
Authorization: Token ( token del usuario )
{
    "address": "calle 123 colonia DF MEX",
    "area": "55",
    "birthday": "19850515",
    "business_name": "Quijote Alvarado Cruz",
    "city": "DF",
    "contact": "Luis omar Carballo",
    "contact_2": "",
    "country": "MEX",
    "email": "Correo@Dominio.com",
    "fax": "",
    "interior_number": "",
    "kind": "F",
    "last_name": "Alvarado",
    "last_name_2": "Cruz",
    "location": "entre calle 1 y calle 2",
    "name": "Quijote",
    "outdoor_number": "123",
    "phone": "123456789",
    "phone_2": "",
    "postal_code": 55555,
    "profession": "2",
    "rfc": "AACN751208HE4",
    "sex": "M",
    "sort": "S",
    "state": "DF",
    "suburb": "colonia"
}

Example Response

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
Allow: POST, PUT, OPTIONS
{
	"detail": "Datos del cliente actualizados"
}

Example XML

Example request

POST http://api.next-cloud.mx/v1/client.xml HTTP/1.1
Host: api.next-cloud.mx
Accept: application/xml
Content-Type: application/xml
Authorization: Token ( token del usuario )
<?xml version="1.0" encoding="UTF-8"?>
<root>
	<last_name>Alvarado</last_name>
	<profession>2</profession>
	<sex>M</sex>
	<postal_code>55555</postal_code>
	<phone_2 />
	<city>DF</city>
	<area>55</area>
	<contact_2 />
	<state>DF</state>
	<location>entre calle 1 y calle 2</location>
	<last_name_2>Cruz</last_name_2>
	<email>Correo@Dominio.com</email>
	<sort>S</sort>
	<fax />
	<phone>123456789</phone>
	<birthday>19850515</birthday>
	<address>calle 123 colonia DF MEX</address>
	<business_name>Quijote Alvarado Cruz</business_name>
	<kind>F</kind>
	<name>Quijote</name>
	<suburb>colonia</suburb>
	<country>MEX</country>
	<interior_number />
	<rfc>AACN751208HE4</rfc>
	<outdoor_number>123</outdoor_number>
	<contact>Luis omar Carballo</contact>
</root>

Example Response

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/xml; charset=utf-8
Allow: POST, PUT, OPTIONS
<?xml version="1.0" encoding="UTF-8"?>
<root>
	<detail>Datos del cliente actualizados</detail>
</root>