> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.mercoa.com/embedded-ap-ar/api-reference/invoice-template/document/generate-check-pdf/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mercoa.com/_mcp/server. # Get Check PDF GET https://api.mercoa.com/invoice-template/{invoiceTemplateId}/check/generate Get a PDF of the check for the invoice. If the invoice does not have check as the disbursement method, an error will be returned. If the disbursement option for the check is set to 'MAIL', a void copy of the check will be returned. If the disbursement option for the check is set to 'PRINT', a printable check will be returned. If the invoice is NOT marked as PAID, the check will be a void copy. Reference: https://docs.mercoa.com/embedded-ap-ar/api-reference/invoice-template/document/generate-check-pdf ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `invoiceTemplateId` (string, required) — Invoice Template ID ## Response ### 200 Link to the PDF file. Will expire after 1 hour. - `mimeType` (string, required) - `type` (enum, required) - Allowed values: `INVOICE`, `PAYMENT_CONFIRMATION`, `TEN_NINETY_NINE`, `W9`, `CHECK`, `BANK_STATEMENT`, `CONTRACT`, `OTHER` - `uri` (string, required) - `id` (string, optional) — ID of the document. If not provided, this is a dynamic document that is generated on the fly. ## Errors ### 400 Bad Request - `errorName` ("BadRequest", required) - `content` (string, required) ### 401 Unauthorized - `errorName` ("Unauthorized", required) - `content` (string, required) ### 403 Forbidden - `errorName` ("Forbidden", required) - `content` (string, required) ### 404 Not Found - `errorName` ("NotFound", required) - `content` (string, required) ### 409 Conflict - `errorName` ("Conflict", required) - `content` (string, required) ### 500 Internal Server Error - `errorName` ("InternalServerError", required) - `content` (string, required) ### 501 Unimplemented - `errorName` ("Unimplemented", required) - `content` (string, required) ## Examples **Response** ```json { "mimeType": "application/pdf", "type": "CHECK", "uri": "https://mercoa.com/pdf/not-real.pdf" } ``` **SDK Code** ```python Default import requests url = "https://api.mercoa.com/invoice-template/invt_13c07096-5848-4aeb-ae7d-6576289034c4/check/generate" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```typescript Default import { MercoaClient } from "@mercoa/javascript"; const client = new MercoaClient({ token: "YOUR_TOKEN" }); await client.invoiceTemplate.document.generateCheckPdf("invt_13c07096-5848-4aeb-ae7d-6576289034c4"); ``` ```go Default package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.mercoa.com/invoice-template/invt_13c07096-5848-4aeb-ae7d-6576289034c4/check/generate" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Default require 'uri' require 'net/http' url = URI("https://api.mercoa.com/invoice-template/invt_13c07096-5848-4aeb-ae7d-6576289034c4/check/generate") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java Default import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.mercoa.com/invoice-template/invt_13c07096-5848-4aeb-ae7d-6576289034c4/check/generate") .header("Authorization", "Bearer ") .asString(); ``` ```php Default request('GET', 'https://api.mercoa.com/invoice-template/invt_13c07096-5848-4aeb-ae7d-6576289034c4/check/generate', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp Default using RestSharp; var client = new RestClient("https://api.mercoa.com/invoice-template/invt_13c07096-5848-4aeb-ae7d-6576289034c4/check/generate"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift Default import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.mercoa.com/invoice-template/invt_13c07096-5848-4aeb-ae7d-6576289034c4/check/generate")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```