Skip to main content

Add payment and billing information to an order

Add payment information​

Add payment information to an order with the payment field that takes the OrderPaymentInput type.

You need to specify:

GraphQL mutation
mutation {
upsertOrder(
input: {
referenceId: "123456",
createdAt: $date,
payment: {
method: "card"
status: PENDING
}
}
)
}

If the customer wants to pay for the order upon delivery, set the cashOnDelivery field which requires a MoneyInput type:

GraphQL mutation
mutation {
upsertOrder(
input: {
referenceId: "123456",
createdAt: $date,
cashOnDelivery: {
amount: 13599,
currency: HUF
}
}
)
}

When the order is paid, change the payment status and add the date of payment: the paidAt field requires a date in the Y-m-d\TH:i:sP format.

GraphQL mutation
mutation {
upsertOrder(
input: {
referenceId: "123456",
createdAt: $date,
payment: {
method: "card"
status: PAID,
paidAt: "2026-01-17T14:32:10+01:00"
}
}
)
}

Add billing information​

When creating or updating an order, you can add billing information with the billing field of the upsertOrder mutation. You can provide:

  • A name
  • An email address
  • A phone number
  • An address
  • A VAT number, if applicable

With the isCompany field, you can also specify if the bill will be paid by a company or a private individual.

GraphQL mutation
mutation {
upsertOrder(
input: {
referenceId: "123456",
createdAt: $date,
billing: {
name: "Most Excellent Customer",
email: "examplemail@example.org",
phone: "00 01 123 4567",
vatNumber: "8337961152"
isCompany: true
}
}
)
}

To add the address, as a minimum you need:

In addition:

  • You can add a state field: it can be used for any type of administrative subdivision of a country, if you need it.
  • If the address is longer and more complex, you can add addressLine2.
  • Add a note to include additional information about the address.
GraphQL mutation
mutation {
upsertOrder(
input: {
referenceId: "123456",
createdAt: $date,
billing: {
name: "Most Excellent Customer",
email: "examplemail@example.org",
phone: "00 01 123 4567",
vatNumber: "8337961152"
isCompany: true,
address: {
country: CA,
state: "Ontario"
city: "Ottawa",
postalCode: "K2C 0A6",
addressLine1: "1026 Baseline Rd",
addressLine2: "Building B, 4th floor"
note: "The receptionist is grumpy"
}
}
}
)
}