---
updatedAt: 2026-03-24T22:29:34.000Z
agentTools:
  projectIndex: https://developers.digitalfemsa.io/llms.txt
---

# Create Fiscal Entity

Create a fiscal entity resource for a given customer ID.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "contact": {
      "email": "engineering@femsa.com",
      "name": "Engineering Femsa",
      "url": "https://github.com/digitalfemsa/openapi/issues"
    },
    "description": "Femsa sdk",
    "license": {
      "name": "MIT-LICENSE",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "title": "Femsa API",
    "version": "2.1.0"
  },
  "servers": [
    {
      "description": "Femsa main server",
      "url": "https://api.digitalfemsa.io"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/customers/{id}/fiscal_entities": {
      "post": {
        "description": "Create a fiscal entity resource for a given customer ID.",
        "operationId": "CreateCustomerFiscalEntities",
        "parameters": [
          {
            "description": "Identifier of the resource",
            "example": "6307a60c41de27127515a575",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Use for knowing which language to use",
            "examples": {
              "es": {
                "summary": "for spanish request/response",
                "value": "es"
              },
              "en": {
                "summary": "for english request/response",
                "value": "en"
              }
            },
            "in": "header",
            "name": "Accept-Language",
            "required": false,
            "schema": {
              "default": "es",
              "enum": [
                "es",
                "en"
              ],
              "type": "string"
            }
          },
          {
            "description": "In the case of a holding company, the company id of the child company to which will process the request.",
            "example": "6441b6376b60c3a638da80af",
            "in": "header",
            "name": "X-Child-Company-Id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/customer_fiscal_entities"
        },
        "responses": {
          "200": {
            "content": {
              "application/vnd.app-v2.1.0+json": {
                "schema": {
                  "$ref": "#/components/schemas/create_customer_fiscal_entities_response"
                }
              }
            },
            "description": "successful operation"
          },
          "401": {
            "content": {
              "application/vnd.app-v2.1.0+json": {
                "example": {
                  "details": [
                    {
                      "message": "Please include your access key in your request.",
                      "param": null,
                      "code": "femsa.errors.authentication.missing_key"
                    }
                  ],
                  "log_id": "507f1f77bcf86cd799439011",
                  "object": "error",
                  "type": "authentication_error"
                },
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            },
            "description": "authentication error"
          },
          "404": {
            "content": {
              "application/vnd.app-v2.1.0+json": {
                "example": {
                  "details": [
                    {
                      "message": "The resource was not found.",
                      "param": null,
                      "code": "femsa.errors.resource_not_found.entity",
                      "debug_message": "The object Webhook \"641b1d5662d7e00001eaa46b\" could not be found."
                    }
                  ],
                  "log_id": "641b6c253cd9a50001514fae",
                  "object": "error",
                  "type": "resource_not_found_error"
                },
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            },
            "description": "not found entity"
          },
          "422": {
            "content": {
              "application/vnd.app-v2.1.0+json": {
                "example": {
                  "details": [
                    {
                      "message": "The name does not exist.",
                      "param": "payment_method.name",
                      "code": "femsa.errors.parameter_validation.payment_method.name.nonexistent_token",
                      "debug_message": "The name does not exist."
                    }
                  ],
                  "log_id": "641b6d813cd9a50001515017",
                  "object": "error",
                  "type": "parameter_validation_error"
                },
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            },
            "description": "parameter validation error"
          },
          "500": {
            "content": {
              "application/vnd.app-v2.1.0+json": {
                "example": {
                  "details": [
                    {
                      "debug_message": "There was a runtime error and Femsa engineers have been notified.",
                      "message": "There was a runtime error and Femsa engineers have been notified.",
                      "param": null,
                      "code": "femsa.errors.api.system.general_failure"
                    }
                  ],
                  "object": "error",
                  "type": "api_error",
                  "log_id": "641b6f2b3cd9a50001515098"
                },
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            },
            "description": "internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Create Fiscal Entity",
        "tags": [
          "Customers"
        ]
      }
    }
  },
  "components": {
    "requestBodies": {
      "customer_fiscal_entities": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/customer_fiscal_entities_request"
            }
          }
        },
        "description": "requested field for customer fiscal entities",
        "required": true
      }
    },
    "schemas": {
      "error": {
        "allOf": [
          {
            "$ref": "#/components/schemas/details"
          },
          {
            "properties": {
              "log_id": {
                "description": "log id",
                "example": "507f1f77bcf86cd799439011",
                "nullable": true,
                "type": "string"
              },
              "type": {
                "example": "authentication_error",
                "type": "string"
              },
              "object": {
                "example": "error",
                "type": "string"
              }
            },
            "type": "object"
          }
        ],
        "description": "err model",
        "title": "error"
      },
      "customer_fiscal_entities_request": {
        "properties": {
          "address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/customer_address"
              }
            ]
          },
          "tax_id": {
            "type": "string"
          },
          "name": {
            "example": "Femsa",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          }
        },
        "required": [
          "address"
        ],
        "title": "fiscal_entity_request",
        "type": "object"
      },
      "details": {
        "properties": {
          "details": {
            "items": {
              "$ref": "#/components/schemas/details_error"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "customer_address": {
        "properties": {
          "street1": {
            "example": "Nuevo Leon 254",
            "type": "string"
          },
          "street2": {
            "example": "Departamento 404",
            "type": "string"
          },
          "postal_code": {
            "example": "06100",
            "type": "string"
          },
          "city": {
            "example": "Ciudad de Mexico",
            "type": "string"
          },
          "state": {
            "example": "Ciudad de Mexico",
            "type": "string"
          },
          "country": {
            "description": "this field follows the [ISO 3166-1 alpha-2 standard](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)",
            "example": "MX",
            "type": "string"
          },
          "residential": {
            "default": false,
            "example": true,
            "type": "boolean"
          },
          "external_number": {
            "example": "string",
            "type": "string"
          }
        },
        "required": [
          "city",
          "country",
          "postal_code",
          "street1"
        ],
        "type": "object"
      },
      "create_customer_fiscal_entities_response": {
        "allOf": [
          {
            "$ref": "#/components/schemas/customer_fiscal_entities_request"
          },
          {
            "properties": {
              "id": {
                "example": "ship_cont_2tKZsTYcsryyu7Ah8",
                "type": "string"
              },
              "object": {
                "example": "shipping_contact",
                "type": "string"
              },
              "created_at": {
                "example": 1675715413,
                "format": "int64",
                "type": "integer"
              },
              "parent_id": {
                "example": "cus_2tKcHxhTz7xU5SymF",
                "type": "string"
              },
              "default": {
                "type": "boolean"
              }
            },
            "required": [
              "created_at",
              "id",
              "object"
            ],
            "type": "object"
          }
        ],
        "title": "create_customer_fiscal_entities_response"
      },
      "details_error": {
        "properties": {
          "code": {
            "example": "femsa.errors.authentication.missing_key",
            "type": "string"
          },
          "param": {
            "nullable": true,
            "type": "string"
          },
          "message": {
            "example": "Acceso no autorizado.",
            "type": "string"
          },
          "debug_message": {
            "example": "Please include your access key in your request.",
            "type": "string"
          }
        },
        "title": "details_error",
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```