Create a credential
curl --request POST \
--url https://api.syntage.com/credentials \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"type": "<string>",
"rfc": "PEIC211118IS0",
"password": "secret123"
}
'import requests
url = "https://api.syntage.com/credentials"
payload = {
"type": "<string>",
"rfc": "PEIC211118IS0",
"password": "secret123"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', rfc: 'PEIC211118IS0', password: 'secret123'})
};
fetch('https://api.syntage.com/credentials', 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.syntage.com/credentials",
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([
'type' => '<string>',
'rfc' => 'PEIC211118IS0',
'password' => 'secret123'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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.syntage.com/credentials"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"rfc\": \"PEIC211118IS0\",\n \"password\": \"secret123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.syntage.com/credentials")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"rfc\": \"PEIC211118IS0\",\n \"password\": \"secret123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syntage.com/credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"rfc\": \"PEIC211118IS0\",\n \"password\": \"secret123\"\n}"
response = http.request(request)
puts response.read_body{
"@context": "/contexts/Credential",
"@id": "/credentials/91106968-1abd-4d64-85c1-4e73d96fb997",
"@type": "Credential",
"id": "91106968-1abd-4d64-85c1-4e73d96fb997",
"type": "ciec",
"rfc": "PEIC211118IS0",
"status": "pending",
"createdAt": "2020-01-01T12:15:00.000Z",
"updatedAt": "2020-01-01T12:15:00.000Z"
}{
"@context": "/contexts/ConstraintViolation",
"@type": "ConstraintViolation",
"hydra:title": "An error occurred",
"hydra:description": "exampleField: This value should not be blank.",
"violations": [
{
"propertyPath": "exampleField",
"message": "This value should not be blank.",
"code": "rfc_valid_no_name_on_file"
}
]
}{
"message": "<string>"
}Credentials
Create a credential
Create a SAT credential for an RFC. If the RFC is not already associated with your organization, Syntage creates the related entity association as part of credential creation.
POST
/
credentials
Create a credential
curl --request POST \
--url https://api.syntage.com/credentials \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"type": "<string>",
"rfc": "PEIC211118IS0",
"password": "secret123"
}
'import requests
url = "https://api.syntage.com/credentials"
payload = {
"type": "<string>",
"rfc": "PEIC211118IS0",
"password": "secret123"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', rfc: 'PEIC211118IS0', password: 'secret123'})
};
fetch('https://api.syntage.com/credentials', 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.syntage.com/credentials",
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([
'type' => '<string>',
'rfc' => 'PEIC211118IS0',
'password' => 'secret123'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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.syntage.com/credentials"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"rfc\": \"PEIC211118IS0\",\n \"password\": \"secret123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.syntage.com/credentials")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"rfc\": \"PEIC211118IS0\",\n \"password\": \"secret123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syntage.com/credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"rfc\": \"PEIC211118IS0\",\n \"password\": \"secret123\"\n}"
response = http.request(request)
puts response.read_body{
"@context": "/contexts/Credential",
"@id": "/credentials/91106968-1abd-4d64-85c1-4e73d96fb997",
"@type": "Credential",
"id": "91106968-1abd-4d64-85c1-4e73d96fb997",
"type": "ciec",
"rfc": "PEIC211118IS0",
"status": "pending",
"createdAt": "2020-01-01T12:15:00.000Z",
"updatedAt": "2020-01-01T12:15:00.000Z"
}{
"@context": "/contexts/ConstraintViolation",
"@type": "ConstraintViolation",
"hydra:title": "An error occurred",
"hydra:description": "exampleField: This value should not be blank.",
"violations": [
{
"propertyPath": "exampleField",
"message": "This value should not be blank.",
"code": "rfc_valid_no_name_on_file"
}
]
}{
"message": "<string>"
}Authorizations
Your API key is available in the Production and Sandbox dashboards.
Body
application/json
Response
Credential resource response
SAT Credential IRI reference
Example:
"/credentials/91106968-1abd-4d64-85c1-4e73d96fb997"
Credential ID
Example:
"91106968-1abd-4d64-85c1-4e73d96fb997"
Available options:
ciec, efirma Example:
"ciec"
RFC (Registro Federal de Contribuyentes)
Required string length:
12 - 13Example:
"PEIC211118IS0"
Credential validation status:
| Value | Description |
|---|---|
waiting | Credential validation is temporarily disabled, usually because of an ongoing incident. The credential will be validated later. |
pending | Credential validation has been requested and is waiting to be processed. |
valid | The credential was accepted by SAT and can be used for extractions. |
invalid | SAT rejected the credential during validation. |
disabled | SAT reported the credential as disabled or otherwise unrecoverable during validation. |
deactivated | Deprecated. Legacy status retained for existing records. The disabled status is used for credentials that can no longer be used. |
error | Credential validation failed because of an unexpected error. |
Available options:
waiting, pending, valid, invalid, disabled, deactivated, error Example:
"pending"
Date and time the resource was created
Example:
"2020-01-01T12:15:00.000Z"
Date and time the resource was last updated
Example:
"2020-01-01T12:15:00.000Z"
Was this page helpful?