Endpoints
Id Tags
Smake Master API — Id Tags
Fetching list of id tags.
LIST
Returns a collection of id tags.
Example of fetching id tag list
Request
GET /id-tags HTTP/1.1Response
{
"data": [
{
"id": 1,
"order_item_unit": 1,
"media": [
1,
],
"created_at": "2023-02-07T13:17:06+00:00",
"updated_at": "2023-02-07T13:17:06+00:00"
},
{
"id": 2,
"order_item_unit": 2,
"media": [
2,
],
"created_at": "2023-02-07T13:17:06+00:00",
"updated_at": "2023-02-07T13:17:06+00:00"
}
],
"links": {
"first": null,
"last": null,
"prev": null,
"next": "https://api.smake.io/master-administration/id-tags?cursor=eyJwcm9kdWN0aW9uX3ZhcmlhbnRzLmlkIjoyMDIsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0"
},
"meta": {
"path": "https://api.smake.io/master-administration/id-tags",
"per_page": 15,
"next_cursor": "eyJwcm9kdWN0aW9uX3ZhcmlhbnRzLmlkIjoyMDIsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0",
"prev_cursor": null
}
}Filtering
You can filter your results as follows:
List id tags for specified external reference of order item unit
/id-tags?filter[order_item_unit.external_reference]=P-123
Expand relation
To get a expanded relations please take a look into Expanding objects.
Allowed expansion order_item_unit, media
Example of expanded relation
Request
GET /id-tags?expand=order_item_unit HTTP/1.1Response
{
data: [
{
"id": 1,
"order_item_unit": {
"id": 1,
"external_reference": "P-123",
"merchant": 1,
"order": 1,
"order_item": 1,
"merchant_variant": 100,
"id_tag": 1,
"state": "pending",
"created_at": "2023-02-07T13:17:06+00:00",
"updated_at": "2023-02-07T13:17:33+00:00"
},
"media": [],
"created_at": "2023-02-07T13:17:06+00:00",
"updated_at": "2023-02-07T13:17:06+00:00"
},
{
"id": 2,
"order_item_unit": {
"id": 2,
"external_reference": "P-456",
"merchant": 1,
"order": 2,
"order_item": 2,
"merchant_variant": 200,
"id_tag": 2,
"state": "pending",
"created_at": "2023-02-07T13:17:06+00:00",
"updated_at": "2023-02-07T13:17:33+00:00"
},
"media": [],
"created_at": "2023-02-07T13:17:06+00:00",
"updated_at": "2023-02-07T13:17:06+00:00"
}
],
"links": {
"first": null,
"last": null,
"prev": null,
"next": "https://api.smake.io/master-administration/id-tags?cursor=eyJwcm9kdWN0aW9uX3ZhcmlhbnRzLmlkIjoyMDIsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0"
},
"meta": {
"path": "https://api.smake.io/master-administration/id-tags",
"per_page": 15,
"next_cursor": "eyJwcm9kdWN0aW9uX3ZhcmlhbnRzLmlkIjoyMDIsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0",
"prev_cursor": null
}
}GET
Return a id tag of given id = x.
Example of fetching specified id tag information
Request
GET /id-tags/1 HTTP/1.1Response
{
"id": 1,
"order_item_unit": 1,
"media": [],
"created_at": "2023-02-07T13:17:06+00:00",
"updated_at": "2023-02-07T13:17:06+00:00"
}Mark as printed
To mark an id tag as printed. This can be used if the id tag is printed outside of the smake production.
Example of marking an id tag as printed
Request
PATCH /id-tags/1/printed HTTP/1.1
{}Response
HTTP/1.1 200 OK
{
"id": 1,
"order_item_unit": 1,
"media": [],
"created_at": "2023-02-07T13:17:06+00:00",
"updated_at": "2023-02-07T13:17:06+00:00"
}Validation Errors
If an id tag has already been printed, a validation error is returned:
HTTP/1.1 422 Unprocessable Entity
{
"message": "The id tag has already been printed.",
}