Call the Shopify Admin API From Make With a Code Step (GraphQL)
Shopify's REST Admin API is legacy. Send a GraphQL query or batched mutation from a Make code step, check userErrors, flatten edges/node and read the query cost.
Updated November 2026
One code step in Make can read Pipedrive's deal field definitions once, turn every 40-character custom field key into its readable name, and hand the next module a clean array of deals. The same step can update the stage of 50 deals for one Make operation instead of 50, by calling PATCH /api/v2/deals/{id} in small concurrent batches.
Make's Pipedrive app is good at the single-record cases: watch a deal, get a person, create an activity. Since Make moved the app to Pipedrive API v2 (v1 modules stopped running on July 31, 2026, per Make's app page, checked October 2026), custom fields arrive under one custom_fields object, still keyed by hashes like dcf558aac1ae4e8c4f849ba5e668430d8df9be12. Every Update a Deal call is one operation per deal, and endpoints without a module (deal field options, discounts, lead conversion) go through Make an API Call, also one operation each.
x-api-token, against https://<company>.pipedrive.com/api/v2/.... Keep the token in a Make variable, not in the code.GET /api/v2/dealFields returns field_code (the hash), field_name and option labels. Map once, apply to every deal./api/v1/... there, same header.Add the CustomJS module Execute Inline JavaScript, set Return Type to Array, and put a JSON string in the Input field. The token comes from a Make variable; the stage ID is the stage you want to read.
{
"token": "{{var.pipedriveToken}}",
"company": "acme-sales",
"stageId": 3
}The code fetches the field definitions, builds two lookup tables (hash to name, and hash plus option ID to option label for single-option fields), then fetches the deals and rewrites each one.
const { token, company, stageId } =
typeof input === "string" ? JSON.parse(input) : input;
const base = `https://${company}.pipedrive.com/api/v2`;
const get = async (path) => {
const res = await fetch(base + path, { headers: { "x-api-token": token } });
if (!res.ok) throw new Error(`${path} -> ${res.status} ${await res.text()}`);
return (await res.json()).data;
};
// 1. Field definitions, fetched once: hash -> name, hash:optionId -> label
const names = {};
const labels = {};
for (const f of await get("/dealFields?limit=500")) {
if (!f.is_custom_field) continue;
names[f.field_code] = f.field_name;
for (const o of f.options || []) labels[`${f.field_code}:${o.id}`] = o.label;
}
// 2. Deals in the stage, custom fields rewritten with readable names
const deals = await get(`/deals?stage_id=${stageId}&status=open&limit=500`);
return deals.map((d) => {
const custom = {};
for (const [key, val] of Object.entries(d.custom_fields || {})) {
custom[names[key] || key] = labels[`${key}:${val}`] ?? val;
}
return { id: d.id, title: d.title, value: d.value, currency: d.currency, ...custom };
});Output, with two custom fields ("Contract type" is a single-option field, "Renewal date" a date field):
[
{
"id": 1842,
"title": "Acme Corp - 25 seats",
"value": 14250,
"currency": "EUR",
"Contract type": "Annual",
"Renewal date": "2027-03-01"
},
{
"id": 1851,
"title": "Northwind Traders - pilot",
"value": 2400,
"currency": "EUR",
"Contract type": "Monthly",
"Renewal date": null
}
] The next module sees Contract type and Renewal date in its mapping panel instead of the hash. Multi-option fields (type set) come back as arrays of option IDs; map each element through labels if you need the text. Both endpoints return at most 500 items per call; for more, loop on additional_data.next_cursor and pass it as &cursor=. The step makes two round trips to Pipedrive, so it lands well above the 121 ms median for inline scripts and usually under a second, and it costs 20 Pipedrive API tokens (10 per list call per the v2 spec).
Pass the deal IDs (for example from a previous Array Aggregator, turned into a JSON string) and the target stage. The loop sends five PATCH requests at a time, which stays under Pipedrive's burst limit of 20 requests per 2 seconds for API-token traffic on the smallest plan (rate limiting doc, checked October 2026).
{
"token": "{{var.pipedriveToken}}",
"company": "acme-sales",
"dealIds": [1842, 1851, 1877, 1902, 1915, 1920, 1933],
"stageId": 4
}const { token, company, dealIds, stageId } =
typeof input === "string" ? JSON.parse(input) : input;
const concurrency = 5; // burst limit is 20 requests per 2 s on Pipedrive's smallest plan
const results = [];
for (let i = 0; i < dealIds.length; i += concurrency) {
const batch = dealIds.slice(i, i + concurrency).map(async (id) => {
const res = await fetch(`https://${company}.pipedrive.com/api/v2/deals/${id}`, {
method: "PATCH",
headers: { "x-api-token": token, "Content-Type": "application/json" },
body: JSON.stringify({ stage_id: stageId }),
});
return { id, ok: res.ok, status: res.status };
});
results.push(...(await Promise.all(batch)));
}
return {
updated: results.filter((r) => r.ok).map((r) => r.id),
failed: results.filter((r) => !r.ok),
};{
"updated": [1842, 1851, 1877, 1902, 1915, 1920],
"failed": [{ "id": 1933, "ok": false, "status": 404 }]
} Make bills this as 1 operation. Pipedrive still counts each PATCH (5 tokens per update in the v2 spec), so the daily token budget is the real ceiling, not Make's operation count. If you call the same mapping from several scenarios, store it once as an Execute Stored Function with dealIds and stageId as named parameters.

| Task | Make's Pipedrive app | Code step |
|---|---|---|
| Custom field names | Hash keys inside custom_fields | Readable names from dealFields |
| Update 50 deals | 50 operations (Iterator + Update a Deal) | 1 operation + 1 CustomJS request |
| Endpoint without a module | Make an API Call, 1 operation per call | Any v1 or v2 endpoint, as many calls as the step needs |
| Trigger on a new deal | Watch Deals module | Not possible, code steps do not trigger |
| Maintenance | Make updates the app | You own 25 lines of code |
For the related document workflow (fetch a deal, render a quote PDF, attach it back to the deal), see Pipedrive PDF quotes: 3 ways to generate documents from deal data. The HubSpot recipe uses the same fetch pattern with a different auth header.
The CustomJS Make module runs this code on every plan, including the free tier (20 requests per day, no credit card), with fetch and the pipedrive npm package preinstalled.
Continue reading on similar topics
Shopify's REST Admin API is legacy. Send a GraphQL query or batched mutation from a Make code step, check userErrors, flatten edges/node and read the query cost.
Call OpenAI from a Make code step with a strict JSON schema: classify 50 tickets in one operation, validate the batch, retry 429s with backoff, and map the result fields in the next module.
How a file moves through Make.com as base64 and binary: decode it with Buffer.from, detect the real type from the header bytes, and return a file or a data URI. Code with input and output.