Skip to main content

orderGeneratePdf Mutation

Description

Generates a PDF invoice for an order and updates the order with the generated PDF URL. The PDF is stored and can be accessed via the order's invoice PDF field.

mutation orderGeneratePdf($orderRef: ID!) {
orderGeneratePdf(orderRef: $orderRef) {
_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

{
"orderRef": "7ea7f00a9ba2ca98d8ba8f36"
}

Response

{
"orderGeneratePdf": {
"_id": "ca7bef444e26123af4090e64",
"id": "example",
"incId": 42,
"origin": "example",
"created": 1708148807699,
"modified": 1730285505063,
"shipping": {
"status": "Pending",
"fulfilled": true,
"date": 1722294996246,
"method": "example",
"freeShippingThreshold": 1.23,
"tracking": "example",
"shopCollection": true,
"weight": 1.23,
"packingSlip": "example"
},
"billing": {
"status": "example",
"fulfilled": true,
"paymentDate": 1754887956435,
"refundDate": 1743863267554
},
"orderId": "example",
"notes": [
{
"date": 1730513872103,
"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": "c3af0d7b225fdc74f71dcd9e",
"quantity": 1,
"unavailable": true,
"added": 1722990970369
}
],
"messages": [
{
"_id": "6bd522038cf47e1201af454b",
"created": 1734087885372,
"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": "91b1af7436cae31e829c7019",
"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": 1719260716898,
"ip": "example"
}
],
"seller": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "4e1f10ec454ef6c1b8ccad5b"
},
"updated": 1750849202707,
"status": "example",
"discogsStatus": "example",
"buyerWasContacted": true,
"unreadMessagesCount": 42,
"mergeableOrders": [
{
"_id": "6315b7ac4bcab603ec3e51c5",
"id": "example",
"created": 1742598818751,
"total": 29.99,
"description": "example"
}
],
"path": "/release/1763553751/release-artist-release-name"
}
}

Arguments

NameTypeDescription
orderRefID!Reference ID of the order to generate a PDF invoice for.

Returns

Order!