Finding Global Trade Item Numbers (GTINs)
To create orders for blank products, you need the product's GTIN. This identifier ensures you are ordering the correct variant (size, color, style).
1. Get Blank Products
Use the getBlankProducts query to retrieve a list of available blank products. This query returns BlankVariantDetail objects, which contain the gtin field.
Query Example
query GetBlankProducts {
getBlankProducts(limit: 10) {
id
name
gtin # <--- This is the value you need
color
size
style
blankProductId
}
}
Response Example
{
"data": {
"getBlankProducts": [
{
"id": "bv_12345",
"name": "Classic T-Shirt - Black - L",
"gtin": "00123456789012",
"color": "Black",
"size": "L"
}
]
}
}
2. Use GTIN to Create Order
Once you have the gtin, use it in the createOrderFromGtin mutation.
Pass the GTIN in the gtin field of each item in the orderItems list.
Mutation Example
mutation CreateOrderFromGtin {
createOrderFromGtin(
input: {
orderNumber: "ORD-1001"
shopId: "shop_123"
shippingAddress: {
name: "John Doe"
address1: "123 Main St"
city: "New York"
country: "US"
}
orderItems: [
{
gtin: "00123456789012" # <--- Pass the GTIN here
quantity: 1
price: 19.99
}
]
}
) {
id
orderNumber
shipped
cancelled
}
}
Note: The
createOrderFromGtinmutation usesOrderItemGtinInput, which acceptsgtin,quantity,price,name,tax,discount,images, and other optional fields. See the API reference for the full input type.