Create multi order payload example
Essential knowledge
Author:
Randy Chan
Changed on:
14 Jan 2025
Overview
- Example createOrder mutation payload for MULTI order type
Key points
- The example is just a reference payload only which can be used with order module reference workflow.
1POST: {{fluentApiHost}}/graphql
2
3
4QUERY:
5mutation createMBOrder(
6 $retailerId: ID!
7 $customerId: ID!
8 $orderRef: String!
9 $productCatalogueRef: String!
10 $fulfilmentChoiceRef1: String!
11 $fulfilmentChoiceRef2: String!
12) {
13 createOrder(
14 input: {
15 ref: $orderRef
16 retailer: { id: $retailerId }
17 type: "MULTI"
18 customer: { id: $customerId }
19 totalPrice: 100
20 totalTaxPrice: 0
21 items: [
22 {
23 ref: "2024SHOE001_A"
24 productRef: "2024SHOE001_A"
25 productCatalogueRef: $productCatalogueRef
26 price: 100
27 paidPrice: 100
28 totalPrice: 200
29 taxPrice: 0
30 totalTaxPrice: 0
31 taxType: "GST"
32 quantity:10
33 currency: "AUD"
34 fulfilmentChoiceRef: $fulfilmentChoiceRef1
35 },
36 {
37 ref: "2024SHOE001_B"
38 productRef:"2024SHOE001_B"
39 productCatalogueRef: $productCatalogueRef
40 price: 100
41 paidPrice: 100
42 totalPrice: 200
43 taxPrice: 0
44 totalTaxPrice: 0
45 taxType: "GST"
46 quantity: 2
47 currency: "AUD"
48 fulfilmentChoiceRef: $fulfilmentChoiceRef2
49 }
50 ]
51 fulfilmentChoices: [
52 {
53 ref:$fulfilmentChoiceRef1
54 type: "HD"
55 deliveryContact: "12345"
56 deliveryFirstName: "Bob"
57 deliverAfter: "2022-11-01T08:46:37.652Z"
58 deliverBefore: "2022-12-01T08:46:37.652Z"
59 currency: "AUD"
60 deliveryType: "STANDARD"
61 fulfilmentPrice: 5
62 fulfilmentTaxPrice: 0.99
63 deliveryAddress: {
64 ref: "Joe_Bob"
65 name: "Joe Bob"
66 companyName: ""
67 street: "48 George St"
68 city: "LIVERPOOL"
69 region: ""
70 postcode: "2170"
71 state: "NSW"
72 country: "Australia"
73 latitude: -33.9195927,
74 longitude: 150.9251352
75 }
76
77 }
78 {
79 ref:$fulfilmentChoiceRef2
80 currency: "AUD"
81 deliveryType: "STANDARD"
82 fulfilmentPrice: 0
83 fulfilmentTaxPrice: 0
84 type: "CC"
85 deliveryContact: "12345"
86 deliveryFirstName: "Peter"
87 deliverAfter: "2022-12-01T08:46:37.652Z"
88 deliverBefore: "2023-10-01T08:46:37.652Z"
89 pickupLocationRef: "B2C_SYD_5000067"
90 }
91 ]
92 }
93 ) {
94 id
95 ref
96 createdOn
97 items {
98 edges {
99 node {
100 id
101 quantity
102 }
103 }
104 }
105 }
106}
107
108
109GraphqlVariables:
110
111{
112 "retailerId": {{retailer_id}},
113 "customerId": {{last_customer_id}},
114 "orderRef": "MULTI_{{$randomInt}}_{{$randomInt}}",
115 "productCatalogueRef": "PC:MASTER:{{retailer_id}}",
116 "fulfilmentChoiceRef1": "fc1_{{$randomInt}}_{{$randomInt}}",
117 "fulfilmentChoiceRef2": "fc2_{{$randomInt}}_{{$randomInt}}"
118}
Language: json
Name: Multi order sample payload:
Description:
this sample payload consist of 2 line items and 2 fulfilment choices where fulfilment choice 1 is a HD delivery and the fulfilment choice 2 is a CC. it linked by a fulfilmentChoiceRef in items level.