Crear empresa
curl --request POST \
--url https://api.ipsofactura.com/empresas \
--header 'Content-Type: application/json' \
--header 'x-api: <api-key>' \
--data '
{
"rfc": "EKU9003173C9",
"nombre_fiscal": "ESCUELA KEMPER URGATE",
"regimen_fiscal": "601",
"codigo_postal": "06000",
"nombre_empresa": "Escuela Kemper Urgate"
}
'import requests
url = "https://api.ipsofactura.com/empresas"
payload = {
"rfc": "EKU9003173C9",
"nombre_fiscal": "ESCUELA KEMPER URGATE",
"regimen_fiscal": "601",
"codigo_postal": "06000",
"nombre_empresa": "Escuela Kemper Urgate"
}
headers = {
"x-api": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
rfc: 'EKU9003173C9',
nombre_fiscal: 'ESCUELA KEMPER URGATE',
regimen_fiscal: '601',
codigo_postal: '06000',
nombre_empresa: 'Escuela Kemper Urgate'
})
};
fetch('https://api.ipsofactura.com/empresas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ipsofactura.com/empresas",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'rfc' => 'EKU9003173C9',
'nombre_fiscal' => 'ESCUELA KEMPER URGATE',
'regimen_fiscal' => '601',
'codigo_postal' => '06000',
'nombre_empresa' => 'Escuela Kemper Urgate'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ipsofactura.com/empresas"
payload := strings.NewReader("{\n \"rfc\": \"EKU9003173C9\",\n \"nombre_fiscal\": \"ESCUELA KEMPER URGATE\",\n \"regimen_fiscal\": \"601\",\n \"codigo_postal\": \"06000\",\n \"nombre_empresa\": \"Escuela Kemper Urgate\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ipsofactura.com/empresas")
.header("x-api", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"rfc\": \"EKU9003173C9\",\n \"nombre_fiscal\": \"ESCUELA KEMPER URGATE\",\n \"regimen_fiscal\": \"601\",\n \"codigo_postal\": \"06000\",\n \"nombre_empresa\": \"Escuela Kemper Urgate\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ipsofactura.com/empresas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rfc\": \"EKU9003173C9\",\n \"nombre_fiscal\": \"ESCUELA KEMPER URGATE\",\n \"regimen_fiscal\": \"601\",\n \"codigo_postal\": \"06000\",\n \"nombre_empresa\": \"Escuela Kemper Urgate\"\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-...",
"rfc": "EKU9003173C9",
"nombre_empresa": "Escuela Kemper Urgate",
"nombre_fiscal": "ESCUELA KEMPER URGATE",
"regimen_fiscal": "601",
"codigo_postal": "06000",
"es_activo": true
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rfc": "<string>",
"nombre_empresa": "<string>",
"nombre_fiscal": "<string>",
"regimen_fiscal": "<string>",
"codigo_postal": "<string>",
"es_activo": true
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rfc": "<string>",
"nombre_empresa": "<string>",
"nombre_fiscal": "<string>",
"regimen_fiscal": "<string>",
"codigo_postal": "<string>",
"es_activo": true
}Empresas
Crear empresa
Registra un emisor en la cuenta. El RFC debe ser único por cuenta.
POST
/
empresas
Crear empresa
curl --request POST \
--url https://api.ipsofactura.com/empresas \
--header 'Content-Type: application/json' \
--header 'x-api: <api-key>' \
--data '
{
"rfc": "EKU9003173C9",
"nombre_fiscal": "ESCUELA KEMPER URGATE",
"regimen_fiscal": "601",
"codigo_postal": "06000",
"nombre_empresa": "Escuela Kemper Urgate"
}
'import requests
url = "https://api.ipsofactura.com/empresas"
payload = {
"rfc": "EKU9003173C9",
"nombre_fiscal": "ESCUELA KEMPER URGATE",
"regimen_fiscal": "601",
"codigo_postal": "06000",
"nombre_empresa": "Escuela Kemper Urgate"
}
headers = {
"x-api": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
rfc: 'EKU9003173C9',
nombre_fiscal: 'ESCUELA KEMPER URGATE',
regimen_fiscal: '601',
codigo_postal: '06000',
nombre_empresa: 'Escuela Kemper Urgate'
})
};
fetch('https://api.ipsofactura.com/empresas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ipsofactura.com/empresas",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'rfc' => 'EKU9003173C9',
'nombre_fiscal' => 'ESCUELA KEMPER URGATE',
'regimen_fiscal' => '601',
'codigo_postal' => '06000',
'nombre_empresa' => 'Escuela Kemper Urgate'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ipsofactura.com/empresas"
payload := strings.NewReader("{\n \"rfc\": \"EKU9003173C9\",\n \"nombre_fiscal\": \"ESCUELA KEMPER URGATE\",\n \"regimen_fiscal\": \"601\",\n \"codigo_postal\": \"06000\",\n \"nombre_empresa\": \"Escuela Kemper Urgate\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ipsofactura.com/empresas")
.header("x-api", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"rfc\": \"EKU9003173C9\",\n \"nombre_fiscal\": \"ESCUELA KEMPER URGATE\",\n \"regimen_fiscal\": \"601\",\n \"codigo_postal\": \"06000\",\n \"nombre_empresa\": \"Escuela Kemper Urgate\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ipsofactura.com/empresas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rfc\": \"EKU9003173C9\",\n \"nombre_fiscal\": \"ESCUELA KEMPER URGATE\",\n \"regimen_fiscal\": \"601\",\n \"codigo_postal\": \"06000\",\n \"nombre_empresa\": \"Escuela Kemper Urgate\"\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-...",
"rfc": "EKU9003173C9",
"nombre_empresa": "Escuela Kemper Urgate",
"nombre_fiscal": "ESCUELA KEMPER URGATE",
"regimen_fiscal": "601",
"codigo_postal": "06000",
"es_activo": true
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rfc": "<string>",
"nombre_empresa": "<string>",
"nombre_fiscal": "<string>",
"regimen_fiscal": "<string>",
"codigo_postal": "<string>",
"es_activo": true
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rfc": "<string>",
"nombre_empresa": "<string>",
"nombre_fiscal": "<string>",
"regimen_fiscal": "<string>",
"codigo_postal": "<string>",
"es_activo": true
}Authorizations
API key emitida por Ipsofactura, enviada en el header x-api.
Body
application/json
Response
Empresa creada
⌘I