curl --request POST \
--url https://mm-api.merchantspring.io/clientReports/generatePDF \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"reportId": "<string>"
}
'import requests
url = "https://mm-api.merchantspring.io/clientReports/generatePDF"
payload = { "reportId": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reportId: '<string>'})
};
fetch('https://mm-api.merchantspring.io/clientReports/generatePDF', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mm-api.merchantspring.io/clientReports/generatePDF",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reportId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mm-api.merchantspring.io/clientReports/generatePDF"
payload := strings.NewReader("{\n \"reportId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mm-api.merchantspring.io/clientReports/generatePDF")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reportId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mm-api.merchantspring.io/clientReports/generatePDF")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reportId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyGenerate a PDF of a saved Client Report
Creates a PDF of a saved Client Report, exactly as the report currently appears. This returns a jobId straight away - poll GET /clientReports/generatePDF?jobId= until status is “done” to get the download link. PDFs are created in turn, so allow up to 5 minutes for one to be ready. If it isn’t ready yet, wait a little longer before checking again. The download link is valid for 4 hours.
A new PDF of the same report can be created once an hour: if you already created one in the last 60 minutes, that PDF is returned immediately (status “done”) instead of creating a new one. If a PDF of the same report you requested is still being generated, that job is returned instead of starting another.
Owners and Administrators can create a PDF of any report in their organisation; other roles only of reports they created.
curl --request POST \
--url https://mm-api.merchantspring.io/clientReports/generatePDF \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"reportId": "<string>"
}
'import requests
url = "https://mm-api.merchantspring.io/clientReports/generatePDF"
payload = { "reportId": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reportId: '<string>'})
};
fetch('https://mm-api.merchantspring.io/clientReports/generatePDF', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mm-api.merchantspring.io/clientReports/generatePDF",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reportId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mm-api.merchantspring.io/clientReports/generatePDF"
payload := strings.NewReader("{\n \"reportId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mm-api.merchantspring.io/clientReports/generatePDF")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reportId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mm-api.merchantspring.io/clientReports/generatePDF")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reportId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyBody
Client Report identifier
Response
Successful operation
"started" for a newly-created job. "started" / "inProgress" with an existing jobId if a PDF of this report you requested is still being generated - poll that job. "done" if you already created a PDF of this report within the last 60 minutes and it was returned instead (see downloadUrl/generatedAt)
started, inProgress, done Was this page helpful?