Skip to content

Instantly share code, notes, and snippets.

@sts-developer
Created November 20, 2024 07:34
Show Gist options
  • Save sts-developer/3dd2509b8897ee6de74102f0f4b36eee to your computer and use it in GitHub Desktop.
Save sts-developer/3dd2509b8897ee6de74102f0f4b36eee to your computer and use it in GitHub Desktop.
Sample code for Python Form1099K Update method
import http.client
import json
conn = http.client.HTTPSConnection("testapi.taxbandits.com")
payload = json.dumps({
"SubmissionManifest": {
"SubmissionId": "41f2f0f4-9617-4f36-9f04-33bbedd07931",
"TaxYear": "2024",
"IRSFilingType": "IRIS",
"IsFederalFiling": True,
"IsStateFiling": True,
"IsPostal": True,
"IsOnlineAccess": True,
"IsScheduleFiling": True,
"ScheduleFiling": {
"EfileDate": "12/18/2024"
}
},
"ReturnHeader": {
"Business": {
"BusinessId": None,
"BusinessNm": "Snowdaze LLC",
"FirstNm": None,
"MiddleNm": None,
"LastNm": None,
"Suffix": None,
"PayerRef": "Snow53",
"TradeNm": "Iceberg Icecreams",
"IsEIN": True,
"EINorSSN": "352145703",
"Email": "[email protected]",
"ContactNm": "James",
"Phone": "9865321245",
"PhoneExtn": "12345",
"Fax": "9864567890",
"BusinessType": "ESTE",
"SigningAuthority": {
"Name": "James",
"Phone": "9865321245",
"BusinessMemberType": "ADMINISTRATOR"
},
"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": [
{
"RecordId": "c86f56da-60ea-4853-b9b7-fea5fa95bae3",
"SequenceId": "01",
"IsForced": True,
"Recipient": {
"RecipientId": None,
"TINType": "EIN",
"TIN": "669846539",
"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": "9834567890",
"Phone": "9634567890"
},
"KFormData": {
"B1aGrossAmt": 1200,
"B1bCardNotPresentTxns": 500,
"B2MerchantCd": "0742",
"B3NumPymtTxns": 12,
"B4FedTaxWH": 55,
"B5aJan": 100,
"B5bFeb": 100,
"B5cMar": 100,
"B5dApr": 100,
"B5eMay": 100,
"B5fJun": 100,
"B5gJul": 100,
"B5hAug": 100,
"B5iSep": 100,
"B5jOct": 100,
"B5kNov": 100,
"B5lDec": 100,
"AccountNum": "12345",
"Is2ndTINnot": True,
"FilerIndicator": "EPF",
"PSEDetails": {
"PSEName": "Dairy Delights LLC",
"PSEPhone": "9634567890"
},
"IndicateTxnsReported": "payment_card",
"States": [
{
"StateCd": "NM",
"StateIdNum": "99-999999-99-9",
"StateWH": 20
},
{
"StateCd": "AZ",
"StateIdNum": "23-123456",
"StateWH": 40
}
]
}
}
]
})
headers = {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJlNDdhN2I3MGMwNTY0NjI2OTU0M2RhNzQwZmNiNTZmNCIsImV4cCI6MTczMjAxNjY0OCwiaWF0IjoxNzMyMDEzMDQ4LCJpc3MiOiJodHRwczovL3Ricy1vYXV0aC5zdHNzcHJpbnQuY29tL3YyLyIsInN1YiI6ImJlZWQ0ZTAxYzM2NmQ4MjIiLCJ1c2VydW5pcXVlaWQiOiIifQ.S6hAjN56eo7fQuFL810aody1M-22xvhWj8ewVAHRxDU',
'Content-Type': 'application/json'
}
conn.request("PUT", "/V1.7.3/form1099K/update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment