Skip to main content

orderAddItem Mutation

Description

Adds an inventory listing as a new line item on an order.

mutation orderAddItem($orderId: String!, $listingRef: ID!) {
orderAddItem(orderId: $orderId, listingRef: $listingRef) {
_id
id
incId
origin
created
modified
shipping {
status
fulfilled
date
method
freeShippingThreshold
tracking
shopCollection
weight
packingSlip
}
billing {
status
fulfilled
paymentDate
refundDate
}
orderId
notes {
date
content
}
instructions
totals {
subtotal
subtotalBeforeTaxes
tax
grand
leftToPay
itemQuantity
discount
shipping
creditNote
balance
}
items {
_id
quantity
unavailable
added
}
messages {
_id
created
subject
message
fromBuyer
flagged
content
read
orderId
orderIncId
uri
via
}
buyer {
_id
firstName
lastName
email
name
path
telephone
organisation
taxNumber
}
logs {
action
description
date
ip
}
seller {
type
name
email
ref
}
updated
status
discogsStatus
buyerWasContacted
unreadMessagesCount
mergeableOrders {
_id
id
created
total
description
}
path
}
}

Variables

{
"orderId": "orderId",
"listingRef": "85cbe6f19e550c03cee0e9c3"
}

Response

{
"orderAddItem": {
"_id": "4a76f75c5f2a34c320e9c077",
"id": "example",
"incId": 42,
"origin": "example",
"created": 1720501489128,
"modified": 1777734169848,
"shipping": {
"status": "Pending",
"fulfilled": true,
"date": 1763698905814,
"method": "example",
"freeShippingThreshold": 1.23,
"tracking": "example",
"shopCollection": true,
"weight": 1.23,
"packingSlip": "example"
},
"billing": {
"status": "example",
"fulfilled": true,
"paymentDate": 1742910119426,
"refundDate": 1771410445086
},
"orderId": "example",
"notes": [
{
"date": 1779678099670,
"content": "example"
}
],
"instructions": "example",
"totals": {
"subtotal": 1.23,
"subtotalBeforeTaxes": 1.23,
"tax": 1.23,
"grand": 1.23,
"leftToPay": 1.23,
"itemQuantity": 1.23,
"discount": 0.1,
"shipping": 1.23,
"creditNote": 1.23,
"balance": 1.23
},
"items": [
{
"_id": "771de2a6f8d763faea044df6",
"quantity": 1,
"unavailable": true,
"added": 1743083500153
}
],
"messages": [
{
"_id": "ff6ea1fd25d4f1fdd3426298",
"created": 1738956262753,
"subject": "example",
"message": "example",
"fromBuyer": true,
"flagged": true,
"content": "example",
"read": true,
"orderId": "example",
"orderIncId": 42,
"uri": "https://www.my-common-ground-store.com/release/1763553751/release-artist-release-name",
"via": "example"
}
],
"buyer": {
"_id": "2875054a4d5b6bd3b23b8a33",
"firstName": "example",
"lastName": "example",
"email": "email@example.com",
"name": "example",
"path": "/release/1763553751/release-artist-release-name",
"telephone": "example",
"organisation": "example",
"taxNumber": "example"
},
"logs": [
{
"action": "example",
"description": "example",
"date": 1776804280791,
"ip": "example"
}
],
"seller": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "b9661066e13ce6d252f0f6ad"
},
"updated": 1779283922970,
"status": "example",
"discogsStatus": "example",
"buyerWasContacted": true,
"unreadMessagesCount": 42,
"mergeableOrders": [
{
"_id": "13e6542bbb747b38e0a0cf70",
"id": "example",
"created": 1769651427140,
"total": 29.99,
"description": "example"
}
],
"path": "/release/1763553751/release-artist-release-name"
}
}

Arguments

NameTypeDescription
orderIdString!Human-readable id of the order (order.id) to add the item to.
listingRefID!Reference ID of the listing to add.

Returns

Order!