Clients

The client model contains all the information about your clients, such as their name, contact details, external reference, and SPEI CLABE. Use these endpoints to create, retrieve, and update clients in Cobrofácil.

Properties

  • Name
    id
    Type
    string
    Details
    example: 019734bb-1f46-73bb-95d0-62e98a2f6247
    Description

    Unique client ID.

  • Name
    display
    Type
    string
    Details
    example: Juan Mejía
    Description

    Full display name.

  • Name
    external_reference
    Type
    string
    Details
    nullable
    example: client-300
    Description

    External reference.

  • Name
    first_name
    Type
    string
    Details
    example: Juan
    Description

    First name.

  • Name
    middle_name
    Type
    string
    Details
    nullable
    example: Alberto
    Description

    Middle name.

  • Name
    last_name
    Type
    string
    Details
    nullable
    example: Mejía
    Description

    Paternal last name.

  • Name
    mm_name
    Type
    string
    Details
    nullable
    example: null
    Description

    Maternal last name.

  • Name
    email
    Type
    string
    Details
    nullable
    example: juan@example.com
    Description

    Email address.

  • Name
    phone_number
    Type
    string
    Details
    nullable
    example: +526640000000
    Description

    Phone number in E.164 format.

  • Name
    spei_clabe
    Type
    string
    Details
    nullable
    example: 646180630700000001
    Description

    SPEI CLABE.


POST/api/v1/clients

Create client

Creates a client.

Required attributes

  • Name
    first_name
    Type
    string
    Details
    required
    example: Juan
    Description

    First name.

  • Name
    last_name
    Type
    string
    Details
    required
    example: Mejía
    Description

    Paternal last name.

  • Name
    phone_number
    Type
    string
    Details
    required
    example: +526640000000
    Description

    Phone number in E.164 format.

Optional attributes

  • Name
    email
    Type
    string
    Details
    optional
    nullable
    example: juan@example.com
    Description

    Email address.

  • Name
    middle_name
    Type
    string
    Details
    optional
    nullable
    example: Alberto
    Description

    Middle name.

  • Name
    mm_name
    Type
    string
    Details
    optional
    nullable
    example: null
    Description

    Maternal last name.

  • Name
    external_reference
    Type
    string
    Details
    optional
    nullable
    example: client-300
    Description

    External reference.

Request

POST
/api/v1/clients
curl https://api.cobrofacil.com/api/v1/clients \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
  "first_name": "Juan",
  "last_name": "Mejía",
  "phone_number": "+526640000000",
  "email": "juan@example.com",
  "middle_name": "Alberto",
  "mm_name": null,
  "external_reference": "client-300"
}'

Response

{
  "data": {
    "id": "019734bb-1f46-73bb-95d0-62e98a2f6247",
    "display": "Juan Mejía",
    "external_reference": "client-300",
    "first_name": "Juan",
    "middle_name": "Alberto",
    "last_name": "Mejía",
    "mm_name": null,
    "email": "juan@example.com",
    "phone_number": "+526640000000",
    "spei_clabe": "646180630700000001"
  }
}

GET/api/v1/clients/{client_id}

Get client

Gets a client by ID or external reference.

Required attributes

  • Name
    client_id
    Type
    string
    Details
    required
    example: client-200
    Description

    The client ID or external reference.

Request

GET
/api/v1/clients/{client_id}
curl -G https://api.cobrofacil.com/api/v1/clients/client-200 \
  -H "Authorization: Bearer {token}"

Response

{
  "data": {
    "id": "019734bb-1f46-73bb-95d0-62e98a2f6247",
    "display": "Juan Mejía",
    "external_reference": "client-300",
    "first_name": "Juan",
    "middle_name": "Alberto",
    "last_name": "Mejía",
    "mm_name": null,
    "email": "juan@example.com",
    "phone_number": "+526640000000",
    "spei_clabe": "646180630700000001"
  }
}

PATCH/api/v1/clients/{client_id}

Update client

Updates a client.

Required attributes

  • Name
    client_id
    Type
    string
    Details
    required
    example: client-200
    Description

    The client ID or external reference.

Optional attributes

  • Name
    first_name
    Type
    string
    Details
    optional
    example: Juan
    Description

    First name.

  • Name
    email
    Type
    string
    Details
    optional
    nullable
    example: juan@example.com
    Description

    Email address.

  • Name
    middle_name
    Type
    string
    Details
    optional
    nullable
    example: Alberto
    Description

    Middle name.

  • Name
    last_name
    Type
    string
    Details
    optional
    example: Mejía
    Description

    Paternal last name.

  • Name
    mm_name
    Type
    string
    Details
    optional
    nullable
    example: null
    Description

    Maternal last name.

  • Name
    phone_number
    Type
    string
    Details
    optional
    example: +526640000000
    Description

    Phone number in E.164 format for Mexico or the US.

  • Name
    external_reference
    Type
    string
    Details
    optional
    nullable
    example: client-300
    Description

    External reference.

Request

PATCH
/api/v1/clients/{client_id}
curl https://api.cobrofacil.com/api/v1/clients/client-200 \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
  "first_name": "Juan",
  "email": "juan@example.com",
  "middle_name": "Alberto",
  "last_name": "Mejía",
  "mm_name": null,
  "phone_number": "+526640000000",
  "external_reference": "client-300"
}'

Response

{
  "data": {
    "id": "019734bb-1f46-73bb-95d0-62e98a2f6247",
    "display": "Juan Mejía",
    "external_reference": "client-300",
    "first_name": "Juan",
    "middle_name": "Alberto",
    "last_name": "Mejía",
    "mm_name": null,
    "email": "juan@example.com",
    "phone_number": "+526640000000",
    "spei_clabe": "646180630700000001"
  }
}

Was this page helpful?