Skip to main content

itemCreate Mutation

Description

Creates a new item of the specified type (BookItem, ReleaseItem, or ProductItem) with optional descriptions and listings. For ReleaseItem with a discogsId, the release data will be imported from Discogs if the method parameter is provided.

mutation itemCreate(
$type: String!
$descriptions: ItemInputDescriptions
$listings: [ItemListingInput]
$itemCreateBookInput: ItemBookInput
$itemCreateReleaseInput: ItemReleaseInput
$itemCreateProductInput: ItemProductInput
$method: String
) {
itemCreate(
type: $type
descriptions: $descriptions
listings: $listings
itemCreateBookInput: $itemCreateBookInput
itemCreateReleaseInput: $itemCreateReleaseInput
itemCreateProductInput: $itemCreateProductInput
method: $method
) {
_id
id
type
incId
uniqueId
oldId
created
modified
seo {
index
description
slug
title
}
isForbiddenForSale
logs {
action
description
date
ip
}
handle
path
uri
wants
bitly
descriptions {
main
}
listings {
_id
id
status
comments
privateComments
location
discogsId
taxDefinition
preventDiscogsListing
readOnly
onePerCustomer
supplierCode
sku
barcode
posted
available
preOrder
categories
archived
secondHand
}
data {
id
assetLink
thumb
title
discogsId
country
releaseDate
weight
genres
year
styles
manufacturer
cat
type
subtitle
authors
publisher
publishedDate
pageCount
categories
maturityRating
language
search
format
}
}
}

Variables

{
"type": "type",
"descriptions": {
"short": "short",
"long": "long"
},
"listings": [
{
"stock": {
"quantity": 1
},
"status": "status",
"available": 1746241581905,
"posted": "posted",
"secondHand": true,
"location": "location",
"supplierCode": "supplierCode",
"categories": [
"categories"
],
"comments": "comments",
"taxDefinition": "taxDefinition",
"options": [
{
"name": "A name",
"value": "value"
}
],
"prices": {
"cost": 29.99,
"sale": 30.7,
"beforeTaxes": 30.7,
"compare": 30.7
},
"barcode": "barcode",
"sku": "sku",
"privateComments": "privateComments",
"onePerCustomer": true,
"preventDiscogsListing": true,
"preOrder": true,
"discogsId": 987654321
}
],
"itemCreateBookInput": {
"title": "title",
"subtitle": "subtitle",
"authors": [
"authors"
],
"publisher": "publisher",
"categories": [
"categories"
],
"pageCount": 42,
"language": "language",
"publishedDate": 1766006269282,
"weight": 230,
"format": "format",
"assetLink": "assetLink",
"images": [
{
"uri": "https://www.my-common-ground-store.com/release/1763553751/release-artist-release-name",
"width": 30.7,
"height": 30.7,
"alternative": null
}
],
"identifiers": [
{
"type": "type",
"description": "A description",
"value": "value"
}
]
},
"itemCreateReleaseInput": {
"discogsId": 987654321,
"title": "title",
"identifiers": [
{
"type": "type",
"description": "A description",
"value": "value"
}
],
"country": "Canada",
"formats": [
{
"qty": "qty",
"name": "A name",
"descriptions": [
"A description"
],
"text": "text"
}
],
"tracklist": [
{
"artists": [
{
"id": 3216774474265,
"anv": "anv",
"name": "A name",
"role": "role"
}
],
"type_": "type_",
"title": "title",
"position": "position",
"duration": "duration"
}
],
"releaseDate": 1730738140580,
"weight": 230,
"genres": [
"genres"
],
"styles": [
"styles"
],
"images": [
{
"uri": "https://www.my-common-ground-store.com/release/1763553751/release-artist-release-name",
"width": 30.7,
"height": 30.7,
"alternative": null
}
],
"artists": [
{
"id": 9733631333176,
"role": "role",
"anv": "anv",
"name": "A name",
"join": "join"
}
],
"year": 42,
"assetLink": "assetLink",
"labels": [
{
"id": 5111479856351,
"catno": "catno",
"name": "A name"
}
],
"videos": [
{
"duration": 42,
"title": "title",
"uri": "https://www.my-common-ground-store.com/release/1763553751/release-artist-release-name"
}
]
},
"itemCreateProductInput": {
"title": "title",
"images": [
{
"uri": "https://www.my-common-ground-store.com/release/1763553751/release-artist-release-name",
"width": 30.7,
"height": 30.7,
"alternative": null
}
],
"identifiers": [
{
"type": "type",
"description": "A description",
"value": "value"
}
],
"manufacturer": "manufacturer",
"cat": "cat",
"type": "type",
"weight": 230,
"assetLink": "assetLink",
"giftCard": {
"active": true,
"codeLength": 42,
"prefix": "prefix",
"singleSpending": true
}
},
"method": "method"
}

Response

{
"itemCreate": {
"_id": "6778662af75313fe023580cb",
"id": 1.23,
"type": "ReleaseItem",
"incId": 1.23,
"uniqueId": "example",
"oldId": 1.23,
"created": 1757857728099,
"modified": 1708482832152,
"seo": {
"index": true,
"description": "example",
"slug": "example",
"title": "example"
},
"isForbiddenForSale": true,
"logs": [
{
"action": "example",
"description": "example",
"date": 1738297002751,
"ip": "example"
}
],
"handle": "example",
"path": "/release/1763553751/release-artist-release-name",
"uri": "https://www.my-common-ground-store.com/release/1763553751/release-artist-release-name",
"wants": 42,
"bitly": "example",
"descriptions": {
"main": "example"
},
"listings": [
{
"_id": "ce990f7fb56dd7e0f1c47788",
"id": 1.23,
"status": "example",
"comments": "example",
"privateComments": "example",
"location": "example",
"discogsId": 987654321,
"taxDefinition": "example",
"preventDiscogsListing": true,
"readOnly": true,
"onePerCustomer": true,
"supplierCode": "example",
"sku": "example",
"barcode": "example",
"posted": 1749492233887,
"available": 1745289805811,
"preOrder": true,
"categories": [
"example"
],
"archived": true,
"secondHand": true
}
],
"data": {
"id": 1.23,
"assetLink": "example",
"thumb": "example",
"title": "example",
"discogsId": 987654321,
"country": "example",
"releaseDate": 1745558166488,
"weight": 1.23,
"genres": [
"example"
],
"year": 42,
"styles": [
"example"
],
"manufacturer": "example",
"cat": "example",
"type": "example",
"subtitle": "example",
"authors": [
"example"
],
"publisher": "example",
"publishedDate": 1729603413008,
"pageCount": 42,
"categories": [
"example"
],
"maturityRating": "example",
"language": "example",
"search": "example",
"format": "example"
}
}
}

Arguments

NameTypeDescription
typeString!Type of item to create. Valid values are "BookItem", "ReleaseItem", or "ProductItem".
descriptionsItemInputDescriptionsShort and long descriptions for the item.
listings[ItemListingInput]List of listings to create along with the item. Each listing must include stock quantity, status, available date, and pricing information.
itemCreateBookInputItemBookInputBook-specific data. Required if type is "BookItem".
itemCreateReleaseInputItemReleaseInputRelease-specific data. Required if type is "ReleaseItem". If discogsId is provided, the release will be imported from Discogs.
itemCreateProductInputItemProductInputProduct-specific data. Required if type is "ProductItem".
methodStringMethod for creating the item. Used when importing from Discogs to control behavior.

Returns

Item!