API Reference

Accessing the production environment

When you're ready to access the production environment, you can use the following as an example on what you need for the production API. The production API requires that the mTLS certificate, the private key and the API key are set up correctly. You can use the example and change up as needed, depending on the type of HTTP request methods and the endpoint you're trying to reach


KeyDescription
mTLS certificateThe mTLS certificate our team sent (.pem file)
Private KeyThe private key that was generated along with the csr
API keyThe API key our team sent
const fs = require('fs');
const https = require('https');
const path = require('path');

const certPath = path.resolve(__dirname, 'mtls/my_cretificate.crt');
const keyPath = path.resolve(__dirname, 'mtls/my_private_key.key');
let httpsAgent = null;
if (fs.existsSync(certPath) && fs.existsSync(keyPath)) {
	httpsAgent = new https.Agent({
    cert: fs.readFileSync(certPath), //Here you put your certificate (.pem)
		key: fs.readFileSync(keyPath), //Here you put your private key (.key)
	});
}

headers = {
  'x-delbank-api-key': process.env.API_KEY,
};

const apiResponse = await axios({
	method: // 'GET', 'POST', 'PUT', 'DELETE'
	url: //api.delbank.com.br/...,
	headers: headers,
	httpsAgent: httpsAgent,
});