Download tax form PDF
Use Download tax form to download a 1099-K PDF for a given payout year. Provide the formId you received from the Get tax forms API. The API returns JSON metadata plus a base64-encoded PDF payload that you can decode and save.
How it works
- Call the endpoint with all required headers and query parameters:
payoutYear,taxFormType(=1099-K), andformId. - On success, the response includes file metadata and
fileContent(Base64 string). - Decode
fileContentto bytes and write a.pdffile. - Handle
400,404,502, and500per the table below.
Endpoint
GET https://marketplace.walmartapis.com/v1/settings/downloadtaxformprofile
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
payoutYear | integer or string | Yes | The tax year associated with the payout. For example 2024. |
taxFormType | string | Yes | The tax form type to download. For example 1099-K. |
formId | string | Yes | Unique ID returned by the Get tax forms API. For example, 42303. |
Request sample
curl -G "https://marketplace.walmartapis.com/v1/settings/downloadtaxformprofile" \ -H "WM_SEC.ACCESS_TOKEN: <redacted>" \ -H "WM_QOS.CORRELATION_ID: b3261d2d-028a-4ef7-8602-633c23200af6" \ -H "WM_SVC.NAME: Walmart Marketplace" \ -H "WM.PARTNER_ID: 10011478510" \ -H "WM.TENANT_ID: 0" \ -H "WM_CONSUMER.CHANNEL.TYPE: <your-channel-id>" \ -H "Accept: application/json" \ --data-urlencode "payoutYear=2024" \ --data-urlencode "taxFormType=1099-K" \ --data-urlencode "formId=484302"
import requests url = "https://marketplace.walmartapis.com/v1/settings/downloadtaxformprofile" # Query parameters (equivalent to --data-urlencode entries)
params = { "payoutYear": "2024", "taxFormType": "1099-K", "formId": "42303",
} # Headers from your curl command
headers = { "WM_SEC.ACCESS_TOKEN": "<redacted>", # Replace with your actual token "WM_QOS.CORRELATION_ID": "b3261d2d-028a-4ef7-8602-633c23200af6", "WM_SVC.NAME": "Walmart Marketplace", "WM.PARTNER_ID": "10011478510", "WM.TENANT_ID": "0", "WM_CONSUMER.CHANNEL.TYPE": "<your-channel-id>", # Replace with your channel ID "Accept": "application/json", # As in your curl; change to 'application/octet-stream' to download a file
} try: # timeout keeps the call from hanging; adjust as needed resp = requests.get(url, headers=headers, params=params, timeout=30) resp.raise_for_status() # Attempt to parse JSON since Accept=application/json try: data = resp.json() print("Status Code:", resp.status_code) print("Response JSON:", data) except ValueError: # If not JSON, show raw text (or handle as binary if expected) print("Status Code:", resp.status_code) print("Response Text:", resp.text) except requests.exceptions.HTTPError as e: print("HTTP error:", e) print("Response body:", getattr(resp, "text", ""))
except requests.exceptions.Timeout: print("Request timed out")
except requests.exceptions.RequestException as e: print("Request error:", e) Modify your code
Follow these steps to turn the sample into a working download.
- Use values from Get tax forms:
- Set
payoutYearto a year present inpaymentProcessorSummary[].payoutYear. - Set
formIdto thetaxForms[].formIdfor that year. - Set
taxFormTypeto1099-K.
- Confirm headers: Use a fresh access token in
WM_SEC.ACCESS_TOKEN. Generate a new GUID forWM_QOS.CORRELATION_ID. - Decode the file:The response includes
fileContentas base64. Decode it and save to a PDF file usingfileName. - Validate inputs: If you receive
400 invalid_parameters, recheckpayoutYear,taxFormType, andformId. EnsurepayoutYearis a 4-digit year andtaxFormTypeis1099-K. - Handle missing data: If you receive
404 report_not_found, call Get tax forms again and verify the year actually contains a1099-Kform. - Plan for transient errors: For
502 sovos_downstream_erroror500 internal_error, implement retries with backoff.
Response sample
200 OK
{ "partnerId": "10011478510", "payoutYear": 2024, "taxFormType": "1099-K", "fileName": "taxform-2024-1099-K.pdf", "contentType": "application/pdf",
"Content-Disposition": "attachment", "fileContent": "<base64-encoded-pdf-string>"
}
Using the payload
- Decode
fileContentfrom base64 and save the file usingfileName.
Example in bash:
jq -r '.fileContent' response.json | base64 --decode > taxform-2024-1099-K.pdf
Errors and remediation
| HTTP status | Error message | Description | Recommended action |
|---|---|---|---|
| 400 | Missing mandatory input parameters | One or more required headers or parameters were not provided. | Check all required headers, especially authentication and tenant/partner fields; ensure all required query params are present and valid, and resend the request. |
| 404 | No record found for the given parameters | No tax form data matches the provided partner, tenant, or formId. | Re-check that formId corresponds to the selected payoutYear and taxFormType=1099-K. If needed, call the Get tax forms API again and pick another year/form. |
| 502 | Error calling downstream service | The downstream PDF provider returned an error. | Treat as transient. Retry with exponential backoff; contact Partner Support with the correlation ID if persistent. |
Result
The service returns the PDF file of the 1099-K tax form.
Next steps
- Store PDFs securely and log
WM_QOS.CORRELATION_ID,WM.PARTNER_ID, andWM.TENANT_IDwith each request.
Related links
- Tax Forms API Guide
- Get Tax Forms API Reference
Updated 3 days ago
