GraphQL API
Search…
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:
1
{
2
channel: {
3
id: 1,
4
name: 'Partner'
5
}
6
channelCreatedDate: '1994-11-05T13:15:30Z',
7
channelOrderName: '#1001',
8
paymentProcessor: 'Klarna',
9
currency: "NOK",
10
customer: {
11
fullName: 'Jane Doe',
12
13
phone: '+4563727263',
14
shippingContactName: 'Jane Doe',
15
shippingAddress: 'my strret',
16
shippingCity: 'my city',
17
shippingState: 'my state',
18
shippingZip: 'my city',
19
shippingCountry: 'NO',
20
billingName: 'Jane Doe',
21
billingAddress: 'my strret billing',
22
billingZip: 'my zip billing',
23
billingCity: 'my city billing',
24
billingState: 'Oslo',
25
billingCountry: 'NO',
26
},
27
items: [
28
{
29
productId: 25,
30
quantity: 1,
31
priceChannel: 100
32
variantTitle: "M-White"
33
}
34
]
35
shippingItems: [
36
{
37
code: "1214089-FRP",
38
title: "Flat rate price to NO",
39
price: 25
40
}
41
]
42
}
Copied!

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.
1
mutation {
2
checkoutComplete(
3
checkoutId: "fd18c322-f816-406b-a71f-d9ce6a39c768"
4
) {
5
order {
6
id
7
status
8
}
9
errors {
10
field
11
message
12
}
13
}
14
}
Copied!
Response:
1
{
2
"data": {
3
"checkoutComplete": {
4
"order": {
5
"id": "T3JkZXI6MjU=",
6
"status": "PROCESSING"
7
},
8
"errors": []
9
}
10
}
11
}
Copied!

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.
1
query {
2
orders {
3
id
4
channel
5
channelOrderName
6
channelCreatedDate
7
currency
8
paymentProcessor
9
shippingPrice
10
shippingTitle
11
shippingCode
12
reseller {
13
id
14
username
15
}
16
status
17
items {
18
id
19
quantity
20
status
21
product {
22
id
23
title
24
}
25
supplier {
26
id
27
username
28
}
29
}
30
}
31
}
Copied!
Response:
1
{
2
"data": {
3
"orders": [
4
{
5
"id": 1082,
6
"channel": {
7
"id": "pi_3Jp7n6CClYvoTSYs0TUE6Fyd",
8
"name": "Wordpress"
9
}
10
"channelOrderName": "#pi_3Jp7n6CClYvoTSYs0TUE6Fyd",
11
"channelCreatedDate": "2021-10-27T08:47:24.000Z",
12
"currency": "NOK",
13
"paymentProcessor": "STRIPE",
14
"shippingPrice": "100.00",
15
"shippingTitle": "Flat rate price to NO",
16
"shippingCode": "3919-FRP",
17
"items": [
18
{
19
"id": 1470,
20
"quantity": 1,
21
"status": "PROCESSING",
22
"product": {
23
"id": 3919,
24
"title": "Product 1:1",
25
},
26
"supplier": {
27
"id": 478,
28
"username": "supplieredvin"
29
},
30
}
31
],
32
"reseller": {
33
"id": 476,
34
"username": "selleriqplus",
35
},
36
"status": "PROCESSING"
37
},
38
...
39
]
40
}
41
}
Copied!

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.
1
mutation {
2
orderItemCancel(
3
orderId: "4b22fbc0-b095-4937-a08e-bd18d04c951a",
4
itemId: "1470"
5
) {
6
order {
7
items {
8
id
9
status
10
}
11
}
12
}
13
}
Copied!
Response:
1
{
2
"data": {
3
"order": {
4
"items": [
5
{
6
"id": 1470,
7
"status": "CANCELLED",
8
},
9
...
10
]
11
}
12
}
13
}
Copied!