Skip to main content

orderAddPaymentMethod Mutation

Description

Adds a payment method to an order. The payment amount is added to the order's payment methods. If markAsPaid is true and the order status is "New Order" or "Invoice Sent", the order status is updated to "Payment Received". For marketplace orders, the status may also be synchronized with the marketplace.

mutation orderAddPaymentMethod(
$orderRef: ID!
$orderPaymentMethodInput: OrderPaymentMethodInput!
$markAsPaid: Boolean
) {
orderAddPaymentMethod(
orderRef: $orderRef
orderPaymentMethodInput: $orderPaymentMethodInput
markAsPaid: $markAsPaid
) {
_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": "5150f4330ee40c7d787bad6f",
"orderPaymentMethodInput": {
"origin": "origin",
"amount": 29.99,
"ref": "c201091e512649b4c0ddac33",
"added": 1750477553668
},
"markAsPaid": true
}

Response

{
"orderAddPaymentMethod": {
"_id": "43ef2b391f14961876a6f4a5",
"id": "example",
"incId": 42,
"origin": "example",
"created": 1752569624788,
"modified": 1762158770512,
"shipping": {
"status": "Pending",
"fulfilled": true,
"date": 1724562237564,
"method": "example",
"freeShippingThreshold": 1.23,
"tracking": "example",
"shopCollection": true,
"weight": 1.23,
"packingSlip": "example"
},
"billing": {
"status": "example",
"fulfilled": true,
"paymentDate": 1764095453730,
"refundDate": 1757519119288
},
"orderId": "example",
"notes": [
{
"date": 1718465235204,
"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": "f48a474b0ba3080d22997cf0",
"quantity": 1,
"unavailable": true,
"added": 1762680269019
}
],
"messages": [
{
"_id": "7919e4edb07e544d54d2df34",
"created": 1719712644959,
"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": "ba1b18c3256570385011c0fb",
"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": 1718560395797,
"ip": "example"
}
],
"seller": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "2622fa6e677a313690bece1f"
},
"updated": 1741163549721,
"status": "example",
"discogsStatus": "example",
"buyerWasContacted": true,
"unreadMessagesCount": 42,
"mergeableOrders": [
{
"_id": "efe1b916735d98ccaf8464e0",
"id": "example",
"created": 1750732819262,
"total": 29.99,
"description": "example"
}
],
"path": "/release/1763553751/release-artist-release-name"
}
}

Arguments

NameTypeDescription
orderRefID!Reference ID of the order to add a payment method to.
orderPaymentMethodInputOrderPaymentMethodInput!Payment method details including origin, amount, optional reference, and date.
markAsPaidBooleanWhether to automatically mark the order as paid after adding the payment method. If true, updates the order status to "Payment Received" if applicable.

Returns

Order!