generateBarcode
Requires permission products:product:update.
Generates an EAN-13 barcode number from a SKU. The same SKU always gives the same number, and nothing is stored. Requires permission to update products.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation GenerateBarcode($sku: String!) {
generateBarcode(sku: $sku)
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation GenerateBarcode($sku: String!) {\n generateBarcode(sku: $sku)\n}",
"variables": {
"sku": "string"
}
}
EOF
Variables:
{
"sku": "string"
}
Response:
{
"data": {
"generateBarcode": "string"
}
}
generateBarcode(
sku: String!
): String!
Arguments
generateBarcode.sku ● String! non-null scalar
The SKU to derive the barcode from.
Type
String scalar
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.