-
Notifications
You must be signed in to change notification settings - Fork 0
/
05c1fd14.a948ccbd.js
1 lines (1 loc) · 69.4 KB
/
05c1fd14.a948ccbd.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{103:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return l})),t.d(n,"metadata",(function(){return s})),t.d(n,"rightToc",(function(){return b})),t.d(n,"default",(function(){return d}));var a=t(2),o=t(6),r=(t(0),t(250)),c=t(257),i=t(258),l={id:"endpoints",title:"Endpoints",hide_title:!0,sidebar_label:"Endpoints"},s={id:"AberturadeContas/endpoints",isDocsHomePage:!1,title:"Endpoints",description:"Endpoints",source:"@site/docs\\AberturadeContas\\endpoints.md",permalink:"/documentation/docs/AberturadeContas/endpoints",sidebar_label:"Endpoints",sidebar:"someSidebar",previous:{title:"Introduction",permalink:"/documentation/docs/AberturadeContas/Introduction"},next:{title:"Introduction",permalink:"/documentation/docs/openFinance/Introduction"}},b=[{value:"Video Tutorial Gerencianet Openning Account API",id:"video-tutorial-gerencianet-openning-account-api",children:[]},{value:"Base routes",id:"base-routes",children:[]},{value:"Get authorization",id:"get-authorization",children:[{value:"Examples of authorization using the certificate. P12",id:"examples-of-authorization-using-the-certificate-p12",children:[]}]},{value:"Simplified Registration",id:"simplified-registration",children:[{value:"Request to open a simplified account",id:"request-to-open-a-simplified-account",children:[]},{value:"Get credentials from simplified account",id:"get-credentials-from-simplified-account",children:[]},{value:"Get certificate from simplified account",id:"get-certificate-from-simplified-account",children:[]}]},{value:"Webhook",id:"webhook",children:[{value:"Understanding the mTLS pattern",id:"understanding-the-mtls-pattern",children:[]},{value:"Examples of server settings",id:"examples-of-server-settings",children:[]},{value:"Setting the Webhook",id:"setting-the-webhook",children:[]},{value:"Detail Webhook",id:"detail-webhook",children:[]},{value:"Cancel Webhook",id:"cancel-webhook",children:[]},{value:"Get list of Webhooks",id:"get-list-of-webhooks",children:[]}]}],u={rightToc:b};function d(e){var n=e.components,t=Object(o.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},u,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)("h1",{className:"titulo"},"Endpoints"),Object(r.b)("div",{className:"subtitulo"},Object(r.b)("p",null,"Information about all endpoints available in the Gerencianet Account Opening API."),Object(r.b)("p",null,"On this page you will find all available endpoints of the Gerencianet Payment API. We recommend that you join our community in Discord to keep up with api developments, including the release of new endpoints."),Object(r.b)("p",null,"Use the summary below to quickly navigate between api endpoint groups."),Object(r.b)("h3",{id:"video-tutorial-gerencianet-openning-account-api"},"Video Tutorial Gerencianet Openning Account API"),Object(r.b)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/watch?v=uW78tu1xnSQ",title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:!0}),Object(r.b)("h2",{id:"base-routes"},"Base routes"),Object(r.b)("p",null,"Base route or base URL's for environments, use the route below to communicate your application with the production environment offered by Gerencianet."),Object(r.b)(c.a,{defaultValue:"production",values:[{label:"Production",value:"production"}],mdxType:"Tabs"},Object(r.b)(i.a,{value:"production",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),' "URL": {\n "Production": "https://apis.gerencianet.com.br/"\n }\n')))),Object(r.b)("h2",{id:"get-authorization"},"Get authorization"),Object(r.b)("div",{class:"gn-endpoint"},Object(r.b)("span",{class:"http-method post"},"POST"),Object(r.b)("span",{class:"endpoint"},"/oauth/token")),Object(r.b)("br",null),Object(r.b)("p",null,"This endpoint is used to authorize an application's credentials and get the scopes that the application has to access the other API endpoints. The P12/PEM certificate must be present in the authorization request for the handshake with the API server to be allowed."),Object(r.b)("h3",{id:"examples-of-authorization-using-the-certificate-p12"},"Examples of authorization using the certificate. P12"),Object(r.b)("p",null,"To use the Gerencianet Payment API, the client and server must communicate on a verified connection to each other. Verification is done by the two-way certificate (.PEM or .P12), that is, the server and client have implemented a private key certificate and a public key certificate that allows one to ensure the identity of the other."),Object(r.b)("p",null,"Therefore to make any HTTP request to the Openning account API, including the authorization request with OAuth2, it is necessary the certificate .P12, or .pem, in the request headers."),Object(r.b)("p",null,"Below are examples of how to consume the Authorization of the Gerencianet Openning account API by incorporating this certificate into the request."),Object(r.b)(c.a,{defaultValue:"php",values:[{label:"php",value:"php"},{label:"Node",value:"Node"},{label:"Python",value:"Python"},{label:"C#",value:"C#"},{label:"Ruby",value:"Ruby"},{label:"Java",value:"Java"},{label:"Go",value:"Go"}],mdxType:"Tabs"},Object(r.b)(i.a,{value:"php",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),'<?php //Desenvolvido pela Consultoria T\xe9cnica da Gerencianet\n\n$config = [\n "certificado" => "./certificado.pem",\n "client_id" => "YOUR-CLIENT-ID",\n "client_secret" => "YOUR-CLIENT-SECRET"\n];\n$autorizacao = base64_encode($config["client_id"] . ":" . $config["client_secret"]);\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n CURLOPT_URL => "https://apis.gerencianet.com.br/oauth/token", // Rota base, homologa\xe7\xe3o ou produ\xe7\xe3o\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => "",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => "POST",\n CURLOPT_POSTFIELDS => \'{"grant_type": "client_credentials"}\',\n CURLOPT_SSLCERT => $config["certificado"], // Caminho do certificado\n CURLOPT_SSLCERTPASSWD => "",\n CURLOPT_HTTPHEADER => array(\n "Authorization: Basic $autorizacao",\n "Content-Type: application/json"\n ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\n\necho "<pre>";\necho $response;\necho "</pre>";\n'))),Object(r.b)(i.a,{value:"Node",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-js"}),'//Desenvolvido pela Consultoria T\xe9cnica da Gerencianet\n\n"use strict";\nconst https = require("https");\nvar axios = require("axios");\nvar fs = require("fs");\n\n//Insira o caminho de seu certificado .p12 dentro de seu projeto\nvar certificado = fs.readFileSync("./certificado.p12");\n\n//Insira os valores de suas credenciais em desenvolvimento do pix\nvar credenciais = {\n client_id: "YOUR-CLIENT-ID",\n client_secret: "YOUR-CLIENT-SECRET",\n};\n\nvar data = JSON.stringify({ grant_type: "client_credentials" });\nvar data_credentials = credenciais.client_id + ":" + credenciais.client_secret;\n\n// Codificando as credenciais em base64\nvar auth = Buffer.from(data_credentials).toString("base64");\n\nconst agent = new https.Agent({\n pfx: certificado,\n passphrase: "",\n});\n//Consumo em desenvolvimento da rota post oauth/token\nvar config = {\n method: "POST",\n url: "https://apis.gerencianet.com.br/oauth/token",\n headers: {\n Authorization: "Basic " + auth,\n "Content-Type": "application/json",\n },\n httpsAgent: agent,\n data: data,\n};\n\naxios(config)\n .then(function (response) {\n console.log(JSON.stringify(response.data));\n })\n .catch(function (error) {\n console.log(error);\n });\n'))),Object(r.b)(i.a,{value:"Python",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-py"}),'#Desenvolvido pela Consultoria T\xe9cnica da Gerencianet\n\nimport requests\nimport base64\n\ncredentials = {\n "client_id": "YOUR-CLIENT-ID",\n "client_secret": "YOUR-CLIENT-SECRET",\n}\n\ncertificado = \'./certificado.pem\' # A vari\xe1vel certificado \xe9 o diret\xf3rio em que seu certificado em formato .pem deve ser inserido\n\nauth = base64.b64encode(\n (f"{credentials[\'client_id\']}:{credentials[\'client_secret\']}"\n ).encode()).decode()\n\nurl = "https://apis.gerencianet.com.br/oauth/token" #Para ambiente de Desenvolvimento\n\npayload="{\\r\\n \\"grant_type\\": \\"client_credentials\\"\\r\\n}"\nheaders = {\n \'Authorization\': f"Basic {auth}",\n \'Content-Type\': \'application/json\'\n}\n\nresponse = requests.request("POST",\n url,\n headers=headers,\n data=payload,\n cert=certificado)\n\nprint(response.text)\n'))),Object(r.b)(i.a,{value:"C#",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-js"}),'//Desenvolvido pela Consultoria T\xe9cnica da Gerencianet\n\nusing System;\nusing System.Security.Cryptography.X509Certificates;\nusing System.Collections.Generic;\nusing RestSharp;\n\nnamespace PixGerencianet\n{\n class Authorize\n {\n public static string Base64Encode(string plainText)\n {\n var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText);\n return System.Convert.ToBase64String(plainTextBytes);\n }\n\n static void Main(string[] args)\n {\n\n var credencials = new Dictionary<string, string>{\n {"client_id", "YOUR-CLIENT-ID"},\n {"client_secret", "YOUR-CLIENT-SECRET"}\n };\n var authorization = Base64Encode(credencials["client_id"] + ":" + credencials["client_secret"]);\n var client = new RestSharp.RestClient("https://apis.gerencianet.com.br/oauth/token");\n var request = new RestRequest(Method.POST);\n\n X509Certificate2 uidCert = new X509Certificate2("./certificado.p12", "");\n client.ClientCertificates = new X509CertificateCollection() { uidCert };\n\n request.AddHeader("Authorization", "Basic " + authorization);\n request.AddHeader("Content-Type", "application/json");\n request.AddParameter("application/json", "{\\r\\n \\"grant_type\\": \\"client_credentials\\"\\r\\n}", ParameterType.RequestBody);\n \n IRestResponse restResponse = client.Execute(request);\n string response = restResponse.Content;\n\n Console.WriteLine(response);\n }\n }\n}\n'))),Object(r.b)(i.a,{value:"Ruby",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-js"}),'#Desenvolvido pela Consultoria T\xe9cnica da Gerencianet\n\nrequire "uri"\nrequire "net/http"\nrequire "openssl"\n\nclient_id = "YOUR-CLIENT-ID";\nclient_secret = "YOUR-CLIENT-SECRET";\n\ncertfile = File.read("certificado.pem") # A vari\xe1vel certfile \xe9 o diret\xf3rio em que seu certificado em formato .pem deve ser inserido\n\nurl = URI("https://apis.gerencianet.com.br/oauth/token") #Para ambiente de Desenvolvimento\n\nhttps = Net::HTTP.new(url.host, url.port);\nhttps.use_ssl = true\nhttps.cert = OpenSSL::X509::Certificate.new(certfile)\nhttps.key = OpenSSL::PKey::RSA.new(certfile)\n\nrequest = Net::HTTP::Post.new(url)\nrequest.basic_auth(client_id, client_secret)\nrequest["Content-Type"] = "application/json"\nrequest.body = "{\\r\\n \\"grant_type\\": \\"client_credentials\\"\\r\\n}"\n\nresponse = https.request(request)\nputs response.read_body\n'))),Object(r.b)(i.a,{value:"Java",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-java"}),'//Desenvolvido pela Consultoria T\xe9cnica da Gerencianet\n\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.OutputStream;\nimport java.net.URL;\nimport java.util.Base64;\n\nimport javax.net.ssl.HttpsURLConnection;\nimport javax.net.ssl.SSLSocketFactory;\n\npublic class Auth {\n public static void main(String[] args) throws Exception {\n String client_id = "YOUR-CLIENT-ID";\n String client_secret = "YOUR-CLIENT-SECRET";;\n String basicAuth = Base64.getEncoder().encodeToString(((client_id+\':\'+client_secret).getBytes()));\n \n //Diret\xf3rio em que seu certificado em formato .p12 deve ser inserido\n System.setProperty("javax.net.ssl.keyStore", "certificado.p12"); \n SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();\n \n URL url = new URL ("https://apis.gerencianet.com.br/oauth/token"); //Para ambiente de Desenvolvimento \n HttpsURLConnection conn = (HttpsURLConnection)url.openConnection();\n conn.setDoOutput(true);\n conn.setRequestMethod("POST");\n conn.setRequestProperty("Content-Type", "application/json");\n conn.setRequestProperty("Authorization", "Basic "+ basicAuth);\n conn.setSSLSocketFactory(sslsocketfactory);\n String input = "{\\"grant_type\\": \\"client_credentials\\"}";\n \n OutputStream os = conn.getOutputStream();\n os.write(input.getBytes());\n os.flush(); \n\n InputStreamReader reader = new InputStreamReader(conn.getInputStream());\n BufferedReader br = new BufferedReader(reader);\n\n String response;\n while ((response = br.readLine()) != null) {\n System.out.println(response);\n }\n conn.disconnect();\n\n }\n}\n'))),Object(r.b)(i.a,{value:"Go",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-go"}),'//Desenvolvido pela Consultoria T\xe9cnica da Gerencianet\npackage main\n\nimport (\n "fmt"\n "strings"\n "net/http"\n "io/ioutil"\n "crypto/tls"\n)\n\nconst(\n client_id = "YOUR-CLIENT-ID"\n client_secret = "YOUR-CLIENT-SECRET"\n)\n\nfunc main() {\n\n url := "https://apis.gerencianet.com.br/oauth/token"// Rota base, homologa\xe7\xe3o ou produ\xe7\xe3o\n method := "POST"\n\n payload := strings.NewReader(`{"grant_type": "client_credentials"}`)\n\n\n cert, _ := tls.LoadX509KeyPair("CA.crt.pem", "KEY.crt.pem")// Seu certificado e chave privada gerada a partir dos comandos de convers\xe3o OpenSSL\n\n client := &http.Client{\n Transport: &http.Transport{\n TLSClientConfig: &tls.Config{\n Certificates: []tls.Certificate{cert},\n },\n },\n}\n\n req, err := http.NewRequest(method, url, payload)\n\n if err != nil {\n fmt.Println(err)\n return\n }\n req.SetBasicAuth(client_id, client_secret)\n req.Header.Add("Content-Type", "application/json")\n\n res, err := client.Do(req)\n if err != nil {\n fmt.Println(err)\n return\n }\n defer res.Body.Close()\n\n body, err := ioutil.ReadAll(res.Body)\n if err != nil {\n fmt.Println(err)\n return\n }\n fmt.Println(string(body))\n}\n')))),Object(r.b)("br",null),Object(r.b)("b",null,"Authorization example of response"),Object(r.b)("br",null),"The code snippet below represents an example of OAuth's response to your authorization request.",Object(r.b)(c.a,{defaultValue:"response",values:[{label:"Response",value:"response"}],mdxType:"Tabs"},Object(r.b)(i.a,{value:"response",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",\n "token_type": "Bearer",\n "expires_in": 3600,\n "scope": "gn.barcode.read gn.barcode.pay.write gn.barcode.pay.read"\n}\n')))),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("h2",{id:"simplified-registration"},"Simplified Registration"),Object(r.b)("h3",{id:"request-to-open-a-simplified-account"},"Request to open a simplified account"),Object(r.b)("div",{class:"gn-endpoint"},Object(r.b)("span",{class:"http-method post"},"POST"),Object(r.b)("span",{class:"endpoint"},"/cadastro/conta-simplificada")),Object(r.b)("br",null),"Requests simplified account opening for integration. The input data refers to the final customer. If the input data is valid, the customer will receive a link in which they can authorize integration with a Gerencianet account.",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("b",null,"Requires authorization for the scope: ",Object(r.b)("code",null,"gn.registration.write")),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"Creating account/ application")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"If your end customer already has a Gerenciant account, two options will appear for him:"),Object(r.b)("ul",{parentName:"div"},Object(r.b)("li",{parentName:"ul"},"Create an application in the current account, where you will have access to the credentials and define the scopes."),Object(r.b)("li",{parentName:"ul"},"Create a secondary account for the end customer with the settings/access defined in the request.")))),Object(r.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"Refusing the account oppening")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"If your customer refuses the account opening process, you will have to wait 2 business days before starting a new process.\nNote: The information is not returned if the customer denies the opening process."))),Object(r.b)("b",null,"Request"),Object(r.b)(c.a,{defaultValue:"customer1",values:[{label:"Natural Person data ",value:"customer1"},{label:"Juridical Person data",value:"customer2"}],mdxType:"Tabs"},Object(r.b)(i.a,{value:"customer1",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "clienteFinal": {\n "cpf": "12345678900",\n "nomeCompleto": "Nome Exemplo",\n "dataNascimento": "13/08/2000",\n "nomeMae": "Exemplo de nome da m\xe3e",\n "celular": "31987654321",\n "email": "[email protected]",\n "endereco": {\n "cep": "35400000",\n "estado": "MG",\n "cidade": "Ouro Preto",\n "bairro": "Bairro exemplo",\n "logradouro": "Exemplo do nome da rua",\n "numero": "777",\n "complemento": "apto 101"\n }\n },\n "meioDeNotificacao": [\n "sms",\n "whatsapp"\n ],\n "escoposIntegrados": [\n "charge.write",\n "pix.send"\n ]\n}\n'))),Object(r.b)(i.a,{value:"customer2",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "clienteFinal": {\n "cpf": "12345678900",\n "nomeCompleto": "Nome Exemplo",\n "dataNascimento": "13/08/2000",\n "nomeMae": "Exemplo de nome da m\xe3e",\n "celular": "31987654321",\n "email": "[email protected]",\n "cnpj": "12345678901000",\n "razaoSocial": "Ongan Com\xe9rcio LTDA",\n "endereco": {\n "cep": "35400000",\n "estado": "MG",\n "cidade": "Ouro Preto",\n "bairro": "Bairro exemplo",\n "logradouro": "Exemplo do nome da rua",\n "numero": "777",\n "complemento": "apto 101"\n }\n },\n "meioDeNotificacao": [\n "whatsapp"\n ],\n "escoposIntegrados": [\n "pix.write",\n "pix.read",\n "pix.send"\n ]\n}\n')))),Object(r.b)("p",null,"Data that can be used in the simplified account opening request. ",Object(r.b)("br",null),"\n(*) Mandatory attributes"),Object(r.b)("table",null,Object(r.b)("tbody",null,Object(r.b)("tr",null,Object(r.b)("th",null,"Attribute"),Object(r.b)("th",{align:"center"},"Description"),Object(r.b)("th",{align:"center"},"Mandatory"),Object(r.b)("th",{align:"center"},"Type")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"clienteFinal")),Object(r.b)("td",{align:"left"},"The fields in the final customer identification organize informations about the final customer data for which the account will be generated. ",Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("em",null,"clienteFinal:"),Object(r.b)("br",null),Object(r.b)("code",null,"cpf*"),"// Natural Person's CPF. (String) ",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"nomeCompleto*"),"// Final customer's full name, natural person. (String) ",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"dataNascimento*"),"// Final customer born date. (String in the format: ",Object(r.b)("code",null,"DD/MM/YYYY"),") ",Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"nomeMae*"),"// Final customer mother's name, natural person. (String) ",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"celular*"),"// Final customer's phone number. (String) ",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"email*"),"// Final customer's email. (String) ",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"cnpj*"),"// Juridical Person's CNPJ (String) ",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"razaoSocial*"),"// Final customer's social name, juridical person. (String) ",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"endereco*"),"// Final customer's address. (Object) ",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"cep*"),"// Final customer's zipcode (CEP), natural person. (String) ",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"estado*"),"// Final customer's state, natural person (String) ",Object(r.b)("br",null),Object(r.b)("br",null)," Values: ",Object(r.b)("br",null),Object(r.b)("code",null,"AC, AL, AP, AM, BA, CE, DF, ES, GO, MA, MT, MS, MG, PA, PB, PR, PE, PI, RJ, RN, RS, RO, RR, SC, SP, SE, TO ")," ",Object(r.b)("br",null)," ",Object(r.b)("br",null),Object(r.b)("code",null,"cidade*"),"// Final customer's city name, natural person. (String) ",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"bairro*"),"// Final customer's neighbourhood name. (Object) ",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"logradouro*"),"// Final customer's street name, natural person. (String) ",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"numero*"),"// Final customer's address number. (Object) ",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"complemento*"),"// Final customer's adress complement, natural person. (String) ",Object(r.b)("br",null),Object(r.b)("br",null)),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"center"},"String")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"meioDeNotificacao")),Object(r.b)("td",{align:"left"},"Determines where and which way will the final customer receive the notification to approve the process. ",Object(r.b)("br",null),Object(r.b)("br",null),"Values: ",Object(r.b)("code",null,"sms"),", ",Object(r.b)("code",null," whatsapp")),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"center"},"String")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"escoposIntegrados")),Object(r.b)("td",{align:"left"},"Scopes of services that the integrator wants to access in the final customer's account. It is not possible to request unconfigured service scopes for the requesting integrator's application. ",Object(r.b)("br",null),Object(r.b)("br",null)," Values: ",Object(r.b)("br",null),Object(r.b)("code",null,"charge.write, cob.write, payloadlocation.write, payloadlocation.read, "),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"cob.read, pix.write, pix.read, pix.send, webhook.write, webhook.read, "),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"gn.balance.read, gn.pix.evp.write, gn.pix.evp.read, gn.settings.write, "),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"gn.settings.read, gn.barcode.read, gn.barcode.pay.write,gn.barcode.pay.read")),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"center"},"String")))),Object(r.b)("b",null,"Responses"),Object(r.b)("br",null),"The answers below represent Success(200) and Failures/Errors of consumption.",Object(r.b)(c.a,{defaultValue:"200",values:[{label:"200(Success)",value:"200"},{label:"400(Bad Request)",value:"400"},{label:"401(Unauthorized)",value:"401"},{label:"403(Forbidden)",value:"403"},{label:"409(Conflict)",value:"409"},{label:"412(Precondition Failed)",value:"412"},{label:"500(Error)",value:"500"}],mdxType:"Tabs"},Object(r.b)(i.a,{value:"200",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "contaSimplificada": {\n "identificador": "92ccd29b-54c9-49fc-b8e8-717a3b373c5e"\n }\n}\n'))),Object(r.b)(i.a,{value:"400",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'Invalid CPF\n{\n "nome": "cpf_invalido",\n "mensagem": "O CPF \xe9 inv\xe1lido."\n}\n\nOr\n\nInvalid full name (doesn\'t match the document - CPF)\n{\n "nome": "nome_completo_invalido",\n "mensagem": "O nome completo n\xe3o corresponde ao CPF do cliente final."\n}\n\nOr\n\nUnderage\n\n{\n "nome": "menoridade",\n "mensagem": "O cliente final \xe9 menor de idade."\n}\n\nOr\n\nInvalid born date\n{\n "nome": "data_nascimento_invalida",\n "mensagem": "A data de nascimento n\xe3o corresponde ao CPF do cliente final."\n}\n\nOr\n\nInvalid mother\'s name\n{\n "nome": "nome_mae_invalido",\n "mensagem": "O nome da m\xe3e n\xe3o corresponde ao CPF do cliente final."\n}\n\nOr\n\nInvalid phone number\n{\n "nome": "celular_invalido",\n "mensagem": "O celular \xe9 inv\xe1lido."\n}\n\nOr\n\nInvalid email\n{\n "nome": "email_invalido",\n "mensagem": "O email \xe9 inv\xe1lido."\n}\n\nOr\n\nInvalid ZIP code\n{\n "nome": "cep_invalido",\n "mensagem": "O CEP \xe9 inv\xe1lido."\n}\n\nOr\n\nInvalid CNPJ\n{\n "nome": "cnpj_invalido",\n "mensagem": "O CNPJ \xe9 inv\xe1lido."\n}\n\nOr\n\nInvalid social name\n{\n "nome": "razao_social_invalida",\n "mensagem": "A raz\xe3o social n\xe3o corresponde ao CNPJ do cliente final."\n}\n\nOr\n\nInvalid full name\n{\n "nome": "nomeCompleto_invalido",\n "mensagem": "ClienteFinal deve ter a propriedade obrigat\xf3ria nomeCompleto."\n}\n\nOr\n\nInactive CPF \n{\n "nome": "cpf_inativo",\n "mensagem": "O CPF est\xe1 em situa\xe7\xe3o cadastral inativa."\n}\n\nOr\n\nInactive CNPJ\n{\n "nome": "cnpj_inativo",\n "mensagem": "O CNPJ est\xe1 em situa\xe7\xe3o cadastral inativa."\n}\n'))),Object(r.b)(i.a,{value:"401",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"This error occurs in the following situations:\n\n* Certificate or credentials do not exist;\n* Certificate or credentials are disabled;\n* Certificate and credentials are not linked to the same Gerencianet account;\n* Integrator does not have permission for the scope needed to consume this endpoint.\n"))),Object(r.b)(i.a,{value:"403",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"This error occurs in the following situations:\n\n* Integrator requests access to a scope to which it does not have permission.\n"))),Object(r.b)(i.a,{value:"409",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'Phone number already registered\n{\n "nome": "celular_cadastrado",\n "mensagem": "O celular \xe9 utilizado por outro cliente."\n}\n\nOr\n\nEmail already registered\n\n{\n "nome": "email_cadastrado",\n "mensagem": "O email \xe9 utilizado por outro cliente."\n}\n\nOr\n\nOppenning account request already sent for this customer\n{\n "nome": "solicitacao_duplicada",\n "mensagem": "J\xe1 existe uma solicita\xe7\xe3o de abertura de conta aberta para este cliente final."\n}\n'))),Object(r.b)(i.a,{value:"412",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'Precondition Failed. This error occurs in the following situations:\n\n* Integrator must have at least one registered Webhook.\n{\n "nome": "webhook_nao_cadastrado",\n "mensagem": "Sua conta n\xe3o possui webhook cadastrado na API de Cadastro."\n}\n'))),Object(r.b)(i.a,{value:"500",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'Aplication error\n\n{\n "nome": "erro_aplicacao",\n "mensagem": "Ocorreu um erro na aplica\xe7\xe3o."\n}\n')))),Object(r.b)("h3",{id:"get-credentials-from-simplified-account"},"Get credentials from simplified account"),Object(r.b)("div",{class:"gn-endpoint"},Object(r.b)("span",{class:"http-method get"},"GET"),Object(r.b)("span",{class:"endpoint"},"/cadastro/conta-simplificada/",Object(r.b)("span",{class:"variable"},":identificador"),"/credenciais")),Object(r.b)("br",null),"Endpoint to get the ",Object(r.b)("code",null,"Client_id")," and ",Object(r.b)("code",null,"Client_Secret")," to integrate with a simplified account.",Object(r.b)("br",null),Object(r.b)("b",null,"Requires authorization for the scope: ",Object(r.b)("code",null,"gn.registration.read")),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("b",null,"Request"),Object(r.b)("table",null,Object(r.b)("tbody",null,Object(r.b)("tr",null,Object(r.b)("th",null,"Attribute"),Object(r.b)("th",{align:"center"},"Description"),Object(r.b)("th",{align:"center"},"Mandatory"),Object(r.b)("th",{align:"center"},"Type")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("b",null,"identificador")),Object(r.b)("td",{align:"left"}," Generated simplified account's identifier"),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"center"},"String")))),Object(r.b)("b",null,"Responses"),Object(r.b)("p",null,"The responses below represent Success(200) and Consumption failures/errors."),Object(r.b)(c.a,{defaultValue:"200",values:[{label:"200(Success)",value:"200"},{label:"401(Unauthorized)",value:"401"},{label:"403(Forbidden)",value:"403"},{label:"412(Precondition Failed)",value:"412"},{label:"500(Error)",value:"500"}],mdxType:"Tabs"},Object(r.b)(i.a,{value:"200",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "clientId": "92ccd29b-54c9-49fc-b8e8-717a3b373c5e",\n "clientSecret": "b2e9dcca-c46d-4b9b-89d2-c625949bea40",\n "conta": {\n "numero": "10000"\n },\n "escopos": [\n "pix.send",\n "cob.write",\n "webhook.read"\n ],\n "ativo": true\n}\n'))),Object(r.b)(i.a,{value:"401",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"This error occurs in the following situations:\n\n* Certificate or credentials do not exist;\n* Certificate or credentials are disabled;\n* Certificate and credentials are not linked to the same Gerencianet account;\n* Integrator does not have permission for the scope needed to consume this endpoint.\n"))),Object(r.b)(i.a,{value:"403",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"Integrator tries to get the credentials of a simplified account not created by him.\n"))),Object(r.b)(i.a,{value:"412",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"Precondition failed. This error occurs in the following situations:\n\n* The simplified account is not ready yet.\n* Simplified account credentials do not exist.\n"))),Object(r.b)(i.a,{value:"500",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'Application error\n{\n "nome": "erro_aplicacao",\n "mensagem": "Ocorreu um erro na aplica\xe7\xe3o."\n}\n')))),Object(r.b)("h3",{id:"get-certificate-from-simplified-account"},"Get certificate from simplified account"),Object(r.b)("div",{class:"gn-endpoint"},Object(r.b)("span",{class:"http-method get"},"GET"),Object(r.b)("span",{class:"endpoint"},"/cadastro/conta-simplificada/",Object(r.b)("span",{class:"variable"},":identificador"),"/certificado")),Object(r.b)("br",null),"Endpoint to get the certificate to integrate with a simplified account.",Object(r.b)("br",null),Object(r.b)("b",null,"Requires authorization for the scope: ",Object(r.b)("code",null,"gn.registration.read")),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("b",null,"Request"),Object(r.b)("table",null,Object(r.b)("tbody",null,Object(r.b)("tr",null,Object(r.b)("th",null,"Attribute"),Object(r.b)("th",{align:"center"},"Description"),Object(r.b)("th",{align:"center"},"Mandatory"),Object(r.b)("th",{align:"center"},"Type")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("b",null,"identificadorWebhook")),Object(r.b)("td",{align:"left"}," Generated simplified account's identifier."),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"center"},"String")))),Object(r.b)("b",null,"Responses"),Object(r.b)("p",null,"The responses below represent Success(200) and Consumption failures/errors."),Object(r.b)(c.a,{defaultValue:"200",values:[{label:"200(Success)",value:"200"},{label:"401(Unauthorized)",value:"401"},{label:"403(Forbidden)",value:"403"},{label:"412(Precondition Failed)",value:"412"},{label:"500(Error)",value:"500"}],mdxType:"Tabs"},Object(r.b)(i.a,{value:"200",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "clientId": "92ccd29b-54c9-49fc-b8e8-717a3b373c5e",\n "clientSecret": "b2e9dcca-c46d-4b9b-89d2-c625949bea40",\n "conta": {\n "numero": "10000"\n },\n "escopos": [\n "pix.send",\n "cob.write",\n "webhook.read"\n ],\n "ativo": true\n}\n'))),Object(r.b)(i.a,{value:"401",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"This error occurs in the following situations:\n\n* Certificate or credentials do not exist;\n* Certificate or credentials are disabled;\n* Certificate and credentials are not linked to the same Gerencianet account;\n* Integrator does not have permission for the scope needed to consume this endpoint.\n"))),Object(r.b)(i.a,{value:"403",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"Integrator tries to get the credentials of a simplified account not created by him.\n"))),Object(r.b)(i.a,{value:"412",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"Precondition failed. This error occurs in the following situations:\n\n* The simplified account is not ready yet.\n* Simplified account credentials do not exist.\n"))),Object(r.b)(i.a,{value:"500",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'Application error\n{\n "nome": "erro_aplicacao",\n "mensagem": "Ocorreu um erro na aplica\xe7\xe3o."\n}\n')))),Object(r.b)("h2",{id:"webhook"},"Webhook"),Object(r.b)("p",null,"It brings together endpoints for managing notifications to the integrator."),Object(r.b)("h3",{id:"understanding-the-mtls-pattern"},"Understanding the mTLS pattern"),Object(r.b)("p",null,"As a rule by the Central Bank, it will be necessary to insert a Gerencianet public key on its server so that the communication complies with the mTLS pattern. In your domain that represents your server, a configuration must be made to require the public key (mTLS) that we are providing for mutual authentication to occur."),Object(r.b)("p",null,"Gerencianet will make 2 requests for your domain (server):"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"First Request: Let's make sure your server is demanding a public key from Gerencianet. This will be done when sending a request without a certificate and your server should not accept the request. Once answered with the refusal, the 2nd request will be sent."),Object(r.b)("li",{parentName:"ol"},'Second Request: We will send the notification together with our public key, your server, which must contain the public key available, must perform the "Hand-Shake" and thus the communication will be established.')),Object(r.b)("p",null,"Your server must have the minimum version of TLS 1.2. You can check about your TLS ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://www.ssllabs.com/ssltest/"}),"here")),Object(r.b)("p",null,"On your server you must configure a 'POST' route with a default response as a string \"200\". Our production certificate or homologation must be inserted in your server, below we have some examples."),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"Dedicated Servers")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"It is recommended that you have a dedicated server to be able to configure the webhook, since it is necessary to have access to some files to perform the configurations as in the examples below."))),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"Shared hosting")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"For hosting on shared servers, there may be restrictions regarding the insertion of certificates generated by another entity, such as our CA for example. If you have problems, we advise you to ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://sistema.gerencianet.com.br/tickets/criar"}),"opening a ticket")," with the subject: ",Object(r.b)("strong",{parentName:"p"},"mTLS on shared hosting")," or contact us through ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://discord.com/invite/ptGHMtczcV"}),"our channel #api-pix no Discord"),". We will analyze the situation so that we can act together to help you."))),Object(r.b)("br",null),Object(r.b)("h3",{id:"examples-of-server-settings"},"Examples of server settings"),Object(r.b)("p",null,"To configure your server, you will need the Gerencianet public keys. Below are the key addresses for the Production and Homologation environments. These keys must be downloaded and placed on your server."),Object(r.b)("table",null,Object(r.b)("tbody",null,Object(r.b)("tr",null,Object(r.b)("th",{align:"center"},"Attribute"),Object(r.b)("th",{align:"center"},"Description")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("b",null,"Production")),Object(r.b)("td",{align:"left"},Object(r.b)("code",null,"https://pix.gerencianet.com.br/webhooks/chain-pix-prod.crt"))),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("b",null,"Homologation")),Object(r.b)("td",{align:"left"},Object(r.b)("code",null,"https://pix.gerencianet.com.br/webhooks/chain-pix-sandbox.crt"))))),Object(r.b)("p",null,"The code snippets below seek to exemplify the necessary settings on your server so that it is possible to perform the ",Object(r.b)("em",{parentName:"p"},"hand-shake")," with our servers."),Object(r.b)(c.a,{defaultValue:"saida",values:[{label:"Python",value:"saida"},{label:"Nginx",value:"nginx"},{label:"Node",value:"node"},{label:"Apache",value:"apache"},{label:"PHP",value:"php"}],mdxType:"Tabs"},Object(r.b)(i.a,{value:"saida",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-python"}),'from flask import Flask, jsonify\nimport ssl\nimport json\napp = Flask(__name__)\n\n\[email protected]("/")\ndef hello():\n return "<h1 style=\'color:blue\'>Hello There!</h1>"\n\n\[email protected]("/", methods=["PUT"])\ndef hello_put():\n response = {"status": 200}\n return jsonify(response)\n\n\[email protected]("/", methods=["POST"])\ndef imprimir():\n imprime = print(request.json)\n data = request.json\n with open(\'data.txt\', \'a\') as outfile:\n outfile.write("\\n")\n json.dump(data, outfile)\n return jsonify(imprime)\n\ndef hello_post():\n response = {"status": 200}\n return jsonify(response)\n\nif __name__ == "__main__":\n context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)\n context.verify_mode = ssl.CERT_REQUIRED\n context.load_verify_locations(\'path-certificate/Gerencianet-public-cert.crt\')\n context.load_cert_chain(\n \'path-certificate/server_ssl.crt.pem\',\n \'path-certificate/server_ssl.key.pem\')\n app.run(ssl_context=context, host=\'0.0.0.0\')\n#Desenvolvido pela Consultoria T\xe9cnica da Gerencianet\n'))),Object(r.b)(i.a,{value:"nginx",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"server {\n #\n # ...\n #\n listen [::]:443 ssl ipv6only=on;\n listen 443 ssl;\n ssl_certificate server_ssl.crt.pem;\n ssl_certificate_key server_ssl.key.pem;\n ssl_client_certificate /root/chain-pix-webhooks-prod.crt;\n ssl_verify_client optional;\n ssl_verify_depth 3;\n #\n # ...\n #\n location /webhook {\n if ($ssl_client_verify != SUCCESS) {\n return 403;\n }\n rewrite ^(.*)$ /webhook;\n }\n}\n#Desenvolvido pela Consultoria T\xe9cnica da Gerencianet\n"))),Object(r.b)(i.a,{value:"node",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-js"}),'const express = require("express");\nconst fs = require("fs");\nconst https = require("https");\nvar logger = require(\'morgan\');\n\nconst httpsOptions = {\n cert: fs.readFileSync(""), // Certificado fullchain do dominio\n key: fs.readFileSync(""), // Chave privada do dom\xednio\n ca: fs.readFileSync(""), // Certificado p\xfablico da Gerencianet\n minVersion: "TLSv1.2",\n requestCert: true,\n rejectUnauthorized: false, //Mantenha como false para que os demais endpoints da API n\xe3o rejeitem requisi\xe7\xf5es sem MTLS\n};\n\nconst app = express();\nconst httpsServer = https.createServer(httpsOptions, app);\nconst PORT = 443;\n\napp.use(logger(\'dev\')); // Comente essa linha caso n\xe3o queira que seja exibido o log do servidor no seu console\napp.use(express.json());\napp.use(express.urlencoded({ extended: false }));\n\n// Endpoint para configura\xe7\xe3o do webhook, voc\xea precisa cadastrar https://SEUDOMINIO.com/webhook\napp.post("/webhook", (request, response) => {\n // Verifica se a requisi\xe7\xe3o que chegou nesse endpoint foi autorizada\n if (request.socket.authorized) { \n response.status(200).end();\n } else {\n response.status(401).end();\n }\n});\n\n// Endpoind para recep\xe7\xe3o do webhook tratando o /pix\napp.post("/webhook/pix", (request, response) => {\n if (request.socket.authorized){\n //Seu c\xf3digo tratando a callback\n /* EXEMPLO:\n var body = request.body;\n filePath = __dirname + "/data.json";\n fs.appendFile(filePath, JSON.stringify(body) + "\\n", function (err) {\n if (err) {\n console.log(err);\n } else {\n response.status(200).end();\n }\n })*/\n response.status(200).end();\n }else{\n response.status(401).end();\n }\n});\n\nhttpsServer.listen(PORT, () =>\n console.log(`Express server currently running on port ${PORT}`)\n);\n#Desenvolvido pela Consultoria T\xe9cnica da Gerencianet\n'))),Object(r.b)(i.a,{value:"apache",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'# ********************************************************************************* #\n# Utilize o primeiro exemplo, caso queira requerir o certificado para autentica\xe7\xe3o #\n# m\xfatua em qualquer rota do dom\xednio indicado no VirtualHost. #\n# Funciona bem para sub-dom\xednios. Exemplo: https://www.webhook.seu_dominio.com.br # \n# ********************************************************************************* #\n\n<IfModule mod_ssl.c>\n<VirtualHost *:443> # Porta HTTPS\n #\n # ...\n #\n\n SSLCertificateFile /caminho_certificado/fullchain_ssl.pem #fullchain associado ao seu certificado SSL do dom\xednio\n SSLCertificateKeyFile /caminho_certificado/privkey_ssl.pem #privkey associada ao seu certificado SSL do dom\xednio\n\n # mTLS Gerencianet\n SSLCACertificateFile /caminho_certificado/chain-pix-prod.crt #Chave p\xfablica da Gerencianet\n SSLVerifyClient require\n SSLVerifyDepth 3\n \n # Tratando o /pix, redirecionando as requisi\xe7\xf5es sempre para /webhook\n Alias "/pix/" "/var/www/webhook/index.php"\n Alias "/pix" "/var/www/webhook/index.php"\n\n #\n # ...\n #\n</VirtualHost>\n</IfModule>\n\n\n# ******************************************************************************** #\n# Utilize o segundo exemplo, caso queira requerir o certificado para autentica\xe7\xe3o #\n# m\xfatua em apenas uma rota do dom\xednio indicado no VirtualHost. #\n# Exemplo: https://www.seu_dominio.com.br/webhook/ # \n# ******************************************************************************** #\n\n<IfModule mod_ssl.c>\n<VirtualHost *:443> # Porta HTTPS\n #\n # ...\n #\n\n SSLCertificateFile /caminho_certificado/fullchain_ssl.pem #fullchain associado ao seu certificado SSL do dom\xednio\n SSLCertificateKeyFile /caminho_certificado/privkey_ssl.pem #privkey associada ao seu certificado SSL do dom\xednio\n\n # mTLS Gerencianet\n SSLCACertificateFile /caminho_certificado/chain-pix-prod.crt #Chave p\xfablica da Gerencianet\n SSLVerifyClient none\n SSLProtocol TLSv1.2\n \n <Location "/webhook">\n SSLVerifyClient require\n SSLVerifyDepth 3\n </Location>\n \n # Tratando o /pix, redirecionando as requisi\xe7\xf5es sempre para /webhook\n Alias "/webhook/pix/" "/var/www/webhook/index.php"\n Alias "/webhook/pix" "/var/www/webhook/index.php"\n\n #\n # ...\n #\n</VirtualHost>\n</IfModule>\n'))),Object(r.b)(i.a,{value:"php",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),"# ********************************************************************************** #\n# Para o funcionamento deste exemplo \xe9 necess\xe1rio que seu servidor tenha configurado #\n# o certificado do mTLS, com o direcionamento para este arquivo, e tamb\xe9m com a #\n# tratativa do /pix. Assim como \xe9 feito em nosso exemplo de servidores Apache. #\n# ********************************************************************************** #\n\n<?php\n\nfunction resposta($status, $mensagem, $dados)\n{\n $resposta['status'] = $status;\n $resposta['mensagem'] = $mensagem;\n $resposta['dados'] = $dados;\n $json_resposta = '<pre>' . json_encode($resposta, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . '</pre>';\n\n header(\"HTTP/1.1 \" . $status);\n echo $json_resposta;\n}\n\nfunction salvar($dados)\n{\n // Crie um arquivo .;json para salvar as informa\xe7\xf5es\n $nomeArquivo = './dados.json';\n $dadosGravados = json_decode(file_get_contents($nomeArquivo), true);\n $arquivo = fopen($nomeArquivo, 'w');\n\n // Incrementa as informa\xe7\xf5es enviadas com o que j\xe1 havia gravado\n array_push($dadosGravados, $dados);\n\n if (fwrite($arquivo, json_encode($dadosGravados))) {\n resposta(200, \"Requisi\xe7\xe3o realizada com sucesso!\", $dados);\n } else {\n resposta(300, \"Falha ao salvar os dados da requisi\xe7\xe3o.\", $dados);\n }\n\n fclose($arquivo);\n}\n\nfunction requisicao($metodo, $body, $parametros)\n{\n switch ($metodo) {\n case 'POST':\n salvar($body);\n break;\n case 'GET':\n resposta(200, \"Requisi\xe7\xe3o realizada com sucesso!\", $body);\n break;\n }\n}\n\n// Obt\xe9m o m\xe9todo HTTP, body e par\xe2metros da requisi\xe7\xe3o\n$metodo = $_SERVER['REQUEST_METHOD'];\n$parametros = explode('/', trim($_SERVER['REQUEST_URI'], '/'));\n$body = json_decode(file_get_contents('php://input'), true);\n\ntry {\n requisicao($metodo, $body, $parametros);\n} catch (Exception $e) {\n resposta(400, $e->getMessage(), $e);\n}\n")))),Object(r.b)("p",null,"To have a valid SSL, you must contact a Certificate Authority and generate a private key ",Object(r.b)("inlineCode",{parentName:"p"},"server_ssl.key.pem")," and a public key ",Object(r.b)("inlineCode",{parentName:"p"},"server_ssl.crt.pem"),", so you can validate the integrity of the connection. You can do this for free using a utility like ",Object(r.b)("a",{href:"https://certbot.eff.org/",target:"_blank"},"Certbot")," for example."),Object(r.b)("br",null),Object(r.b)("h3",{id:"setting-the-webhook"},"Setting the Webhook"),Object(r.b)("div",{class:"gn-endpoint"},Object(r.b)("span",{class:"http-method post"},"POST"),Object(r.b)("span",{class:"endpoint"},"/cadastro/webhook")),Object(r.b)("br",null),"Configures webhook for the Account Opening API.",Object(r.b)("br",null),Object(r.b)("b",null,"Requires authorization for scope: ",Object(r.b)("code",null,"gn.registration.webhook.write")),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("b",null,"Request"),Object(r.b)("br",null),"Data for webhook configuration.",Object(r.b)(c.a,{defaultValue:"add",values:[{label:"Add Webhook",value:"add"},{label:"Update Webhook",value:"update"}],mdxType:"Tabs"},Object(r.b)(i.a,{value:"add",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "webhookUrl": "https://gerencianet.com.br/meu-webhook"\n}\n'))),Object(r.b)(i.a,{value:"update",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "url": "https://gerencianet.com.br/meu-webhook",\n "chave": "92ecc0a8-9631-4601-a188-feacf8288c13"\n}\n')))),Object(r.b)("p",null,"(*) Mandatory attribute"),Object(r.b)("table",null,Object(r.b)("tbody",null,Object(r.b)("tr",null,Object(r.b)("th",null,"Attribute"),Object(r.b)("th",{align:"center"},"Description"),Object(r.b)("th",{align:"center"},"Mandatory"),Object(r.b)("th",{align:"center"},"Type")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("b",null,"webhookURL")),Object(r.b)("td",{align:"left"}," URL where the notification will be sent."),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"left"},"String. ",Object(r.b)("br",null)," Example: ",Object(r.b)("code",null,"https://gerencianet.com.br/meu-webhook")," ")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("b",null,"identificadorWebhook")),Object(r.b)("td",{align:"left"}," Webhook identifier key."),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"left"},"String.",Object(r.b)("br",null),"Example: 92ecc0a8-9631-4601-a188-feacf8288c13 ")))),Object(r.b)("b",null,"Responses"),Object(r.b)("br",null),"The responses below represent Success(200) and Failures/Errors of consumption.",Object(r.b)(c.a,{defaultValue:"200",values:[{label:"200(Success)",value:"200"},{label:"400(Bad request)",value:"400"},{label:"401(Unauthorized)",value:"401"},{label:"500(Error)",value:"500"}],mdxType:"Tabs"},Object(r.b)(i.a,{value:"200",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "identificadorWebhook": "92ecc0a8-9631-4601-a188-feacf8288c13"\n}\n'))),Object(r.b)(i.a,{value:"400",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'Invalid URL\n{\n "nome": "url_webhook",\n "mensagem": "A URL informada para webhook \xe9 inv\xe1lida."\n}\n\nOr\n\nInavlid Protocol\n{\n "nome": "protocolo_da_url",\n "mensagem": "A URL do webhook deve usar o protocolo HTTPS."\n}\n\nOr\n\nmTLS not configured\n\n{\n "nome": "mtls_nao_configurado",\n "mensagem": "A autentica\xe7\xe3o TLS m\xfatua n\xe3o est\xe1 configurada no URL fornecido."\n}\n\nOr\n\ninaccessible URL\n\n{\n "nome": "url_inacessivel",\n "mensagem": "A URL informada est\xe1 inacess\xedvel."\n}\n\nOr\n\nURL timeout\n\n{\n "nome": "limite_de_tempo_atingido_para_url",\n "mensagem": "A URL informada atingiu o tempo limite de resposta."\n}\n\nOr\n\nURL failed with error\n\n{\n "nome": "url_falhou_com_erro",\n "mensagem": "A requisi\xe7\xe3o na URL informada falhou com o erro."\n}\n\nOr\n\nNot a HTTPS protocol\n\n{\n "nome": "protocolo_da_url",\n "mensagem": "A URL do webhook deve usar o protocolo HTTPS."\n}\n\nOr\n\nURL responds HTTP\n\n{\n "nome": "erro_de_codigo",\n "mensagem": "A URL informada respondeu com o c\xf3digo HTTP."\n}\n\nOr\n\nURL doesn\'t respond\n\n{\n "nome": "url_informada_nao_existe",\n "mensagem": "N\xe3o foi poss\xedvel receber uma resposta da URL informada."\n}\n\nOr\n\nWebhook not found\n\n{\n "nome": "chave_invalida",\n "mensagem": "N\xe3o foi poss\xedvel encontrar um webhook com a chave informada."\n}\n\nOr\n\nURL already registered\n\n{\n "nome": "url_cadastrada",\n "mensagem": "A URL j\xe1 foi cadastrada."\n}\n'))),Object(r.b)(i.a,{value:"401",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"This error occurs in the following situation:\n\n* Integrator does not have permission for the scope needed to consume this endpoint.\n"))),Object(r.b)(i.a,{value:"500",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "nome": "erro_aplicacao",\n "mensagem": "Ocorreu um erro na aplica\xe7\xe3o."\n}\n')))),Object(r.b)("h3",{id:"detail-webhook"},"Detail Webhook"),Object(r.b)("div",{class:"gn-endpoint"},Object(r.b)("span",{class:"http-method get"},"GET"),Object(r.b)("span",{class:"endpoint"},"/cadastro/webhook/",Object(r.b)("span",{class:"variable"},":identificadorWebhook"))),"Get details about the configured webhook for the Account Openning API.",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("b",null,"Requires authorization for the scope: ",Object(r.b)("code",null,"gn.registration.webhook.read")),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("b",null,"Request"),Object(r.b)("br",null),"The request sent to this endpoint doesn't need a body, just the authorization header, OAuth, parameters and the account certificate.",Object(r.b)("table",null,Object(r.b)("tbody",null,Object(r.b)("tr",null,Object(r.b)("th",null,"Attribute"),Object(r.b)("th",{align:"center"},"Description"),Object(r.b)("th",{align:"center"},"Mandatory"),Object(r.b)("th",{align:"center"},"Type")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("b",null,"identificadorWebhook")),Object(r.b)("td",{align:"left"}," Pix key evp linked to the webhook"),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"left"},"String. ",Object(r.b)("br",null)," Example: 92ecc0a8-9631-4601-a188-feacf8288c13 ")))),Object(r.b)("b",null,"Responses"),Object(r.b)("br",null),"The responses below represent Success(200) and Failures/Errors of consumption.",Object(r.b)(c.a,{defaultValue:"200",values:[{label:"200(Success)",value:"200"},{label:"400(Bad request)",value:"400"},{label:"401(Unauthorized)",value:"401"},{label:"500(Error)",value:"500"}],mdxType:"Tabs"},Object(r.b)(i.a,{value:"200",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "webhookUrl": "https://gerencianet.com.br/meu-webhook",\n "identificadorWebhook": "92ecc0a8-9631-4601-a188-feacf8288c13",\n "criacao": "2021-10-26T11:23:35.000Z"\n}\n'))),Object(r.b)(i.a,{value:"400",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "nome": "identificador_webhook",\n "mensagem": "N\xe3o foi poss\xedvel encontrar um webhook com o identificador webhook informado."\n}\n'))),Object(r.b)(i.a,{value:"401",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"This error occurs in the following situation:\n\n* Integrator does not have permission for the scope needed to consume this endpoint.\n"))),Object(r.b)(i.a,{value:"500",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "nome": "erro_aplicacao",\n "mensagem": "Ocorreu um erro na aplica\xe7\xe3o."\n}\n')))),Object(r.b)("h3",{id:"cancel-webhook"},"Cancel Webhook"),Object(r.b)("div",{class:"gn-endpoint"},Object(r.b)("span",{class:"http-method delete"},"DELETE"),Object(r.b)("span",{class:"endpoint"},"/cadastro/webhook/",Object(r.b)("span",{class:"variable"},":identificadorWebhook"))),"Cancel/delete the configured webhook for the Account Openning API.",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("b",null,"Requires authorization for the scope: ",Object(r.b)("code",null,"gn.registration.webhook.write")),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("b",null,"Request"),Object(r.b)("br",null),"The request sent to this endpoint doesn't need a body, just the authorization header, OAuth, parameters and the account certificate.",Object(r.b)("table",null,Object(r.b)("tbody",null,Object(r.b)("tr",null,Object(r.b)("th",null,"Attribute"),Object(r.b)("th",{align:"center"},"Description"),Object(r.b)("th",{align:"center"},"Mandatory"),Object(r.b)("th",{align:"center"},"Type")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("b",null,"identificadorWebhook")),Object(r.b)("td",{align:"left"}," Pix key evp linked to the webhook."),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"left"},"String. ",Object(r.b)("br",null)," Example: 92ecc0a8-9631-4601-a188-feacf8288c13 ")))),Object(r.b)("b",null,"Responses"),Object(r.b)("br",null),"The responses below represent Success(200) and Failures/Errors of consumption.",Object(r.b)(c.a,{defaultValue:"200",values:[{label:"200(Success)",value:"200"},{label:"400(Bad request)",value:"400"},{label:"401(Unauthorized)",value:"401"},{label:"500(Error)",value:"500"}],mdxType:"Tabs"},Object(r.b)(i.a,{value:"200",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"No content \n* Webhook was cancelled.\n"))),Object(r.b)(i.a,{value:"400",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "nome": "identificador_webhook",\n "mensagem": "N\xe3o foi poss\xedvel encontrar um webhook com o identificador webhook informado."\n}\n'))),Object(r.b)(i.a,{value:"401",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"This error occurs in the following situation:\n\n* Integrator does not have permission for the scope needed to consume this endpoint.\n"))),Object(r.b)(i.a,{value:"500",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "nome": "erro_aplicacao",\n "mensagem": "Ocorreu um erro na aplica\xe7\xe3o."\n}\n')))),Object(r.b)("h3",{id:"get-list-of-webhooks"},"Get list of Webhooks"),Object(r.b)("div",{class:"gn-endpoint"},Object(r.b)("span",{class:"http-method get"},"GET"),Object(r.b)("span",{class:"endpoint"},"/cadastro/webhooks")),"Get the list of configured webhooks for the Account Openning API.",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("b",null,"Requires authorization for the scope: ",Object(r.b)("code",null,"gn.registration.webhook.read")),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("b",null,"Request"),Object(r.b)("br",null),"The request sent to this endpoint doesn't need a body, just the authorization header, OAuth, parameters and the account certificate.",Object(r.b)("table",null,Object(r.b)("tbody",null,Object(r.b)("tr",null,Object(r.b)("th",null,"Attribute"),Object(r.b)("th",{align:"center"},"Description"),Object(r.b)("th",{align:"center"},"Mandatory"),Object(r.b)("th",{align:"center"},"Type")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("b",null,"inicio")),Object(r.b)("td",{align:"left"}," Start date to the list."),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"left"},"string($datetime)",Object(r.b)("br",null),"Example :2020-04-01T00:00:00.000Z ")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("b",null,"fim")),Object(r.b)("td",{align:"left"}," Final date to the list."),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"left"},"string($datetime) ",Object(r.b)("br",null),"Example :2022-10-29T00:00:00.000Z ")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("b",null,"paginacao.paginaAtual")),Object(r.b)("td",{align:"left"},"Current page listed."),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"left"},"Integer. ",Object(r.b)("br",null),"Example : 0 ")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("b",null,"paginacao.itensPorPagina")),Object(r.b)("td",{align:"left"}," Quantity listed per page."),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"left"},"Integer. ",Object(r.b)("br",null),"Example : 10 ")))),Object(r.b)("b",null,"Responses"),Object(r.b)("br",null),"The responses below represent Success(200) and Failures/Errors of consumption.",Object(r.b)(c.a,{defaultValue:"200",values:[{label:"200(Success)",value:"200"},{label:"400(Bad request)",value:"400"},{label:"401(Unauthorized)",value:"401"},{label:"500(Error)",value:"500"}],mdxType:"Tabs"},Object(r.b)(i.a,{value:"200",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'Success\n{\n "parametros": {\n "inicio": "2020-04-01T00:00:00.000Z",\n "fim": "2020-04-01T23:59:59.000Z",\n "paginacao": {\n "paginaAtual": 0,\n "itensPorPagina": 100,\n "quantidadeDePaginas": 1,\n "quantidadeTotalDeItens": 1\n }\n },\n "webhooks": [\n {\n "webhookUrl": "https://gerencianet.com.br/meu-webhook",\n "identificadorWebhook": "92ecc0a8-9631-4601-a188-feacf8288c13",\n "criacao": "2021-10-26T11:23:35.000Z"\n }\n ]\n}\n'))),Object(r.b)(i.a,{value:"400",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "nome": "data_invalida",\n "mensagem": "Campo de data fim deve ser maior ou igual ao campo de data inicio."\n}\n'))),Object(r.b)(i.a,{value:"401",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"This error occurs in the following situation:\n\n* Integrator does not have permission for the scope needed to consume this endpoint.\n"))),Object(r.b)(i.a,{value:"500",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "nome": "erro_aplicacao",\n "mensagem": "Ocorreu um erro na aplica\xe7\xe3o."\n}\n'))))))}d.isMDXComponent=!0},250:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return m}));var a=t(0),o=t.n(a);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function i(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?c(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function l(e,n){if(null==e)return{};var t,a,o=function(e,n){if(null==e)return{};var t,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)t=r[a],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)t=r[a],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var s=o.a.createContext({}),b=function(e){var n=o.a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},u=function(e){var n=b(e.components);return o.a.createElement(s.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return o.a.createElement(o.a.Fragment,{},n)}},p=o.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,r=e.originalType,c=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=b(t),p=a,m=u["".concat(c,".").concat(p)]||u[p]||d[p]||r;return t?o.a.createElement(m,i(i({ref:n},s),{},{components:t})):o.a.createElement(m,i({ref:n},s))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var r=t.length,c=new Array(r);c[0]=p;var i={};for(var l in n)hasOwnProperty.call(n,l)&&(i[l]=n[l]);i.originalType=e,i.mdxType="string"==typeof e?e:a,c[1]=i;for(var s=2;s<r;s++)c[s]=t[s];return o.a.createElement.apply(null,c)}return o.a.createElement.apply(null,t)}p.displayName="MDXCreateElement"},254:function(e,n,t){"use strict";function a(e){var n,t,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;n<e.length;n++)e[n]&&(t=a(e[n]))&&(o&&(o+=" "),o+=t);else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}n.a=function(){for(var e,n,t=0,o="";t<arguments.length;)(e=arguments[t++])&&(n=a(e))&&(o&&(o+=" "),o+=n);return o}},255:function(e,n,t){"use strict";var a=t(0);const o=Object(a.createContext)({tabGroupChoices:{},setTabGroupChoices:()=>{},isAnnouncementBarClosed:!1,closeAnnouncementBar:()=>{}});n.a=o},256:function(e,n,t){"use strict";var a=t(0),o=t(255);n.a=function(){return Object(a.useContext)(o.a)}},257:function(e,n,t){"use strict";var a=t(0),o=t.n(a),r=t(256),c=t(254),i=t(92),l=t.n(i);const s=37,b=39;n.a=function(e){const{block:n,children:t,defaultValue:i,values:u,groupId:d}=e,{tabGroupChoices:p,setTabGroupChoices:m}=Object(r.a)(),[O,j]=Object(a.useState)(i);if(null!=d){const e=p[d];null!=e&&e!==O&&u.some(n=>n.value===e)&&j(e)}const h=e=>{j(e),null!=d&&m(d,e)},g=[];return o.a.createElement("div",null,o.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(c.a)("tabs",{"tabs--block":n})},u.map(({value:e,label:n})=>o.a.createElement("li",{role:"tab",tabIndex:"0","aria-selected":O===e,className:Object(c.a)("tabs__item",l.a.tabItem,{"tabs__item--active":O===e}),key:e,ref:e=>g.push(e),onKeyDown:e=>((e,n,t)=>{switch(t.keyCode){case b:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case s:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(g,e.target,e),onFocus:()=>h(e),onClick:()=>h(e)},n))),o.a.createElement("div",{role:"tabpanel",className:"margin-vert--md"},a.Children.toArray(t).filter(e=>e.props.value===O)[0]))}},258:function(e,n,t){"use strict";var a=t(0),o=t.n(a);n.a=function(e){return o.a.createElement("div",null,e.children)}}}]);