Community
API endpoint testing
I am currently setting up a connection with your API and I have found no information in your documentation about testing calls. Is there a testing environment? or testing data? or are we just going full wild west?? I have included the code below that I want to test but my concerns are rather many as there is no actual documentation of protocol headers or call types (I'm assuming POST your documentation doesn't say) I have figured out that the content-type header is explicitly required along with the auth (no documentation stating that, and your system doesn't accept the auto-generated header produced by node request or Postman so it has to be explicitly set) and I am wondering if there are any more hoops that need to be jumped through that are not mentioned in your documentation. Any help would be greatly appreciated.
(req, res) => {
const form = req.body;
const options = {
url: `https://rest.everyware.com/api/Default/CreatePayment`,
method: "POST",
headers: {
"Content-Type": "application/json"
},
auth: {
user: env.EVERYWARE_USER,
pass: env.EVERYWARE_KEY
},
body: JSON.stringify({
"FirstName": form.first_name,
"LastName": form.last_name,
"Address1": form.address1,
"Address2": form.address2,
"City": form.city,
"StateCode": form.state,
"PostalCode": form.zip,
"CountryCode": form.country || "US",
"Email": form.email,
"AccountNumber": form.account_number,
"RoutingNumber": form.routing_number,
"Amount": form.amount,
"ChargeType": "charge",
"IsEmailReceipt": false,
"IsSMSReceipt": false,
"CreateToken": false
})
};
request(options, function (err, response) {
if (err) {
//console.error(err, "EVERYWARE SERVICE ACH Create Payment ERROR", err);
return res.status(500).send(err);
} else {
return res.status(200).send(response);
}
});
}