# Create a Zimarker Get a [Zimarker](/key-concepts#zimarker) for a [pallet](/key-concepts#pallet). You send a pallet's WMS ID and get back an image of the Zimarker, already linked to that pallet. Use this image to print onto the actual label. ## Prerequisites - An API key (`ZIM.…`). See [Authentication](/rest-api/authentication). - A pallet's WMS ID. ## Get a Zimarker for your pallet Send the pallet's WMS ID. The response comes back with the Zimarker image. [`POST /integration/rest/api/v1/track/get-and-couple`](/api#operation/getAndCouple) cURL ```bash curl -X POST "https://api.zimark.link/integration/rest/api/v1/track/get-and-couple" \ -H "X-AUTH-KEY: ZIM.your-api-key-here" \ -H "Content-Type: application/json" \ -d '{ "wmsId": "LPN00012345" }' ``` JavaScript ```javascript const response = await fetch( 'https://api.zimark.link/integration/rest/api/v1/track/get-and-couple', { method: 'POST', headers: { 'X-AUTH-KEY': 'ZIM.your-api-key-here', 'Content-Type': 'application/json' }, body: JSON.stringify({ wmsId: 'LPN00012345' }) } ); const result = await response.json(); console.log(result.markerCode); ``` Python ```python import requests response = requests.post( 'https://api.zimark.link/integration/rest/api/v1/track/get-and-couple', headers={ 'X-AUTH-KEY': 'ZIM.your-api-key-here', 'Content-Type': 'application/json' }, json={'wmsId': 'LPN00012345'} ) result = response.json() print(result['markerCode']) ``` ### Request fields | Field | Type | Required | Notes | | --- | --- | --- | --- | | `wmsId` | string | Yes | The pallet's WMS ID. | ### Success response `200 OK` returns the marker, its printable image, and the pallet it was linked to: ```json { "markerCode": "68", "markerImage": "iVBORw0KGgoAAAANSUhEUgAAAlgAAAJYAQAAAACWHaVxAAABqUlEQVR4Xu3MsU0EMBAAwe+A/rukA0js5GS/WPgA6WeTk+3zPL5e12Ne/CFWi9VitVgtVovVYrVYLVaL1WK1WC1Wi9X679bn4/d9sFKsFqvFarFarBarxWqxWqwWq8VqsVqs1jtbz+nzK2tu786vrLm9O7+y5vbu/Mqa27vzK2tu786vrLm9O7+y5vbu/Mqa27vzK2tu786vrLm9O7+y5vbu/Mqa27vzK2tu786vrLm9O7+yrtvPj2uybp/HcU3W7fM4rsm6fR7HNVm3z+O4Juv2eRzXZN0+j+OarNvncVyTdfs8jmuybp/HcU3W7fM4rsm6fR7HNVm3z+O4Juv2eRzXZN0+j+Oa72T9KBZrxmLNWKwZizVjsWYs1ozFmrFYM9a0xvbzWKwZizVjsWYs1ozFmrFYMxZrxmLNWC1Wi9VitVgtVovVYrVYLVaL1WK1WC1Wi9VitVgtVovVYrVYLVaL1WK1WC1Wi9VitVgtVovVYrVYLVaL1WK1WC1Wi9VitVgtVovVYrVYrXe0XhGrxWqxWqwWq8VqsVqsFqvFarFarBarxWq9g/UN4g40ck/G8nEAAAAASUVORK5CYII=", "track": { "uuid": "91f97808-9dab-4bcd-b619-d97d6de2131a", "createDate": 1783164318293, "updateDate": 1783164318293, "deepLink": "https://67uo7.app.link/LBMPRRKWu4b", "trackCode": "001-109", "wmsId": "LPN00012345", "status": "ACTIVE", "zimarkCodes": [ { "uuid": "401f6d6d-e155-4a64-b23b-ea9eb405fe04", "zimarkMarkerValue": "68", "markerType": "ZMARKER", "coupledAt": 1783164318353 } ] } } ``` - `markerCode`: the Zimarker value, unique and never reused. This is what prints on the label. - `markerImage`: the marker as a base64-encoded PNG (1-bit, 600×600 black-and-white), ready to print. - `track`: the pallet it was linked to. `wmsId` is your pallet ID; `zimarkCodes` lists the Zimarker(s) it now carries (the coupled marker also appears here as `zimarkCodes[].zimarkMarkerValue`, the same value as `markerCode`). ## Turn it into an image `markerImage` is a base64-encoded PNG. To display it, wrap it in a data URI and set it as an image source, with no decoding step and no extra request: HTML ```html Zimarker ``` JavaScript ```javascript const img = document.createElement('img'); img.src = `data:image/png;base64,${result.markerImage}`; document.body.appendChild(img); ``` Python ```python # Save the PNG to a file import base64 with open(f"marker-{result['markerCode']}.png", 'wb') as f: f.write(base64.b64decode(result['markerImage'])) ``` That's the whole marker. Here's the one returned above (code `68`), rendered straight from its base64: img Prefer a URL over inline bytes? Add `?imageDelivery=URL` to the request. The response then returns `markerImageUrl`, a public PNG URL (`…/zmarker-code/image/{markerCode}.png`) you can use in your label, instead of a base64-encoded PNG. Getting the image onto a physical label (printer setup, label layout, and print formats) happens outside Zimark's APIs. See [Printing Zimarkers](/zimarkers/printing) for how to do it right. ## Confirm it worked - The response was `200 OK` with a `markerCode` and a `markerImage`. - The returned `track.wmsId` matches the pallet ID you sent. - The decoded image prints as a Zimarker. Once the label is on the pallet, a camera can read it. If a call fails, check [Troubleshooting](/rest-api/troubleshoot). A `400` from this endpoint usually means a duplicate WMS ID, an unknown custom-field key, or insufficient Zimarker inventory. **High volume and offline printing** This guide couples one pallet synchronously: the result contains everything you need for this specific pallet. For higher throughput, or to generate Zimarkers for offline printing, the Coupling API offers variants this guide doesn't cover: asynchronous batch generation. ## Related - [Coupling API](/zimarkers/coupling-api): the concepts behind allocation, coupling, banks, and sync vs. async. - [Create and update a Manifest](/guides/create-update-manifest): group coupled pallets into a manifest for gate verification.