-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2024-11-21 17:15:28.395503 new snippets
- Loading branch information
1 parent
68f9043
commit dd9c391
Showing
28 changed files
with
955 additions
and
1,490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
//date: 2024-11-21T17:02:35Z | ||
//url: https://api.github.com/gists/a0ab8ccb8b3a8db6f8b8b8360a90592c | ||
//owner: https://api.github.com/users/sts-developer | ||
|
||
import java.io.BufferedReader; | ||
import java.io.DataOutputStream; | ||
import java.io.InputStreamReader; | ||
import java.net.HttpURLConnection; | ||
import java.net.URL; | ||
|
||
public class Main { | ||
public static void main(String[] args) throws Exception { | ||
String url = "https://testapi.taxbandits.com/v1.7.3/Form1099B/Create"; | ||
URL obj = new URL(url); | ||
HttpURLConnection con = (HttpURLConnection) obj.openConnection(); | ||
|
||
// Setting basic post request headers | ||
con.setRequestMethod("POST"); | ||
con.setRequestProperty("Authorization", "YOUR_AUTH_TOKEN_HERE"); | ||
con.setRequestProperty("Content-Type", "application/json"); | ||
|
||
// Enabling POST parameters | ||
con.setDoOutput(true); | ||
|
||
// JSON payload as a single-line string (Updated JSON) | ||
String postData = "{" | ||
+ "\"SubmissionManifest\": {" | ||
+ "\"TaxYear\": \"2024\"," | ||
+ "\"IRSFilingType\":\"IRIS\"," | ||
+ "\"IsFederalFiling\": true," | ||
+ "\"IsPostal\": true," | ||
+ "\"IsOnlineAccess\": true," | ||
+ "\"IsScheduleFiling\": false," | ||
+ "\"ScheduleFiling\": null" | ||
+ "}," | ||
+ "\"ReturnHeader\": {" | ||
+ "\"Business\": {" | ||
+ "\"BusinessId\": null," | ||
+ "\"BusinessNm\": \"Snowdaze LLC\"," | ||
+ "\"FirstNm\": null," | ||
+ "\"MiddleNm\": null," | ||
+ "\"LastNm\": null," | ||
+ "\"Suffix\": null," | ||
+ "\"PayerRef\": \"Snow123\"," | ||
+ "\"TradeNm\": \"Iceberg Icecreams\"," | ||
+ "\"IsEIN\": true," | ||
+ "\"EINorSSN\": \"71-3787159\"," | ||
+ "\"Email\": \"[email protected]\"," | ||
+ "\"ContactNm\": null," | ||
+ "\"Phone\": \"6634567890\"," | ||
+ "\"PhoneExtn\": \"12345\"," | ||
+ "\"Fax\": \"6634567890\"," | ||
+ "\"BusinessType\": \"ESTE\"," | ||
+ "\"SigningAuthority\": null," | ||
+ "\"KindOfEmployer\": \"FederalGovt\"," | ||
+ "\"KindOfPayer\": \"REGULAR941\"," | ||
+ "\"IsBusinessTerminated\": true," | ||
+ "\"IsForeign\": false," | ||
+ "\"USAddress\": {" | ||
+ "\"Address1\": \"3576 AIRPORT WAY\"," | ||
+ "\"Address2\": \"UNIT 9\"," | ||
+ "\"City\": \"FAIRBANKS\"," | ||
+ "\"State\": \"AK\"," | ||
+ "\"ZipCd\": \"99709\"" | ||
+ "}," | ||
+ "\"ForeignAddress\": null" | ||
+ "}" | ||
+ "}," | ||
+ "\"ReturnData\": [" | ||
+ "{" | ||
+ "\"SequenceId\": \"1\"," | ||
+ "\"IsPostal\": true," | ||
+ "\"IsOnlineAccess\": true," | ||
+ "\"IsForced\": true," | ||
+ "\"Recipient\": {" | ||
+ "\"RecipientId\": null," | ||
+ "\"TINType\": \"EIN\"," | ||
+ "\"TIN\": \"36-3814577\"," | ||
+ "\"FirstPayeeNm\": \"Dairy Delights LLC\"," | ||
+ "\"SecondPayeeNm\": \"Coco Milk\"," | ||
+ "\"FirstNm\": null," | ||
+ "\"MiddleNm\": null," | ||
+ "\"LastNm\": null," | ||
+ "\"Suffix\": null," | ||
+ "\"IsForeign\": true," | ||
+ "\"USAddress\": null," | ||
+ "\"ForeignAddress\": {" | ||
+ "\"Address1\": \"120 Bremner Blvd\"," | ||
+ "\"Address2\": \"Suite 800\"," | ||
+ "\"City\": \"Toronto\"," | ||
+ "\"ProvinceOrStateNm\": \"Ontario\"," | ||
+ "\"Country\": \"CA\"," | ||
+ "\"PostalCd\": \"4168682600\"" | ||
+ "}," | ||
+ "\"Email\": \"[email protected]\"," | ||
+ "\"Fax\": \"6834567890\"," | ||
+ "\"Phone\": \"7634567890\"" | ||
+ "}," | ||
+ "\"BFormData\": {" | ||
+ "\"B1aDescrOfProp\": \"RFC\"," | ||
+ "\"B1bDateAcquired\": \"07/01/2022\"," | ||
+ "\"B1cDateSoldOrDisposed\": \"09/04/2021\"," | ||
+ "\"B1dProceeds\": 40.55," | ||
+ "\"B1eCostOrOtherBasis\": 30.89," | ||
+ "\"B1fAccruedMktDisc\": 20.11," | ||
+ "\"B1gWashsaleLossDisallowed\": 4.25," | ||
+ "\"B2TypeOfGainLoss\": \"ordinary short term\"," | ||
+ "\"B3IsProceedsFromCollectibles\": true," | ||
+ "\"B3IsProceedsFromQOF\": false," | ||
+ "\"B4FedTaxWH\": 0," | ||
+ "\"B5IsNonCoveredSecurityNotReported\": false," | ||
+ "\"B5IsNonCoveredSecurityReported\": false," | ||
+ "\"B6IsGrossProceeds\": true," | ||
+ "\"B6IsNetProceeds\": false," | ||
+ "\"B7IsLossNotAllowedbasedOn1d\": false," | ||
+ "\"B8PLRealizedOnClosedContract\": 0," | ||
+ "\"B9PLUnrealizedOnOpenContractPrevTy\": 0," | ||
+ "\"B10UnrealizedPLOnOpenContractCurTy\": 0," | ||
+ "\"B11AggPLOnContract\": 0," | ||
+ "\"B12IsBasisReportedToIRS\": false," | ||
+ "\"B13Bartering\": 43," | ||
+ "\"AccountNum\": \"789121\"," | ||
+ "\"CUSIPNum\": \"8988932143534\"," | ||
+ "\"IsFATCA\": true," | ||
+ "\"Form8949Code\": \"X\"," | ||
+ "\"Is2ndTINnot\": true," | ||
+ "\"States\": [" | ||
+ "{" | ||
+ "\"StateCd\": \"WV\"," | ||
+ "\"StateIdNum\": \"99999999\"," | ||
+ "\"StateWH\": 257.94" | ||
+ "}," | ||
+ "{" | ||
+ "\"StateCd\": \"ID\"," | ||
+ "\"StateIdNum\": \"999999999\"," | ||
+ "\"StateWH\": 15" | ||
+ "}" | ||
+ "]" | ||
+ "}" | ||
+ "}" | ||
+ "]" | ||
+ "}"; | ||
|
||
// Writing the POST data to the request | ||
try (DataOutputStream wr = new DataOutputStream(con.getOutputStream())) { | ||
wr.writeBytes(postData); | ||
wr.flush(); | ||
} | ||
|
||
// Reading the response | ||
int responseCode = con.getResponseCode(); | ||
BufferedReader in; | ||
if (responseCode >= 200 && responseCode <= 300) { | ||
in = new BufferedReader(new InputStreamReader(con.getInputStream())); | ||
} else { | ||
in = new BufferedReader(new InputStreamReader(con.getErrorStream())); | ||
} | ||
String inputLine; | ||
StringBuilder response = new StringBuilder(); | ||
while ((inputLine = in.readLine()) != null) { | ||
response.append(inputLine); | ||
} | ||
in.close(); | ||
|
||
// Printing the response | ||
System.out.println(response.toString()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
#date: 2024-11-21T17:01:50Z | ||
#url: https://api.github.com/gists/5b03d929935ccdcc1915c2625ca7639e | ||
#owner: https://api.github.com/users/sts-developer | ||
|
||
import http.client | ||
import json | ||
|
||
conn = http.client.HTTPSConnection("testapi.taxbandits.com") | ||
payload = json.dumps({ | ||
"SubmissionManifest": { | ||
"TaxYear": "2024", | ||
"IRSFilingType": "IRIS", | ||
"IsFederalFiling": True, | ||
"IsPostal": True, | ||
"IsOnlineAccess": True, | ||
"IsScheduleFiling": False, | ||
"ScheduleFiling": None | ||
}, | ||
"ReturnHeader": { | ||
"Business": { | ||
"BusinessId": None, | ||
"BusinessNm": "Snowdaze LLC", | ||
"FirstNm": None, | ||
"MiddleNm": None, | ||
"LastNm": None, | ||
"Suffix": None, | ||
"PayerRef": "Snow123", | ||
"TradeNm": "Iceberg Icecreams", | ||
"IsEIN": True, | ||
"EINorSSN": "71-3787159", | ||
"Email": "[email protected]", | ||
"ContactNm": None, | ||
"Phone": "6634567890", | ||
"PhoneExtn": "12345", | ||
"Fax": "6634567890", | ||
"BusinessType": "ESTE", | ||
"SigningAuthority": None, | ||
"KindOfEmployer": "FederalGovt", | ||
"KindOfPayer": "REGULAR941", | ||
"IsBusinessTerminated": True, | ||
"IsForeign": False, | ||
"USAddress": { | ||
"Address1": "3576 AIRPORT WAY", | ||
"Address2": "UNIT 9", | ||
"City": "FAIRBANKS", | ||
"State": "AK", | ||
"ZipCd": "99709" | ||
}, | ||
"ForeignAddress": None | ||
} | ||
}, | ||
"ReturnData": [ | ||
{ | ||
"SequenceId": "1", | ||
"IsPostal": True, | ||
"IsOnlineAccess": True, | ||
"IsForced": True, | ||
"Recipient": { | ||
"RecipientId": None, | ||
"TINType": "EIN", | ||
"TIN": "36-3814577", | ||
"FirstPayeeNm": "Dairy Delights LLC", | ||
"SecondPayeeNm": "Coco Milk", | ||
"FirstNm": None, | ||
"MiddleNm": None, | ||
"LastNm": None, | ||
"Suffix": None, | ||
"IsForeign": True, | ||
"USAddress": None, | ||
"ForeignAddress": { | ||
"Address1": "120 Bremner Blvd", | ||
"Address2": "Suite 800", | ||
"City": "Toronto", | ||
"ProvinceOrStateNm": "Ontario", | ||
"Country": "CA", | ||
"PostalCd": "4168682600" | ||
}, | ||
"Email": "[email protected]", | ||
"Fax": "6834567890", | ||
"Phone": "7634567890" | ||
}, | ||
"BFormData": { | ||
"B1aDescrOfProp": "RFC", | ||
"B1bDateAcquired": "07/01/2022", | ||
"B1cDateSoldOrDisposed": "09/04/2021", | ||
"B1dProceeds": 40.55, | ||
"B1eCostOrOtherBasis": 30.89, | ||
"B1fAccruedMktDisc": 20.11, | ||
"B1gWashsaleLossDisallowed": 4.25, | ||
"B2TypeOfGainLoss": "ordinary short term", | ||
"B3IsProceedsFromCollectibles": True, | ||
"B3IsProceedsFromQOF": False, | ||
"B4FedTaxWH": 0, | ||
"B5IsNonCoveredSecurityNotReported": False, | ||
"B5IsNonCoveredSecurityReported": False, | ||
"B6IsGrossProceeds": True, | ||
"B6IsNetProceeds": False, | ||
"B7IsLossNotAllowedbasedOn1d": False, | ||
"B8PLRealizedOnClosedContract": 0, | ||
"B9PLUnrealizedOnOpenContractPrevTy": 0, | ||
"B10UnrealizedPLOnOpenContractCurTy": 0, | ||
"B11AggPLOnContract": 0, | ||
"B12IsBasisReportedToIRS": False, | ||
"B13Bartering": 43, | ||
"AccountNum": "789121", | ||
"CUSIPNum": "8988932143534", | ||
"IsFATCA": True, | ||
"Form8949Code": "X", | ||
"Is2ndTINnot": True, | ||
"States": [ | ||
{ | ||
"StateCd": "WV", | ||
"StateIdNum": "99999999", | ||
"StateWH": 257.94 | ||
}, | ||
{ | ||
"StateCd": "ID", | ||
"StateIdNum": "999999999", | ||
"StateWH": 15 | ||
} | ||
] | ||
} | ||
} | ||
] | ||
}) | ||
headers = { | ||
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJlNDdhN2I3MGMwNTY0NjI2OTU0M2RhNzQwZmNiNTZmNCIsImV4cCI6MTczMjAxNjY0OCwiaWF0IjoxNzMyMDEzMDQ4LCJpc3MiOiJodHRwczovL3Ricy1vYXV0aC5zdHNzcHJpbnQuY29tL3YyLyIsInN1YiI6ImJlZWQ0ZTAxYzM2NmQ4MjIiLCJ1c2VydW5pcXVlaWQiOiIifQ.S6hAjN56eo7fQuFL810aody1M-22xvhWj8ewVAHRxDU', | ||
'Content-Type': 'application/json' | ||
} | ||
conn.request("POST", "/V1.7.3/form1099B/create", payload, headers) | ||
res = conn.getresponse() | ||
data = res.read() | ||
print(data.decode("utf-8")) |
Oops, something went wrong.