gigstack API
  1. Clients
gigstack API
  • gigstack API, your fiscal infraestructure
  • Ping
    • Ping
    • Ping API (GET)
      GET
    • Ping API (POST)
      POST
    • Ping API (PUT)
      PUT
    • Ping API (DELETE)
      DELETE
  • Payments
    • Payments
    • Create a payment
      POST
    • List payments
      GET
    • Get payment by ID
      GET
  • Invoices
    • Invoices
    • Create an invoice
      POST
    • List invoices
      GET
    • Get invoice by ID
      GET
  • Clients
    • Clients
    • Create a client
      POST
    • List clients
      GET
    • Get client by ID
      GET
  • Services
    • Services
    • Create a service
      POST
    • List services
      GET
    • Get service by ID
      GET
  • Receipts
    • Receipts
    • Create a receipt
      POST
    • List receipts
      GET
    • Get receipt by ID
      GET
    • Update receipt
      PUT
    • Delete receipt
      DELETE
  • Webhooks
    • Webhooks
    • Create a webhook
    • List webhooks
    • Get webhook by ID
    • Delete webhook
  • Catalogs
    • Catalogs
    • List catalogs
    • Get catalog by ID
  • Connect
    • Connect
    • Create a team
    • List teams
    • Get team by ID
    • Update team
    • Get team onboarding URL and connection status
    • Get team members
    • Update team members
    • Remove team members
  1. Clients

Clients

Clients#

The Clients API allows you to manage client information, RFC details, legal names, and comprehensive client data for invoicing and payment processing.

Overview#

Use the Clients API to:
Create and manage client information
Handle RFC (tax ID) validation and management
Store legal names and contact details
Filter and search clients
Integrate clients with invoices and payments

Endpoints#

POST /v2/clients#

Create a new client.
Authentication Required: Yes

Request Body#

{
  "name": "Cliente Example",
  "legalName": "Cliente Example S.A. de C.V.",
  "rfc": "XAXX010101000",
  "email": "cliente@example.com",
  "phone": "+52 55 1234 5678",
  "address": {
    "street": "Av. Insurgentes Sur 123",
    "city": "Ciudad de México",
    "state": "CDMX",
    "zipCode": "03100",
    "country": "México"
  }
}

Parameters#

ParameterTypeRequiredDescription
namestringYesClient display name
legalNamestringNoLegal business name
rfcstringYesRFC (tax identification)
emailstringNoClient email address
phonestringNoClient phone number
addressobjectNoClient address information

Response#

Success Response (201 Created):
{
  "data": {
    "id": "client_123",
    "name": "Cliente Example",
    "legalName": "Cliente Example S.A. de C.V.",
    "client": {
      "rfc": "XAXX010101000",
      "email": "cliente@example.com"
    },
    "phone": "+52 55 1234 5678",
    "address": {
      "street": "Av. Insurgentes Sur 123",
      "city": "Ciudad de México",
      "state": "CDMX",
      "zipCode": "03100",
      "country": "México"
    },
    "timestamp": "2024-01-15T10:30:00.000Z"
  },
  "message": "Client created successfully"
}

GET /v2/clients#

List clients with optional filtering.
Authentication Required: Yes

Query Parameters#

ParameterTypeDescription
limitnumberNumber of results to return (default: 20, max: 100)
offsetnumberNumber of results to skip
namestringFilter by client name (partial match)
rfcstringFilter by RFC
emailstringFilter by email address
fromstringFilter clients created from date (ISO 8601)
tostringFilter clients created to date (ISO 8601)

Response#

Success Response (200 OK):
{
  "data": [
    {
      "id": "client_123",
      "name": "Cliente Example",
      "legalName": "Cliente Example S.A. de C.V.",
      "client": {
        "rfc": "XAXX010101000",
        "email": "cliente@example.com"
      },
      "timestamp": "2024-01-15T10:30:00.000Z"
    }
  ],
  "message": "Clients retrieved successfully",
  "totalResults": 1,
  "hasMore": false,
  "next": null
}

GET /v2/clients/{clientId}#

Get a specific client by ID.
Authentication Required: Yes

Response#

Success Response (200 OK):
{
  "data": {
    "id": "client_123",
    "name": "Cliente Example",
    "legalName": "Cliente Example S.A. de C.V.",
    "client": {
      "rfc": "XAXX010101000",
      "email": "cliente@example.com"
    },
    "phone": "+52 55 1234 5678",
    "address": {
      "street": "Av. Insurgentes Sur 123",
      "city": "Ciudad de México",
      "state": "CDMX",
      "zipCode": "03100",
      "country": "México"
    },
    "timestamp": "2024-01-15T10:30:00.000Z"
  },
  "message": "Client retrieved successfully"
}

PUT /v2/clients/{clientId}#

Update an existing client.
Authentication Required: Yes

Request Body#

{
  "email": "nuevo-email@example.com",
  "phone": "+52 55 9876 5432",
  "address": {
    "street": "Nueva Dirección 456",
    "city": "Guadalajara",
    "state": "Jalisco",
    "zipCode": "44100",
    "country": "México"
  }
}

DELETE /v2/clients/{clientId}#

Delete a client.
Authentication Required: Yes
Note: Clients with associated invoices or payments cannot be deleted.

RFC Validation#

The API validates RFC format according to Mexican tax authority standards:
TypeFormatExample
Persona FísicaAAAANNNNNNXXXXAXX010101000
Persona MoralAAA010101XXXABC010101001

Code Examples#

Create a Client#

JavaScript/Node.js:
Python:

Search Clients#

cURL:

Error Handling#

Common Error Responses#

Validation Error (400 Bad Request):
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request parameters",
    "details": {
      "rfc": "Invalid RFC format",
      "email": "Invalid email format",
      "name": "Name is required"
    }
  },
  "message": "Request validation failed"
}
Duplicate RFC Error (409 Conflict):
{
  "error": {
    "code": "DUPLICATE_RFC",
    "message": "A client with this RFC already exists"
  },
  "message": "RFC must be unique"
}
Not Found Error (404 Not Found):
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Client not found"
  },
  "message": "The requested client does not exist"
}

Best Practices#

1.
RFC Validation: Always validate RFC format before submission
2.
Unique RFC: Ensure each client has a unique RFC
3.
Complete Information: Provide as much client information as possible for invoicing
4.
Email Validation: Validate email addresses for automated communications
5.
Address Standardization: Use consistent address formatting
6.
Data Updates: Keep client information up to date

Integration with Other APIs#

Creating Invoices for Clients#

Processing Payments#

Next Steps#

Create invoices for clients
Process payments from clients
Set up receipts for client transactions
Modified at 2025-06-11 04:57:50
Previous
Get invoice by ID
Next
Create a client
Built with