GraphQL API
Search…
⌃K

Orders

Create, update and get an order in the Outshifter Platform.

Create new order

Once the payment was successful, this means that the checkout is finished and the order can be created.
An order mutation will transform the checkout data into an order. It should include:
  • channel
  • final customer
  • purchased products
  • shipping costs
  • payment processor
Example of required fields in a checkout object before the checkoutComplete mutation activates the order creation:
{
channel: {
id: 1,
name: 'Partner'
}
channelCreatedDate: '1994-11-05T13:15:30Z',
channelOrderName: '#1001',
paymentProcessor: 'Klarna',
currency: "NOK",
customer: {
fullName: 'Jane Doe',
phone: '+4563727263',
shippingContactName: 'Jane Doe',
shippingAddress: 'my strret',
shippingCity: 'my city',
shippingState: 'my state',
shippingZip: 'my city',
shippingCountry: 'NO',
billingName: 'Jane Doe',
billingAddress: 'my strret billing',
billingZip: 'my zip billing',
billingCity: 'my city billing',
billingState: 'Oslo',
billingCountry: 'NO',
},
items: [
{
productId: 25,
quantity: 1,
priceChannel: 100
variantTitle: "M-White"
}
]
shippingItems: [
{
code: "1214089-FRP",
title: "Flat rate price to NO",
price: 25
}
]
}

Checkout Mutation

The checkoutComplete mutation just needs as an input:
  • checkoutId: the unique id of the previously created checkout
This action will create the order and it will take data from the checkout object.
mutation {
checkoutComplete(
checkoutId: "fd18c322-f816-406b-a71f-d9ce6a39c768"
) {
order {
id
status
}
errors {
field
message
}
}
}
Response:
{
"data": {
"checkoutComplete": {
"order": {
"id": "T3JkZXI6MjU=",
"status": "PROCESSING"
},
"errors": []
}
}
}

Get orders

You can retrieve all orders from a seller that have been processed throughout the partners specific storefront. You will not receive all seller orders but just the ones of that channel.
You can query the orders and select the fields you are interested in receiving.
query {
orders {
id
channel
channelOrderName
channelCreatedDate
currency
paymentProcessor
shippingPrice
shippingTitle
shippingCode
reseller {
id
username
}
status
items {
id
quantity
status
product {
id
title
}
supplier {
id
username
}
}
}
}
Response:
{
"data": {
"orders": [
{
"id": 1082,
"channel": {
"id": "pi_3Jp7n6CClYvoTSYs0TUE6Fyd",
"name": "Wordpress"
}
"channelOrderName": "#pi_3Jp7n6CClYvoTSYs0TUE6Fyd",
"channelCreatedDate": "2021-10-27T08:47:24.000Z",
"currency": "NOK",
"paymentProcessor": "STRIPE",
"shippingPrice": "100.00",
"shippingTitle": "Flat rate price to NO",
"shippingCode": "3919-FRP",
"items": [
{
"id": 1470,
"quantity": 1,
"status": "PROCESSING",
"product": {
"id": 3919,
"title": "Product 1:1",
},
"supplier": {
"id": 478,
"username": "supplieredvin"
},
}
],
"reseller": {
"id": 476,
"username": "selleriqplus",
},
"status": "PROCESSING"
},
...
]
}
}

Cancel an order item

This endpoint allows a customer to update the order item status to “CANCELED”.
Take into account, that the cancellation is item based, and not order based. So if the order has only one product, the whole order will be cancelled, but if it has several products, you will need to cancel each one individually if it corresponds.
Order cancellation is available only before shipping. If the customer has already received the items or they have already been shipped, then a return form must be completed in the Outshifter's return solution.
Item cancellation will also trigger an intern email to the supplier, the seller and the customer.
Use the ordeItemCancel mutation to update the status of the item to cancelled.
As arguments, you will need to provide:
  • orderId: unique identifier of the order.
  • itemId: each item has a unique id.
mutation {
orderItemCancel(
orderId: "4b22fbc0-b095-4937-a08e-bd18d04c951a",
itemId: "1470"
) {
order {
items {
id
status
}
}
}
}
Response:
{
"data": {
"order": {
"items": [
{
"id": 1470,
"status": "CANCELLED",
},
...
]
}
}
}