Skip to main content
POST
/
api
/
profiles
Create Profile
curl --request POST \
  --url https://api.example.com/api/profiles \
  --header 'Content-Type: application/json' \
  --data '
{
  "nombre": "<string>",
  "rfc": "<string>",
  "tipo_persona": {},
  "regimenes_fiscales": [
    "<string>"
  ],
  "validaciones_habilitadas": {
    "validarRFCIngresos": true,
    "validarRFCGastos": true,
    "validarRegimenFiscal": true,
    "validarUUIDDuplicado": true,
    "bloquearSiRFCNoCoincide": true,
    "bloquearSiRegimenNoCoincide": true
  }
}
'
{
  "message": "<string>",
  "data": {
    "id": "<string>",
    "user_id": "<string>",
    "nombre": "<string>",
    "rfc": "<string>",
    "tipo_persona": {},
    "regimenes_fiscales": [
      "<string>"
    ],
    "validaciones_habilitadas": {},
    "created_at": "<string>",
    "updated_at": "<string>",
    "frozen": true,
    "frozen_reason": {},
    "frozen_at": {}
  }
}

Authentication

This endpoint requires authentication using a JWT token in the Authorization header.

Request Body

nombre
string
required
Name of the profile or business entity
rfc
string
required
RFC (Registro Federal de Contribuyentes) - Mexican tax identification number. Must be valid according to SAT format rules.
tipo_persona
enum
required
Type of taxpayer entity:
  • FISICA: Individual taxpayer (Persona Física)
  • MORAL: Corporation or legal entity (Persona Moral)
regimenes_fiscales
string[]
Array of tax regime codes applicable to this profile. These are official SAT regime codes (e.g., “601”, “603”, “605”).
validaciones_habilitadas
object
Configuration object for validation rules to enable for this profile
validarRFCIngresos
boolean
Validate RFC on income invoices
validarRFCGastos
boolean
Validate RFC on expense invoices
validarRegimenFiscal
boolean
Validate tax regime matches profile configuration
validarUUIDDuplicado
boolean
Check for duplicate invoice UUIDs
bloquearSiRFCNoCoincide
boolean
Block invoice processing if RFC doesn’t match
bloquearSiRegimenNoCoincide
boolean
Block invoice processing if tax regime doesn’t match

Response

message
string
required
Success message confirming profile creation
data
Profile
required
The created profile object
id
string
required
Unique identifier for the newly created profile
user_id
string
required
ID of the user who owns this profile
nombre
string
required
Name of the profile or business entity
rfc
string
required
RFC (Registro Federal de Contribuyentes)
tipo_persona
enum
required
Type of taxpayer entity (FISICA or MORAL)
regimenes_fiscales
string[]
required
Array of tax regime codes
validaciones_habilitadas
object
required
Configuration object for validation rules
created_at
string
required
ISO 8601 timestamp of when the profile was created
updated_at
string
required
ISO 8601 timestamp of when the profile was last updated
frozen
boolean
Whether the profile is frozen
frozen_reason
enum
Reason why the profile is frozen
frozen_at
string | null
ISO 8601 timestamp of when the profile was frozen

Example Request

curl -X POST https://api.contafy.com/api/profiles \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Mi Empresa SA de CV",
    "rfc": "XAXX010101000",
    "tipo_persona": "MORAL",
    "regimenes_fiscales": ["601", "603"],
    "validaciones_habilitadas": {
      "validarRFCIngresos": true,
      "validarRFCGastos": true,
      "validarRegimenFiscal": false,
      "validarUUIDDuplicado": true,
      "bloquearSiRFCNoCoincide": false,
      "bloquearSiRegimenNoCoincide": false
    }
  }'

Example Response

{
  "message": "Profile created successfully",
  "data": {
    "id": "prof_1234567890",
    "user_id": "user_0987654321",
    "nombre": "Mi Empresa SA de CV",
    "rfc": "XAXX010101000",
    "tipo_persona": "MORAL",
    "regimenes_fiscales": ["601", "603"],
    "validaciones_habilitadas": {
      "validarRFCIngresos": true,
      "validarRFCGastos": true,
      "validarRegimenFiscal": false,
      "validarUUIDDuplicado": true,
      "bloquearSiRFCNoCoincide": false,
      "bloquearSiRegimenNoCoincide": false
    },
    "created_at": "2024-03-04T16:30:00.000Z",
    "updated_at": "2024-03-04T16:30:00.000Z",
    "frozen": false
  }
}

Error Responses

400 Bad Request

{
  "error": "Bad Request",
  "message": "Invalid RFC format"
}

401 Unauthorized

{
  "error": "Unauthorized",
  "message": "Invalid or missing authentication token"
}

403 Forbidden

{
  "error": "Forbidden",
  "message": "Profile limit reached for your current plan"
}

422 Unprocessable Entity

{
  "error": "Validation Error",
  "message": "Missing required field: nombre"
}

500 Internal Server Error

{
  "error": "Internal Server Error",
  "message": "An error occurred while creating the profile"
}