Skip to content

Instantly share code, notes, and snippets.

@sts-developer
sts-developer / cURLBusinessDelete.cs
Last active July 3, 2024 13:35
cURLBusinessDelete
curl --location --request DELETE "https://testapi.taxbandits.com/v1.7.3/Business/Delete?BusinessId=8e79872b-02cd-45d0-81f8-3d84fb0873e0&EINOrSSN=003313331&isForceDelete=false" --header "Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3Rlc3RvYXV0aC5leHByZXNzYXV0aC5uZXQvdjIvIiwic3ViIjoiYTQyMWE2MWUzOWUyY2U3ZSIsImF1ZCI6ImVjMTQ1MjFiMzE0ZjQ3ZGE5Nzk4MzNiNWVmOTE0NTllIiwiaWF0IjoxNzE4Mjk2MjQ5LCJleHAiOjE3MTgyOTk4NDl9.wdGpOBSWiGD_V4CGv2MzjSmPfgNx730ZoDnK68jdNIE"
@sts-developer
sts-developer / cURLBusinessRequestBYUrl.cs
Last active July 3, 2024 13:40
cURLBusinessRequestBYUrl
curl --location "https://testapi.taxbandits.com/v1.7.3/Business/Requestbyurl?payerref=1261452&formtype=form1099" --header "Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3Rlc3RvYXV0aC5leHByZXNzYXV0aC5uZXQvdjIvIiwic3ViIjoiYTQyMWE2MWUzOWUyY2U3ZSIsImF1ZCI6ImVjMTQ1MjFiMzE0ZjQ3ZGE5Nzk4MzNiNWVmOTE0NTllIiwiaWF0IjoxNzE4Mjk2MjQ5LCJleHAiOjE3MTgyOTk4NDl9.wdGpOBSWiGD_V4CGv2MzjSmPfgNx730ZoDnK68jdNIE"
@sts-developer
sts-developer / BusinessCreate.js
Last active July 2, 2024 07:52
Business Create in Node.js
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://testapi.taxbandits.com/v1.7.3/Business/Create");
request.Headers.Add("Authorization", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3Rlc3RvYXV0aC5leHByZXNzYXV0aC5uZXQvdjIvIiwic3ViIjoiOTc0YTFiZDU5Yjk3ZTE1YyIsImF1ZCI6ImEzZWQxYTVlOTAxYjRiZDM5Njk1NjAxOWNhNGMxZmY4IiwiaWF0IjoxNzE5OTAxNzU5LCJleHAiOjE3MTk5MDUzNTl9.Hwi03bFpc718rRVwenMycLLSPfW0GyaK2_gjMqroB1M");
var content = new StringContent("{\r\n \"BusinessNm\": \"Orchid Incorporated\",\r\n \"PayerRef\": \"Pe126145\",\r\n \"TradeNm\": \"Kodak\",\r\n \"IsEIN\": true,\r\n \"EINorSSN\": \"003313330\",\r\n \"Email\": \"[email protected]\",\r\n \"ContactNm\": \"John\",\r\n \"Phone\": \"6549873215\",\r\n \"PhoneExtn\": \"12345\",\r\n \"Fax\": \"9876543544\",\r\n \"BusinessType\": \"ESTE\",\r\n \"SigningAuthority\": {\r\n \"Name\": \"John\",\r\n \"Phone\": \"9876549874\",\r\n \"BusinessMemberType\": \"ADMINISTRATOR\"\r\n },
@sts-developer
sts-developer / BusinessUpdate.js
Created June 13, 2024 13:06
Business Update in Node.js
const axios = require('axios') /*Using axios to consume API service*/
const { publicAPIAuthentication } = require('../user/userController') /*Importing publicAPIAuthentication from user controller for JWT token */
//Update Business
//Updating a Business by hitting TBS public API with request body and JWT token as header
const updateBusiness = async (req, res) => {
const requestBody = req?.body
//Getting JWT token by using oauth api function
@sts-developer
sts-developer / BusinessGet.js
Created June 13, 2024 13:07
Business get in Node.js
const axios = require('axios') /*Using axios to consume API service*/
const { publicAPIAuthentication } = require('../user/userController') /*Importing publicAPIAuthentication from user controller for JWT token */
const getBusiness = async (req, res) => {
// Getting Business Id from request params
const BusinessId = req?.params?.BusinessId
// Getting JWT token by using oauth api function
const JWTAccessToken = await publicAPIAuthentication()
@sts-developer
sts-developer / BusinessList.js
Created June 13, 2024 13:08
Business List in Node.js
const axios = require('axios') /*Using axios to consume API service*/
const moment = require('moment') /*Using moment for date formatting*/
const { publicAPIAuthentication } = require('../user/userController') /*Importing publicAPIAuthentication from user controller for JWT token */
const listBusiness = async (req, res) => {
//Default values loaded from .env
const Page = process.env.PAGE
const PageSize = process.env.PAGE_SIZE
const FromDate = process.env.FROM_DATE
const ToDate = moment(new Date()).format('MM/DD/YYYY')
@sts-developer
sts-developer / NecCreate.cs
Last active July 17, 2024 10:01
Sample C# code for NEC Create
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://testapi.taxbandits.com/v1.7.3/Form1099NEC/Create");
request.Headers.Add("Authorization", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJlYzE0NTIxYjMxNGY0N2RhOTc5ODMzYjVlZjkxNDU5ZSIsImV4cCI6MTcyMTIwMjM5NSwiaWF0IjoxNzIxMTk4Nzk1LCJpc3MiOiJodHRwczovL3Rlc3RvYXV0aC5leHByZXNzYXV0aC5uZXQvdjIvIiwic3ViIjoiYTQyMWE2MWUzOWUyY2U3ZSJ9._bbfUIbrUQXwga5bS23SH6_8JzA7EwYsCid8PIjxXs0");
var content = new StringContent("{\r\n \"SubmissionManifest\": {\r\n \"SubmissionId\": null,\r\n \"TaxYear\": \"2023\",\r\n \"IsFederalFiling\": true,\r\n \"IsStateFiling\": true,\r\n \"IsPostal\": true,\r\n \"IsOnlineAccess\": true,\r\n \"IsScheduleFiling\": true,\r\n \"ScheduleFiling\": {\r\n \"EfileDate\": \"12/26/2024\"\r\n }\r\n },\r\n \"ReturnHeader\": {\r\n \"Business\": {\r\n \"BusinessId\": null,\r\n \"BusinessNm\": \"Snowdaze LLC\",\
@sts-developer
sts-developer / BusinessCreate.js
Last active July 24, 2024 08:16
Sample Node js code for Business Create
const axios = require('axios');
let data = JSON.stringify({
"BusinessNm": "Snowdaze LLC",
"FirstNm": null,
"MiddleNm": null,
"LastNm": null,
"Suffix": null,
"PayerRef": "Pe1261456",
"TradeNm": "Kodak",
"IsEIN": true,
@sts-developer
sts-developer / BusinessUpdate.js
Last active July 24, 2024 08:17
Sample Node js Code for Business Update
const axios = require('axios');
let data = JSON.stringify({
"BusinessId": "559fa96a-a9fd-495e-a8c1-cdf3572a2b9c",
"BusinessNm": "Snowdaze LLC",
"FirstNm": null,
"MiddleNm": null,
"LastNm": null,
"Suffix": null,
"PayerRef": "Pe1261456",
"TradeNm": "Kodak",
@sts-developer
sts-developer / BusinessRequestByUrl.js
Last active July 24, 2024 08:20
Sample Node js Code for Business RequestByUrl
const axios = require('axios');
let config = {
method: 'get',
maxBodyLength: Infinity,
url: 'https://testapi.taxbandits.com/v1.7.3/Business/Requestbyurl?payerref=126145&formtype=form1099&returnurl=https://example.com/&cancelurl=https://example.com/',
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3Rlc3RvYXV0aC5leHByZXNzYXV0aC5uZXQvdjIvIiwic3ViIjoiYTQyMWE2MWUzOWUyY2U3ZSIsImF1ZCI6ImVjMTQ1MjFiMzE0ZjQ3ZGE5Nzk4MzNiNWVmOTE0NTllIiwiaWF0IjoxNzIwMDEyNjkxLCJleHAiOjE3MjAwMTYyOTF9.MCscmYtHNgFf4emMoEOeOnCJMlAy5AP0LUWkWoNivoU'
}
};