Create Issuer
curl --request POST \
--url http://localhost:8000/issuers \
--header 'Content-Type: application/json' \
--data '
{
"direccion_matriz": "Av. Principal 123 y Secundaria, Quito, Ecuador",
"legal_representative": "Jane Doe",
"nombre_comercial": "Ejemplo Corp",
"razon_social": "EMPRESA EJEMPLO S.A.",
"ruc": "1234567890001",
"sri_environment": "TEST",
"tipo_contribuyente": "General"
}
'import requests
url = "http://localhost:8000/issuers"
payload = {
"direccion_matriz": "Av. Principal 123 y Secundaria, Quito, Ecuador",
"legal_representative": "Jane Doe",
"nombre_comercial": "Ejemplo Corp",
"razon_social": "EMPRESA EJEMPLO S.A.",
"ruc": "1234567890001",
"sri_environment": "TEST",
"tipo_contribuyente": "General"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
direccion_matriz: 'Av. Principal 123 y Secundaria, Quito, Ecuador',
legal_representative: 'Jane Doe',
nombre_comercial: 'Ejemplo Corp',
razon_social: 'EMPRESA EJEMPLO S.A.',
ruc: '1234567890001',
sri_environment: 'TEST',
tipo_contribuyente: 'General'
})
};
fetch('http://localhost:8000/issuers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/issuers",
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([
'direccion_matriz' => 'Av. Principal 123 y Secundaria, Quito, Ecuador',
'legal_representative' => 'Jane Doe',
'nombre_comercial' => 'Ejemplo Corp',
'razon_social' => 'EMPRESA EJEMPLO S.A.',
'ruc' => '1234567890001',
'sri_environment' => 'TEST',
'tipo_contribuyente' => 'General'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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 := "http://localhost:8000/issuers"
payload := strings.NewReader("{\n \"direccion_matriz\": \"Av. Principal 123 y Secundaria, Quito, Ecuador\",\n \"legal_representative\": \"Jane Doe\",\n \"nombre_comercial\": \"Ejemplo Corp\",\n \"razon_social\": \"EMPRESA EJEMPLO S.A.\",\n \"ruc\": \"1234567890001\",\n \"sri_environment\": \"TEST\",\n \"tipo_contribuyente\": \"General\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:8000/issuers")
.header("Content-Type", "application/json")
.body("{\n \"direccion_matriz\": \"Av. Principal 123 y Secundaria, Quito, Ecuador\",\n \"legal_representative\": \"Jane Doe\",\n \"nombre_comercial\": \"Ejemplo Corp\",\n \"razon_social\": \"EMPRESA EJEMPLO S.A.\",\n \"ruc\": \"1234567890001\",\n \"sri_environment\": \"TEST\",\n \"tipo_contribuyente\": \"General\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/issuers")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"direccion_matriz\": \"Av. Principal 123 y Secundaria, Quito, Ecuador\",\n \"legal_representative\": \"Jane Doe\",\n \"nombre_comercial\": \"Ejemplo Corp\",\n \"razon_social\": \"EMPRESA EJEMPLO S.A.\",\n \"ruc\": \"1234567890001\",\n \"sri_environment\": \"TEST\",\n \"tipo_contribuyente\": \"General\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2024-01-01T00:00:00Z",
"direccion_matriz": "Av. Principal 123 y Secundaria, Quito, Ecuador",
"id": "550e8400-e29b-41d4-a716-446655440000",
"is_active": true,
"legal_representative": "Jane Doe",
"nombre_comercial": "Ejemplo Corp",
"razon_social": "EMPRESA EJEMPLO S.A.",
"ruc": "1234567890001",
"sri_environment": "TEST",
"tenant_id": "660e8400-e29b-41d4-a716-446655440000",
"tipo_contribuyente": "General",
"updated_at": "2024-01-01T00:00:00Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}issuers
Create Issuer
Create a new Issuer.
Creates a new fiscal issuer associated with the active tenant. Requires tenant_admin role or higher.
All database operations use async/await for non-blocking I/O.
Args: payload: Issuer creation data db: Async database session tenant_id: Active tenant ID from authentication context
Returns: IssuerResponse: Created issuer data
Raises: HTTPException 422: If validation fails
POST
/
issuers
Create Issuer
curl --request POST \
--url http://localhost:8000/issuers \
--header 'Content-Type: application/json' \
--data '
{
"direccion_matriz": "Av. Principal 123 y Secundaria, Quito, Ecuador",
"legal_representative": "Jane Doe",
"nombre_comercial": "Ejemplo Corp",
"razon_social": "EMPRESA EJEMPLO S.A.",
"ruc": "1234567890001",
"sri_environment": "TEST",
"tipo_contribuyente": "General"
}
'import requests
url = "http://localhost:8000/issuers"
payload = {
"direccion_matriz": "Av. Principal 123 y Secundaria, Quito, Ecuador",
"legal_representative": "Jane Doe",
"nombre_comercial": "Ejemplo Corp",
"razon_social": "EMPRESA EJEMPLO S.A.",
"ruc": "1234567890001",
"sri_environment": "TEST",
"tipo_contribuyente": "General"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
direccion_matriz: 'Av. Principal 123 y Secundaria, Quito, Ecuador',
legal_representative: 'Jane Doe',
nombre_comercial: 'Ejemplo Corp',
razon_social: 'EMPRESA EJEMPLO S.A.',
ruc: '1234567890001',
sri_environment: 'TEST',
tipo_contribuyente: 'General'
})
};
fetch('http://localhost:8000/issuers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/issuers",
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([
'direccion_matriz' => 'Av. Principal 123 y Secundaria, Quito, Ecuador',
'legal_representative' => 'Jane Doe',
'nombre_comercial' => 'Ejemplo Corp',
'razon_social' => 'EMPRESA EJEMPLO S.A.',
'ruc' => '1234567890001',
'sri_environment' => 'TEST',
'tipo_contribuyente' => 'General'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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 := "http://localhost:8000/issuers"
payload := strings.NewReader("{\n \"direccion_matriz\": \"Av. Principal 123 y Secundaria, Quito, Ecuador\",\n \"legal_representative\": \"Jane Doe\",\n \"nombre_comercial\": \"Ejemplo Corp\",\n \"razon_social\": \"EMPRESA EJEMPLO S.A.\",\n \"ruc\": \"1234567890001\",\n \"sri_environment\": \"TEST\",\n \"tipo_contribuyente\": \"General\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:8000/issuers")
.header("Content-Type", "application/json")
.body("{\n \"direccion_matriz\": \"Av. Principal 123 y Secundaria, Quito, Ecuador\",\n \"legal_representative\": \"Jane Doe\",\n \"nombre_comercial\": \"Ejemplo Corp\",\n \"razon_social\": \"EMPRESA EJEMPLO S.A.\",\n \"ruc\": \"1234567890001\",\n \"sri_environment\": \"TEST\",\n \"tipo_contribuyente\": \"General\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/issuers")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"direccion_matriz\": \"Av. Principal 123 y Secundaria, Quito, Ecuador\",\n \"legal_representative\": \"Jane Doe\",\n \"nombre_comercial\": \"Ejemplo Corp\",\n \"razon_social\": \"EMPRESA EJEMPLO S.A.\",\n \"ruc\": \"1234567890001\",\n \"sri_environment\": \"TEST\",\n \"tipo_contribuyente\": \"General\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2024-01-01T00:00:00Z",
"direccion_matriz": "Av. Principal 123 y Secundaria, Quito, Ecuador",
"id": "550e8400-e29b-41d4-a716-446655440000",
"is_active": true,
"legal_representative": "Jane Doe",
"nombre_comercial": "Ejemplo Corp",
"razon_social": "EMPRESA EJEMPLO S.A.",
"ruc": "1234567890001",
"sri_environment": "TEST",
"tenant_id": "660e8400-e29b-41d4-a716-446655440000",
"tipo_contribuyente": "General",
"updated_at": "2024-01-01T00:00:00Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Cookies
Body
application/json
Schema for creating a new Issuer.
RUC (Registro Único de Contribuyentes) - 13 digits
Required string length:
13Pattern:
^\d{13}$Legal business name (razón social)
Required string length:
1 - 300Main office address
Minimum string length:
1Taxpayer type (e.g., 'RISE', 'RIMPE', 'General')
Required string length:
1 - 50SRI environment: TEST or PRODUCTION
Available options:
TEST, PRODUCTION Trade name (nombre comercial)
Maximum string length:
300Legal representative name
Maximum string length:
255Response
Successful Response
Schema for Issuer response.
SRI environment types.
Available options:
TEST, PRODUCTION