@shushed/helpers 0.0.289 → 0.0.291

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/cjs/contracts/order/address.schema.json +14 -18
  2. package/dist/cjs/contracts/order/item.schema.json +6 -1
  3. package/dist/cjs/contracts/order/payment.schema.json +4 -4
  4. package/dist/cjs/contracts/order/shipment/item.schema.json +6 -1
  5. package/dist/cjs/contracts/order/shipment.schema.json +14 -0
  6. package/dist/cjs/contracts/order.schema.json +53 -53
  7. package/dist/cjs/dist-dereferenced/messages/order/delivered.js +1 -1
  8. package/dist/cjs/dist-dereferenced/messages/order/new.js +1 -1
  9. package/dist/cjs/dist-dereferenced/messages/order/processed.js +1 -1
  10. package/dist/cjs/dist-dereferenced/messages/order/return-initiated.js +1 -1
  11. package/dist/cjs/dist-dereferenced/messages/order/returned.js +1 -1
  12. package/dist/cjs/dist-dereferenced/messages/order/shipped.js +1 -1
  13. package/dist/cjs/dist-dereferenced/order/address.js +1 -1
  14. package/dist/cjs/dist-dereferenced/order/customer.js +1 -1
  15. package/dist/cjs/dist-dereferenced/order/item.js +1 -1
  16. package/dist/cjs/dist-dereferenced/order/orderMain.js +1 -1
  17. package/dist/cjs/dist-dereferenced/order/payment.js +1 -1
  18. package/dist/cjs/dist-dereferenced/order/shipment/item/itemMain.js +1 -1
  19. package/dist/cjs/dist-dereferenced/order/shipment/item/returned.js +1 -1
  20. package/dist/cjs/dist-dereferenced/order/shipment/pos/outbound.js +1 -1
  21. package/dist/cjs/dist-dereferenced/order/shipment/pos/posMain.js +1 -1
  22. package/dist/cjs/dist-dereferenced/order/shipment/pos/return.js +1 -1
  23. package/dist/cjs/dist-dereferenced/order/shipment/shipmentMain.js +1 -1
  24. package/dist/cjs/dist-dereferenced/order/shipment/shipped/outbound.js +1 -1
  25. package/dist/cjs/dist-dereferenced/order/shipment/shipped/return.js +1 -1
  26. package/dist/cjs/dist-dereferenced/order/shipment/shipped/shippedMain.js +1 -1
  27. package/dist/cjs/src-public/bcOrder.js +167 -154
  28. package/dist/cjs/src-public/pubsub.js +0 -1
  29. package/dist/package.json +1 -0
  30. package/dist/types/dist-dereferenced/messages/order/delivered.d.ts +117 -105
  31. package/dist/types/dist-dereferenced/messages/order/new.d.ts +117 -105
  32. package/dist/types/dist-dereferenced/messages/order/processed.d.ts +117 -105
  33. package/dist/types/dist-dereferenced/messages/order/return-initiated.d.ts +117 -105
  34. package/dist/types/dist-dereferenced/messages/order/returned.d.ts +117 -105
  35. package/dist/types/dist-dereferenced/messages/order/shipped.d.ts +117 -105
  36. package/dist/types/dist-dereferenced/order/address.d.ts +10 -14
  37. package/dist/types/dist-dereferenced/order/customer.d.ts +10 -14
  38. package/dist/types/dist-dereferenced/order/index.d.ts +117 -105
  39. package/dist/types/dist-dereferenced/order/item.d.ts +3 -0
  40. package/dist/types/dist-dereferenced/order/orderMain.d.ts +117 -105
  41. package/dist/types/dist-dereferenced/order/payment.d.ts +2 -2
  42. package/dist/types/dist-dereferenced/order/shipment/index.d.ts +15 -1
  43. package/dist/types/dist-dereferenced/order/shipment/item/index.d.ts +4 -1
  44. package/dist/types/dist-dereferenced/order/shipment/item/itemMain.d.ts +4 -1
  45. package/dist/types/dist-dereferenced/order/shipment/item/returned.d.ts +4 -1
  46. package/dist/types/dist-dereferenced/order/shipment/pos/index.d.ts +15 -1
  47. package/dist/types/dist-dereferenced/order/shipment/pos/outbound.d.ts +15 -1
  48. package/dist/types/dist-dereferenced/order/shipment/pos/posMain.d.ts +15 -1
  49. package/dist/types/dist-dereferenced/order/shipment/pos/return.d.ts +15 -1
  50. package/dist/types/dist-dereferenced/order/shipment/shipmentMain.d.ts +15 -1
  51. package/dist/types/dist-dereferenced/order/shipment/shipped/index.d.ts +15 -1
  52. package/dist/types/dist-dereferenced/order/shipment/shipped/outbound.d.ts +15 -1
  53. package/dist/types/dist-dereferenced/order/shipment/shipped/return.d.ts +15 -1
  54. package/dist/types/dist-dereferenced/order/shipment/shipped/shippedMain.d.ts +15 -1
  55. package/dist/types/dist-types/messages/order/delivered.d.ts +14 -9
  56. package/dist/types/dist-types/messages/order/new.d.ts +14 -9
  57. package/dist/types/dist-types/messages/order/processed.d.ts +14 -9
  58. package/dist/types/dist-types/messages/order/return-initiated.d.ts +14 -9
  59. package/dist/types/dist-types/messages/order/returned.d.ts +14 -9
  60. package/dist/types/dist-types/messages/order/shipped.d.ts +14 -9
  61. package/dist/types/dist-types/order/address.d.ts +3 -3
  62. package/dist/types/dist-types/order/customer.d.ts +6 -6
  63. package/dist/types/dist-types/order/item.d.ts +1 -0
  64. package/dist/types/dist-types/order/orderMain.d.ts +14 -9
  65. package/dist/types/dist-types/order/payment.d.ts +2 -2
  66. package/dist/types/dist-types/order/shipment/item/itemMain.d.ts +1 -0
  67. package/dist/types/dist-types/order/shipment/item/returned.d.ts +1 -0
  68. package/dist/types/dist-types/order/shipment/pos/outbound.d.ts +4 -0
  69. package/dist/types/dist-types/order/shipment/pos/posMain.d.ts +4 -0
  70. package/dist/types/dist-types/order/shipment/pos/return.d.ts +4 -0
  71. package/dist/types/dist-types/order/shipment/shipmentMain.d.ts +4 -0
  72. package/dist/types/dist-types/order/shipment/shipped/outbound.d.ts +4 -0
  73. package/dist/types/dist-types/order/shipment/shipped/return.d.ts +4 -0
  74. package/dist/types/dist-types/order/shipment/shipped/shippedMain.d.ts +4 -0
  75. package/dist/types/src-public/pubsub.d.ts +0 -1
  76. package/package.json +2 -1
@@ -45,54 +45,50 @@
45
45
  },
46
46
  "company_name": {
47
47
  "type": "string",
48
- "maxLength": 30
48
+ "maxLength": 100
49
49
  },
50
50
  "first_name": {
51
- "type": "string",
52
- "maxLength": 30,
53
- "minLength": 1,
51
+ "type": ["string", "null"],
52
+ "maxLength": 50,
54
53
  "faker": { "name.firstName": [] },
55
- "description": "Recipient's first name."
54
+ "description": "Recipient's first name. Null for company/press orders without individual names."
56
55
  },
57
56
  "last_name": {
58
- "type": "string",
59
- "maxLength": 30,
60
- "minLength": 1,
57
+ "type": ["string", "null"],
58
+ "maxLength": 50,
61
59
  "faker": { "name.lastName": [] },
62
- "description": "Recipient's last name."
60
+ "description": "Recipient's last name. Null for company/press orders without individual names."
63
61
  },
64
62
  "address1": {
65
63
  "type": ["string"],
66
64
  "minLength": 1,
67
- "maxLength": 30,
65
+ "maxLength": 100,
68
66
  "faker": { "address.streetAddress": [] },
69
67
  "description": "Primary street address."
70
68
  },
71
69
  "address2": {
72
70
  "type": ["string", "null"],
73
- "maxLength": 30,
71
+ "maxLength": 100,
74
72
  "faker": { "address.secondaryAddress": [] },
75
73
  "description": "Additional address line (e.g., apartment or suite number)."
76
74
  },
77
75
  "city": {
78
- "type": ["string"],
79
- "maxLength": 30,
80
- "minLength": 1,
76
+ "type": ["string", "null"],
77
+ "maxLength": 50,
81
78
  "faker": { "address.city": [] },
82
- "description": "City or locality of the address."
79
+ "description": "City or locality of the address. Null when not provided in BC source data."
83
80
  },
84
81
  "region": {
85
82
  "type": ["string", "null"],
86
- "maxLength": 30,
83
+ "maxLength": 50,
87
84
  "faker": { "address.state": [] },
88
85
  "description": "State, province, or region of the address."
89
86
  },
90
87
  "post_code": {
91
88
  "type": ["string", "null"],
92
89
  "maxLength": 20,
93
- "pattern": "^[A-Z0-9 ]*$",
94
90
  "faker": { "address.zipCode": [] },
95
- "description": "Postal code (uppercase letters and numbers with spaces; optional for countries without postal codes).",
91
+ "description": "Postal code (optional for countries without postal codes).",
96
92
  "examples": ["SW1A 1AA", "90210", null]
97
93
  },
98
94
  "country_code": {
@@ -139,7 +139,12 @@
139
139
  "description": "Voucher code or campaign name for the purchase"
140
140
  },
141
141
  "cost_net": {
142
- "$ref": "https://shushed.example.com/money.schema.json"
142
+ "$ref": "https://shushed.example.com/money.schema.json",
143
+ "description": "Net cost per unit in smallest currency unit (from unit_cost_lcy)."
144
+ },
145
+ "order_line_no": {
146
+ "type": ["integer", "null"],
147
+ "description": "Original order line number from BC sales/invoice line. Used for cross-document tracing."
143
148
  }
144
149
  },
145
150
  "required": [
@@ -35,9 +35,9 @@
35
35
  "description": "The method used for the transaction."
36
36
  },
37
37
  "transaction_id": {
38
- "type": ["string"],
38
+ "type": ["string", "null"],
39
39
  "faker": { "custom.documentid": ["TR", 10] },
40
- "description": "Internal transaction reference ID."
40
+ "description": "Internal transaction reference ID. Derived from card_payment.transaction_id, payment.payment_gateway_token, or null if unavailable."
41
41
  },
42
42
  "card_number": {
43
43
  "type": ["string", "null"],
@@ -70,9 +70,9 @@
70
70
  "description": "Channel through which the payment was initiated."
71
71
  },
72
72
  "psp_reference": {
73
- "type": "string",
73
+ "type": ["string", "null"],
74
74
  "faker": { "custom.documentid": ["PSP", 10] },
75
- "description": "Reference provided by the Payment Service Provider (PSP)."
75
+ "description": "Reference provided by the Payment Service Provider (PSP). Same as transaction_id."
76
76
  },
77
77
  "card_brand": {
78
78
  "type": ["string", "null"],
@@ -11,6 +11,11 @@
11
11
  "faker": { "datatype.number": [1, 1] },
12
12
  "description": "Line number of the item in the order. Used for item referencing and tracking."
13
13
  },
14
+ "sku": {
15
+ "type": ["string"],
16
+ "faker": { "custom.sku": [] },
17
+ "description": "Stock Keeping Unit identifier matching the order item SKU (item_no-variant_code)."
18
+ },
14
19
  "quantity": {
15
20
  "type": ["integer"],
16
21
  "minimum": 1,
@@ -18,5 +23,5 @@
18
23
  "description": "The number of units of the item shipped."
19
24
  }
20
25
  },
21
- "required": ["lineNumber", "quantity"]
26
+ "required": ["lineNumber", "sku", "quantity"]
22
27
  }
@@ -71,6 +71,20 @@
71
71
  ],
72
72
  "description": "Voucher code or campaign name for the purchase"
73
73
  },
74
+ "courier_name": {
75
+ "type": ["string", "null"],
76
+ "enum": ["GLOBALE", "ROYALMAIL", "EVRI", "WAITROSE", null],
77
+ "description": "Name of the courier/shipping carrier handling the shipment."
78
+ },
79
+ "tracking_code": {
80
+ "type": ["string", "null"],
81
+ "description": "Tracking code or reference number provided by the courier."
82
+ },
83
+ "class_name": {
84
+ "type": ["string"],
85
+ "enum": ["STANDARD", "PRIORITY"],
86
+ "description": "Shipping service class. PRIORITY for express/24-hour, STANDARD for economy/48-hour."
87
+ },
74
88
  "items": {
75
89
  "type": [
76
90
  "array"
@@ -22,12 +22,12 @@
22
22
  "ARCHIVED",
23
23
  "FAILED"
24
24
  ],
25
- "description": "Current status of the order in the order lifecycle - Example: PENDING"
25
+ "description": "Current status of the order in the order lifecycle. Derived from shipment/return state: PROCESSED (no shipments), SHIPPED/PARTIALLY-SHIPPED (by shipped value), RETURNED/PARTIALLY-RETURNED (by credit memo value)."
26
26
  },
27
27
  "erp_order_id": {
28
28
  "type": "string",
29
29
  "faker": { "custom.documentid": ["MOCK", "8"] },
30
- "description": "Unique order identifier assigned by the ERP system - Example: XX12345678"
30
+ "description": "Unique order identifier assigned by the ERP system (Master Order No.) - Example: UK00012345"
31
31
  },
32
32
  "centra_order_id": {
33
33
  "type": ["integer", "null"],
@@ -35,22 +35,21 @@
35
35
  },
36
36
  "sfcc_order_id": {
37
37
  "type": ["string", "null"],
38
- "description": "Salesforce Commerce Cloud order identifier, nullable if not applicable - Example: XX123456789 or null"
38
+ "description": "Salesforce Commerce Cloud order identifier. Set from sale.no when created_by is STOREFRONT, else invoice.order_no. Nullable if not applicable."
39
39
  },
40
40
  "globale_order_id": {
41
41
  "type": ["string", "null"],
42
42
  "faker": { "custom.documentid": ["GEMOCK", "16"] },
43
- "description": "Identifier for Globale orders, nullable if not applicable - Example: GE00025734 or null"
43
+ "description": "Identifier for Global-E orders, sourced from invoice or sale globale_order_id. Nullable if not applicable."
44
44
  },
45
45
  "sitoo_order_id": {
46
46
  "type": ["string", "null"],
47
- "format": "uuid",
48
- "description": "Sitoo POS system order identifier, nullable if not applicable - Example: XX10008732 or null"
47
+ "description": "Sitoo POS system order identifier from master order. Nullable if not applicable."
49
48
  },
50
49
  "system_created_by": {
51
50
  "type": "string",
52
51
  "enum": ["POS", "ECOMMERCE", "SYSTEM"],
53
- "description": "Origin system or actor that created the order record - Example: POS"
52
+ "description": "Origin system that created the order: POS (from SITOO created_by), ECOMMERCE (from STOREFRONT), SYSTEM (default)."
54
53
  },
55
54
  "ordered_at": {
56
55
  "type": "string",
@@ -58,7 +57,7 @@
58
57
  "faker": {
59
58
  "date.between": ["2024-01-01T00:00:00.000Z", "2025-04-30T00:00:00.000Z"]
60
59
  },
61
- "description": "Timestamp when the order was placed - Example: 2024-12-25T15:30:00Z"
60
+ "description": "Timestamp when the order was placed. Priority: master_order.ordered_at > created_at > sale.system_created_at > earliest invoice.system_created_at."
62
61
  },
63
62
  "payments": {
64
63
  "type": "array",
@@ -68,20 +67,20 @@
68
67
  "maxItems": 2,
69
68
  "uniqueItems": true
70
69
  },
71
- "description": "List of payment transactions related to this order.",
70
+ "description": "Grouped payment transactions. Card payments and payment/refund entries are grouped by transaction_id/payment_gateway_token. Status: CAPTURED (successful), FAILED (declined), CANCELLED.",
72
71
  "example": [
73
72
  {
74
73
  "type": "CHARGE",
75
74
  "created_at": "2024-12-25T15:35:00Z",
76
75
  "payment_method": "CREDIT-CARD",
77
76
  "transaction_id": "TR123456789",
78
- "card_number": "4111111111111111",
79
- "journey_label": "CHECKOUT",
80
- "psp_reference": "PSP987654321",
81
- "card_brand": "VISA",
77
+ "card_number": "XXXX-XXXX-XXXX-1234",
78
+ "journey_label": null,
79
+ "psp_reference": "TR123456789",
80
+ "card_brand": "Visa",
82
81
  "status": "CAPTURED",
83
- "amount": { "currency": "USD", "value": 15000 },
84
- "created_by": "CUSTOMER"
82
+ "amount": { "currency": "GBP", "value": 15000, "decimal_places": 2, "lcy_value": 15000, "lcy_currency": "GBP", "lcy_decimal_places": 2 },
83
+ "created_by": "MOTO"
85
84
  }
86
85
  ]
87
86
  },
@@ -91,28 +90,31 @@
91
90
  },
92
91
  "is_gift": {
93
92
  "type": ["boolean"],
94
- "description": "Indicates if the order is marked as a gift - Example: true or false"
93
+ "description": "Derived from presence of gift_message on sale or invoice headers."
94
+ },
95
+ "is_pos": {
96
+ "type": ["boolean"],
97
+ "description": "True when order originated from POS (created_by is SITOO)."
95
98
  },
96
99
  "customer": {
97
100
  "$ref": "https://shushed.example.com/order/customer.schema.json",
98
- "description": "Customer details related to this order - Example: {}"
101
+ "description": "Customer details from BC customer record: first_name, surname, email, phone, addresses."
99
102
  },
100
103
  "billing_address": {
101
104
  "anyOf": [
102
105
  { "$ref": "https://shushed.example.com/order/address.schema.json" },
103
106
  { "type": ["null"] }
104
107
  ],
105
- "description": "Billing address for the order, nullable if unavailable.",
108
+ "description": "Billing address from invoice or sale header bill_to_* fields.",
106
109
  "example": {
107
110
  "first_name": "Alice",
108
111
  "last_name": "Johnson",
109
112
  "address1": "123 Main St",
110
113
  "address2": "Apt 4B",
111
- "city": "New York",
112
- "region": "NY",
113
- "post_code": "10001",
114
- "country_code": "US",
115
- "phone": "+1-202-555-0143"
114
+ "city": "London",
115
+ "post_code": "SW1A 1AA",
116
+ "country_code": "GB",
117
+ "phone": "+44 7700 900000"
116
118
  }
117
119
  },
118
120
  "shipping_address": {
@@ -120,27 +122,22 @@
120
122
  { "$ref": "https://shushed.example.com/order/address.schema.json" },
121
123
  { "type": ["null"] }
122
124
  ],
123
- "description": "Shipping address for the order, nullable if unavailable.",
125
+ "description": "Shipping address from invoice or sale header ship_to_* fields.",
124
126
  "example": {
125
127
  "first_name": "Alice",
126
128
  "last_name": "Johnson",
127
129
  "address1": "123 Main St",
128
130
  "address2": "Apt 4B",
129
- "city": "New York",
130
- "region": "NY",
131
- "post_code": "10001",
132
- "country_code": "US",
133
- "phone": "+1-202-555-0143"
131
+ "city": "London",
132
+ "post_code": "SW1A 1AA",
133
+ "country_code": "GB",
134
+ "phone": "+44 7700 900000"
134
135
  }
135
136
  },
136
137
  "collection_point_id": {
137
- "type": [
138
- "string",
139
- "null"
140
- ],
141
- "description": "Collection point ID reference if applicable - Example: EVRI-S41902"
138
+ "type": ["string", "null"],
139
+ "description": "Collection point ID reference for click-and-collect orders - Example: EVRI-S41902"
142
140
  },
143
- "is_pos": { "type": ["boolean"], "description": "Flag indicating if the order was placed via a POS system example: true or false" },
144
141
  "shipments": {
145
142
  "type": "array",
146
143
  "minItems": 1,
@@ -177,19 +174,22 @@
177
174
  "maxItems": 2,
178
175
  "uniqueItems": true
179
176
  },
180
- "description": "List of shipments related to the order, including outbound and return shipments",
177
+ "description": "Outbound shipments from Sales Shipment Header and return shipments from Sales Cr.Memo Header. Status: SHIPPED (outbound with items), PENDING (outbound without items), RECEIVED (returns).",
181
178
  "example": [
182
179
  {
183
180
  "erp_id": "SP123456789",
184
181
  "type": "SHIPPED-OUTBOUND",
185
182
  "shipped_at": "2024-12-26T10:00:00Z",
186
183
  "status": "SHIPPED",
184
+ "shipped_by": "TORQUE",
185
+ "courier_name": "EVRI",
186
+ "tracking_code": "TRK002345678901",
187
+ "class_name": "PRIORITY",
187
188
  "items": [
188
189
  {
189
- "sku": "SKU123",
190
- "quantity": 1,
191
- "unit_price_net": { "currency": "USD", "value": 10000 },
192
- "unit_price_gross": { "currency": "USD", "value": 12000 }
190
+ "lineNumber": 1,
191
+ "sku": "PROD004-4001-14",
192
+ "quantity": 1
193
193
  }
194
194
  ]
195
195
  }
@@ -204,27 +204,27 @@
204
204
  "maxItems": 2,
205
205
  "uniqueItems": true
206
206
  },
207
- "description": "List of items included in the order.",
207
+ "description": "Order line items from invoice lines (preferred) or sale lines. Items are split when shipped quantity < ordered quantity.",
208
208
  "example": [
209
209
  {
210
- "sku": "SKU123",
211
- "colour_id": "RED",
212
- "style_id": "STYLE1",
210
+ "sku": "PROD004-4001-14",
211
+ "colour_id": "4001",
212
+ "style_id": "PROD004",
213
+ "product_id": "PROD004-4001",
213
214
  "quantity": 1,
214
- "unit_price_net": { "currency": "USD", "value": 10000 },
215
- "unit_price_gross": { "currency": "USD", "value": 12000 },
216
- "unit_price_status": "rrp",
217
- "discount_amount_net": { "currency": "USD", "value": 0 },
218
- "discount_amount_gross": { "currency": "USD", "value": 0 }
215
+ "returned_quantity": 0,
216
+ "unit_price_net": { "currency": "GBP", "value": 6584, "decimal_places": 2, "lcy_value": 6584, "lcy_currency": "GBP", "lcy_decimal_places": 2 },
217
+ "unit_price_gross": { "currency": "GBP", "value": 7900, "decimal_places": 2, "lcy_value": 7900, "lcy_currency": "GBP", "lcy_decimal_places": 2 },
218
+ "unit_price_status": "perm"
219
219
  }
220
220
  ]
221
221
  },
222
- "total": { "$ref": "https://shushed.example.com/total.schema.json", "description": "Total monetary value of the order." },
223
- "return_total": { "$ref": "https://shushed.example.com/total.schema.json", "description": "Total monetary value of returned items." },
224
- "net_total": { "$ref": "https://shushed.example.com/total.schema.json", "description": "Net total amount after discounts and returns." },
222
+ "total": { "$ref": "https://shushed.example.com/total.schema.json", "description": "Total monetary value of the order (invoices + non-invoiced sales, including delivery)." },
223
+ "return_total": { "$ref": "https://shushed.example.com/total.schema.json", "description": "Total monetary value of returned items from credit memos." },
224
+ "net_total": { "$ref": "https://shushed.example.com/total.schema.json", "description": "Net total: total minus return_total." },
225
225
  "shipping_method": {
226
226
  "type": ["string", "null"],
227
- "description": "Shipping method used for the order, nullable if not applicable - Example: EMAILDELIVERY, GLOBALE_HUB, GLOBALE_EXPRESS"
227
+ "description": "Shipping method code from shipment shipping_agent_service_code or shipping_agent_code. Nullable when no shipments exist."
228
228
  }
229
229
  },
230
230
  "required": ["erp_order_id", "status", "ordered_at", "items", "total"]
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "OrderDelivered", "additionalProperties": false, "allOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order", "type": "object", "properties": { "status": { "type": ["string"], "enum": ["NEW", "PENDING", "CONFIRMED", "PROCESSING", "PROCESSED", "PACKED", "SHIPPED", "DELIVERED", "PARTIALLY-SHIPPED", "RETURNED", "PARTIALLY-RETURNED", "CANCELLED", "ARCHIVED", "FAILED"] }, "erp_order_id": { "type": "string" }, "centra_order_id": { "type": ["integer", "null"] }, "sfcc_order_id": { "type": ["string", "null"] }, "globale_order_id": { "type": ["string", "null"] }, "sitoo_order_id": { "type": ["string", "null"], "format": "uuid" }, "system_created_by": { "type": "string", "enum": ["POS", "ECOMMERCE", "SYSTEM"] }, "ordered_at": { "type": "string", "format": "date-time" }, "payments": { "type": "array", "items": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Payment", "type": "object", "additionalProperties": true, "properties": { "type": { "type": "string", "enum": ["REFUND", "CHARGE"] }, "additionalProperties": false, "created_at": { "type": "string", "format": "date-time", "example": "2024-07-09T14:30:00Z", "nullable": true }, "payment_method": { "type": "string", "enum": ["MOTO", "CREDIT-CARD", "GIFT-CARD", "PAYPAL", "APPLE-PAY", "OTHER"] }, "transaction_id": { "type": ["string"] }, "card_number": { "type": ["string", "null"] }, "card_holder": { "type": ["string", "null"] }, "card_token": { "type": ["string", "null"] }, "expiration_month": { "type": ["integer", "null"], "minimum": 1, "maximum": 12 }, "expiration_year": { "type": ["integer", "null"], "minimum": 2023, "maximum": 2085 }, "journey_label": { "type": ["string", "null"], "enum": ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM", null] }, "psp_reference": { "type": "string" }, "card_brand": { "type": ["string", "null"] }, "status": { "type": ["string"], "enum": ["CAPTURED", "FAILED", "FAILED-3DS", "CANCELLED"] }, "amount": { "$ref": "#/allOf/0/properties/items/items/allOf/1/properties/cost_net" }, "created_by": { "anyOf": [{ "type": "string", "enum": ["CUSTOMER", "SYSTEM", "CENTRA", "SITOO", "STOREFRONT", "MOTO"] }, { "type": "string", "format": "email" }] } }, "required": ["created_at", "payment_method", "transaction_id", "psp_reference", "status", "amount", "created_by", "journey_label"] }, "example": [{ "type": "CHARGE", "created_at": "2024-12-25T15:35:00Z", "payment_method": "CREDIT-CARD", "transaction_id": "TR123456789", "card_number": "4111111111111111", "journey_label": "CHECKOUT", "psp_reference": "PSP987654321", "card_brand": "VISA", "status": "CAPTURED", "amount": { "currency": "USD", "value": 15000 }, "created_by": "CUSTOMER" }] }, "is_anonymous": { "type": ["boolean"] }, "is_gift": { "type": ["boolean"] }, "customer": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Customer", "type": "object", "additionalProperties": false, "properties": { "first_name": { "type": "string", "maxLength": 30 }, "last_name": { "type": "string", "maxLength": 30 }, "sfcc_id": { "type": "string" }, "bc_customer_id": { "type": "string", "maxLength": 20 }, "merged_bc_customer_ids": { "type": "array", "items": { "type": "string" }, "example": ["CUST00011111", "CUST00022222"] }, "centra_id": { "type": "string" }, "sitoo_id": { "type": "string" }, "scv_customer_id": { "type": "string" }, "addresses": { "type": "array", "items": { "$ref": "#/allOf/0/properties/billing_address/anyOf/0" } }, "default_shipping_address": { "$ref": "#/allOf/0/properties/billing_address/anyOf/0" }, "phone": { "type": ["string", "null"] }, "email": { "type": ["string", "null"], "format": "email", "example": "alice.johnson@example.com" }, "opt_in_email": { "type": "boolean" }, "opt_in_phone": { "type": "boolean" }, "opt_in_3rdparty": { "type": "boolean" }, "segments": { "type": "array", "items": { "type": "string" }, "example": ["VIP", "NewsletterSubscriber"] }, "registered_at": { "type": "string", "format": "date-time" }, "scv_first_purchase_at": { "type": "string", "format": "date-time" }, "scv_last_purchase_at": { "type": "string", "format": "date-time" }, "scv_linked_customer_ids": { "type": "array", "items": { "type": "string" }, "example": ["SCV987654321", "SCV123987654"] }, "scv_total_transactions": { "type": "integer", "minimum": 0 }, "scv_total_demand": { "type": "integer", "minimum": 0 }, "scv_total_demand_cost": { "type": "number", "minimum": 0 }, "scv_total_returns": { "type": "integer", "minimum": 0 }, "scv_total_returns_cost": { "type": "number", "minimum": 0 }, "last_modified_by": { "type": "string" }, "is_deleted": { "type": "boolean" }, "other_bc_ids": { "type": "array", "items": { "type": "string" } } }, "required": ["email"] }, "billing_address": { "anyOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Address", "type": "object", "additionalProperties": false, "properties": { "address_id": { "type": "string" }, "sfcc_customer_id": { "type": "string" }, "sitoo_customer_id": { "type": "string" }, "bc_customer_id": { "type": "string" }, "centra_customer_id": { "type": "string" }, "is_default_billing": { "type": "boolean" }, "is_default_shipping": { "type": "boolean" }, "scv_household_id": { "type": ["string", "null"] }, "is_last_used_shipping": { "type": "boolean" }, "is_retrieved_from_payment_method": { "type": "boolean" }, "opt_in_mail": { "type": "boolean" }, "company_name": { "type": "string", "maxLength": 30 }, "first_name": { "type": "string", "maxLength": 30, "minLength": 1 }, "last_name": { "type": "string", "maxLength": 30, "minLength": 1 }, "address1": { "type": ["string"], "minLength": 1, "maxLength": 30 }, "address2": { "type": ["string", "null"], "maxLength": 30 }, "city": { "type": ["string"], "maxLength": 30, "minLength": 1 }, "region": { "type": ["string", "null"], "maxLength": 30 }, "post_code": { "type": ["string", "null"], "maxLength": 20, "pattern": "^[A-Z0-9 ]*$" }, "country_code": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Country", "type": "string", "enum": ["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CD", "CG", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "UM", "US", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"] }, "phone": { "type": ["string", "null"], "maxLength": 30 }, "click_collect_id": { "type": ["string", "null"] }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" } }, "required": ["first_name", "last_name", "address1", "city", "country_code"] }, { "type": ["null"] }], "example": { "first_name": "Alice", "last_name": "Johnson", "address1": "123 Main St", "address2": "Apt 4B", "city": "New York", "region": "NY", "post_code": "10001", "country_code": "US", "phone": "+1-202-555-0143" } }, "shipping_address": { "anyOf": [{ "$ref": "#/allOf/0/properties/billing_address/anyOf/0" }, { "type": ["null"] }], "example": { "first_name": "Alice", "last_name": "Johnson", "address1": "123 Main St", "address2": "Apt 4B", "city": "New York", "region": "NY", "post_code": "10001", "country_code": "US", "phone": "+1-202-555-0143" } }, "collection_point_id": { "type": ["string", "null"] }, "is_pos": { "type": ["boolean"] }, "shipments": { "type": "array", "minItems": 1, "prefixItems": [{ "anyOf": [{ "$ref": "#/allOf/0/properties/shipments/items/anyOf/0" }, { "$ref": "#/allOf/0/properties/shipments/items/anyOf/2" }] }], "items": { "anyOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order Shipment Shipped Outbound", "type": "object", "allOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Shipment", "type": "object", "allOf": [{ "$ref": "#/allOf/0/properties/items/items/allOf/0" }, { "type": "object", "properties": { "erp_id": { "type": ["string"] }, "type": { "type": ["string"], "enum": ["SHIPPED-OUTBOUND", "SHIPPED-RETURN", "POS-OUTBOUND", "POS-RETURN"] }, "shipped_at": { "type": ["string"], "format": "date-time" }, "status": { "type": ["string"], "enum": ["PENDING", "SHIPPED", "RECEIVED", "CANCELLED"] }, "discount_code": { "type": ["string", "null"] }, "discount_campaign": { "type": ["string", "null"] }, "items": { "type": ["array"], "items": { "type": "object", "anyOf": [{ "$ref": "#/allOf/0/properties/shipments/items/anyOf/0/allOf/1/properties/items/items" }, { "$ref": "#/allOf/0/properties/shipments/items/anyOf/3/allOf/1/properties/items/items" }] } } } }], "required": ["erp_id", "shipped_at", "status", "items"] }, { "type": "object", "properties": { "type": { "type": ["string"], "enum": ["SHIPPED-OUTBOUND"] }, "shipped_by": { "type": ["string"], "enum": ["TORQUE", "GLOBALE"] }, "items": { "type": "array", "items": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order Shipment Item", "type": "object", "properties": { "lineNumber": { "type": ["integer"], "minimum": 0 }, "quantity": { "type": ["integer"], "minimum": 1 } }, "required": ["lineNumber", "quantity"] } } } }] }, { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order Shipment Shipped Return", "type": "object", "allOf": [{ "$ref": "#/allOf/0/properties/shipments/items/anyOf/0/allOf/0" }, { "type": "object", "properties": { "type": { "type": ["string"], "enum": ["SHIPPED-RETURN"] }, "shipped_by": { "type": ["string"], "enum": ["CUSTOMER"] }, "items": { "type": "array", "items": { "$ref": "#/allOf/0/properties/shipments/items/anyOf/0/allOf/1/properties/items/items" } } }, "required": ["type", "shipped_by", "items"] }] }, { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order Shipment POS Outbound", "type": "object", "additionalProperties": false, "allOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order Shipment Outbound", "type": "object", "allOf": [{ "$ref": "#/allOf/0/properties/shipments/items/anyOf/0/allOf/0" }, { "type": "object", "properties": { "type": { "type": ["string"], "enum": ["POS-OUTBOUND", "POS-RETURN"] }, "status": { "type": ["string"], "enum": ["RECEIVED"] }, "store_id": { "type": ["string", "null"] }, "store_name": { "type": ["string", "null"] }, "associate_id": { "type": ["string", "null"] }, "associate_name": { "type": ["string", "null"] } }, "required": ["store_id", "store_name", "associate_id", "associate_name"] }] }, { "type": "object", "additionalProperties": false, "properties": { "type": { "type": ["string"], "enum": ["POS-OUTBOUND"] }, "shipped_by": { "type": ["string"], "enum": ["TORQUE", "GLOBALE"] }, "items": { "type": "array", "items": { "$ref": "#/allOf/0/properties/shipments/items/anyOf/0/allOf/1/properties/items/items" } } }, "required": ["type", "shipped_by", "items"] }] }, { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order Shipment POS Return", "type": "object", "additionalProperties": false, "allOf": [{ "$ref": "#/allOf/0/properties/shipments/items/anyOf/2/allOf/0" }, { "type": "object", "additionalProperties": false, "properties": { "type": { "type": ["string"], "enum": ["POS-RETURN"] }, "items": { "type": "array", "items": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order Shipment Item Returned", "type": "object", "allOf": [{ "$ref": "#/allOf/0/properties/shipments/items/anyOf/0/allOf/1/properties/items/items" }, { "type": "object", "properties": { "returnReasonCode": { "type": ["string"] }, "returnReason": { "type": ["string", "null"] } }, "required": ["returnReasonCode", "returnReason"] }] } } } }] }] }, "example": [{ "erp_id": "SP123456789", "type": "SHIPPED-OUTBOUND", "shipped_at": "2024-12-26T10:00:00Z", "status": "SHIPPED", "items": [{ "sku": "SKU123", "quantity": 1, "unit_price_net": { "currency": "USD", "value": 10000 }, "unit_price_gross": { "currency": "USD", "value": 12000 } }] }] }, "items": { "type": "array", "minItems": 1, "items": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Item", "type": "object", "allOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Total", "type": "object", "properties": { "amount_net": { "$ref": "#/allOf/0/properties/items/items/allOf/1/properties/cost_net", "title": "Amount Net" }, "amount_gross": { "$ref": "#/allOf/0/properties/items/items/allOf/1/properties/cost_net", "title": "Amount gross" }, "discount_amount_net": { "$ref": "#/allOf/0/properties/items/items/allOf/1/properties/cost_net", "title": "Discount Amount Net" }, "discount_amount_gross": { "$ref": "#/allOf/0/properties/items/items/allOf/1/properties/cost_net", "title": "Discount Amount Gross" }, "discount_amount_percent": { "type": "number", "title": "Discount Amount Percent", "minimum": 0, "maximum": 100 } }, "required": ["amount_net", "amount_gross", "discount_amount_net", "discount_amount_gross", "discount_amount_percent"] }, { "type": "object", "properties": { "sku": { "type": ["string"] }, "linked_style_id": { "type": ["string", "null"] }, "colour_id": { "type": ["string", "null"] }, "style_id": { "type": ["string", "null"] }, "product_id": { "type": ["string", "null"] }, "colour_name": { "type": ["string"] }, "size_name": { "type": ["string"] }, "preorder_date": { "type": ["string", "null"], "format": "date" }, "quantity": { "type": ["integer"], "minimum": 0 }, "unit_price_status": { "type": "string", "enum": ["rrp", "perm", "pos"] }, "returned_quantity": { "type": ["integer"], "minimum": 0 }, "unit_price_net": { "$ref": "#/allOf/0/properties/items/items/allOf/1/properties/cost_net" }, "unit_price_gross": { "$ref": "#/allOf/0/properties/items/items/allOf/1/properties/cost_net" }, "discount_code": { "type": ["string", "null"] }, "discount_campaign": { "type": ["string", "null"] }, "cost_net": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Money", "type": "object", "additionalProperties": false, "properties": { "value": { "type": "integer", "minimum": 0 }, "decimal_places": { "type": "integer", "minimum": 0, "maximum": 4 }, "currency": { "title": "Currency", "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "enum": ["AFN", "ALL", "DZD", "USD", "EUR", "AOA", "XCD", "ARS", "AMD", "AWG", "AUD", "AZN", "BSD", "BHD", "BDT", "BBD", "BYN", "BZD", "XOF", "BMD", "BTN", "INR", "BOB", "BOV", "BAM", "BWP", "NOK", "BRL", "BND", "BGN", "BIF", "CVE", "KHR", "XAF", "CAD", "KYD", "CLF", "CLP", "CNY", "COP", "COU", "KMF", "CDF", "NZD", "CRC", "CUC", "CUP", "ANG", "CZK", "DKK", "DJF", "DOP", "EGP", "SVC", "ERN", "ETB", "FKP", "FJD", "XPF", "GMD", "GEL", "GHS", "GIP", "GTQ", "GBP", "GNF", "GYD", "HTG", "HNL", "HKD", "HUF", "ISK", "IDR", "XDR", "IRR", "IQD", "ILS", "JMD", "JPY", "JOD", "KZT", "KES", "KPW", "KRW", "KWD", "KGS", "LAK", "LBP", "LSL", "ZAR", "LRD", "LYD", "CHF", "MOP", "MGA", "MWK", "MYR", "MVR", "MRU", "MUR", "XUA", "MXN", "MXV", "MDL", "MNT", "MAD", "MZN", "MMK", "NAD", "NPR", "NIO", "NGN", "OMR", "PKR", "PAB", "PGK", "PYG", "PEN", "PHP", "PLN", "QAR", "MKD", "RON", "RUB", "RWF", "SHP", "WST", "STN", "SAR", "RSD", "SCR", "SLE", "SGD", "XSU", "SBD", "SOS", "SSP", "LKR", "SDG", "SRD", "SZL", "SEK", "CHE", "CHW", "SYP", "TWD", "TJS", "TZS", "THB", "TOP", "TTD", "TND", "TRY", "TMT", "UGX", "UAH", "AED", "USN", "UYI", "UYU", "UZS", "VUV", "VEF", "VED", "VND", "YER", "ZMW", "ZWL"] }, "lcy_value": { "type": "integer", "minimum": 0 }, "lcy_currency": { "$ref": "#/allOf/0/properties/total/properties/amount_net/properties/currency", "title": "LCY Currency" }, "lcy_decimal_places": { "type": "integer", "minimum": 0, "maximum": 4 } }, "required": ["value", "currency", "lcy_value", "lcy_currency", "decimal_places", "lcy_decimal_places"] } }, "required": ["sku", "colour_id", "style_id", "quantity", "unit_price_net", "unit_price_gross", "unit_price_status"] }] }, "example": [{ "sku": "SKU123", "colour_id": "RED", "style_id": "STYLE1", "quantity": 1, "unit_price_net": { "currency": "USD", "value": 10000 }, "unit_price_gross": { "currency": "USD", "value": 12000 }, "unit_price_status": "rrp", "discount_amount_net": { "currency": "USD", "value": 0 }, "discount_amount_gross": { "currency": "USD", "value": 0 } }] }, "total": { "$ref": "#/allOf/0/properties/items/items/allOf/0" }, "return_total": { "$ref": "#/allOf/0/properties/items/items/allOf/0" }, "net_total": { "$ref": "#/allOf/0/properties/items/items/allOf/0" }, "shipping_method": { "type": ["string", "null"] } }, "required": ["erp_order_id", "status", "ordered_at", "items", "total"] }, { "type": "object", "additionalProperties": false, "properties": { "status": { "type": ["string"], "enum": ["SHIPPED", "PARTIALLY-SHIPPED", "RETURNED", "PARTIALLY-RETURNED", "CANCELLED"] } }, "required": ["erp_order_id", "shipments", "items", "total"] }], "$id": "https://shushed.example.com/messages/order/delivered.schema.json" };
3
+ const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "OrderDelivered", "additionalProperties": false, "allOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order", "type": "object", "properties": { "status": { "type": ["string"], "enum": ["NEW", "PENDING", "CONFIRMED", "PROCESSING", "PROCESSED", "PACKED", "SHIPPED", "DELIVERED", "PARTIALLY-SHIPPED", "RETURNED", "PARTIALLY-RETURNED", "CANCELLED", "ARCHIVED", "FAILED"] }, "erp_order_id": { "type": "string" }, "centra_order_id": { "type": ["integer", "null"] }, "sfcc_order_id": { "type": ["string", "null"] }, "globale_order_id": { "type": ["string", "null"] }, "sitoo_order_id": { "type": ["string", "null"] }, "system_created_by": { "type": "string", "enum": ["POS", "ECOMMERCE", "SYSTEM"] }, "ordered_at": { "type": "string", "format": "date-time" }, "payments": { "type": "array", "items": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Payment", "type": "object", "additionalProperties": true, "properties": { "type": { "type": "string", "enum": ["REFUND", "CHARGE"] }, "additionalProperties": false, "created_at": { "type": "string", "format": "date-time", "example": "2024-07-09T14:30:00Z", "nullable": true }, "payment_method": { "type": "string", "enum": ["MOTO", "CREDIT-CARD", "GIFT-CARD", "PAYPAL", "APPLE-PAY", "OTHER"] }, "transaction_id": { "type": ["string", "null"] }, "card_number": { "type": ["string", "null"] }, "card_holder": { "type": ["string", "null"] }, "card_token": { "type": ["string", "null"] }, "expiration_month": { "type": ["integer", "null"], "minimum": 1, "maximum": 12 }, "expiration_year": { "type": ["integer", "null"], "minimum": 2023, "maximum": 2085 }, "journey_label": { "type": ["string", "null"], "enum": ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM", null] }, "psp_reference": { "type": ["string", "null"] }, "card_brand": { "type": ["string", "null"] }, "status": { "type": ["string"], "enum": ["CAPTURED", "FAILED", "FAILED-3DS", "CANCELLED"] }, "amount": { "$ref": "#/allOf/0/properties/total/properties/amount_net" }, "created_by": { "anyOf": [{ "type": "string", "enum": ["CUSTOMER", "SYSTEM", "CENTRA", "SITOO", "STOREFRONT", "MOTO"] }, { "type": "string", "format": "email" }] } }, "required": ["created_at", "payment_method", "transaction_id", "psp_reference", "status", "amount", "created_by", "journey_label"] }, "example": [{ "type": "CHARGE", "created_at": "2024-12-25T15:35:00Z", "payment_method": "CREDIT-CARD", "transaction_id": "TR123456789", "card_number": "XXXX-XXXX-XXXX-1234", "journey_label": null, "psp_reference": "TR123456789", "card_brand": "Visa", "status": "CAPTURED", "amount": { "currency": "GBP", "value": 15000, "decimal_places": 2, "lcy_value": 15000, "lcy_currency": "GBP", "lcy_decimal_places": 2 }, "created_by": "MOTO" }] }, "is_anonymous": { "type": ["boolean"] }, "is_gift": { "type": ["boolean"] }, "is_pos": { "type": ["boolean"] }, "customer": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Customer", "type": "object", "additionalProperties": false, "properties": { "first_name": { "type": "string", "maxLength": 30 }, "last_name": { "type": "string", "maxLength": 30 }, "sfcc_id": { "type": "string" }, "bc_customer_id": { "type": "string", "maxLength": 20 }, "merged_bc_customer_ids": { "type": "array", "items": { "type": "string" }, "example": ["CUST00011111", "CUST00022222"] }, "centra_id": { "type": "string" }, "sitoo_id": { "type": "string" }, "scv_customer_id": { "type": "string" }, "addresses": { "type": "array", "items": { "$ref": "#/allOf/0/properties/billing_address/anyOf/0" } }, "default_shipping_address": { "$ref": "#/allOf/0/properties/billing_address/anyOf/0" }, "phone": { "type": ["string", "null"] }, "email": { "type": ["string", "null"], "format": "email", "example": "alice.johnson@example.com" }, "opt_in_email": { "type": "boolean" }, "opt_in_phone": { "type": "boolean" }, "opt_in_3rdparty": { "type": "boolean" }, "segments": { "type": "array", "items": { "type": "string" }, "example": ["VIP", "NewsletterSubscriber"] }, "registered_at": { "type": "string", "format": "date-time" }, "scv_first_purchase_at": { "type": "string", "format": "date-time" }, "scv_last_purchase_at": { "type": "string", "format": "date-time" }, "scv_linked_customer_ids": { "type": "array", "items": { "type": "string" }, "example": ["SCV987654321", "SCV123987654"] }, "scv_total_transactions": { "type": "integer", "minimum": 0 }, "scv_total_demand": { "type": "integer", "minimum": 0 }, "scv_total_demand_cost": { "type": "number", "minimum": 0 }, "scv_total_returns": { "type": "integer", "minimum": 0 }, "scv_total_returns_cost": { "type": "number", "minimum": 0 }, "last_modified_by": { "type": "string" }, "is_deleted": { "type": "boolean" }, "other_bc_ids": { "type": "array", "items": { "type": "string" } } }, "required": ["email"] }, "billing_address": { "anyOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Address", "type": "object", "additionalProperties": false, "properties": { "address_id": { "type": "string" }, "sfcc_customer_id": { "type": "string" }, "sitoo_customer_id": { "type": "string" }, "bc_customer_id": { "type": "string" }, "centra_customer_id": { "type": "string" }, "is_default_billing": { "type": "boolean" }, "is_default_shipping": { "type": "boolean" }, "scv_household_id": { "type": ["string", "null"] }, "is_last_used_shipping": { "type": "boolean" }, "is_retrieved_from_payment_method": { "type": "boolean" }, "opt_in_mail": { "type": "boolean" }, "company_name": { "type": "string", "maxLength": 100 }, "first_name": { "type": ["string", "null"], "maxLength": 50 }, "last_name": { "type": ["string", "null"], "maxLength": 50 }, "address1": { "type": ["string"], "minLength": 1, "maxLength": 100 }, "address2": { "type": ["string", "null"], "maxLength": 100 }, "city": { "type": ["string", "null"], "maxLength": 50 }, "region": { "type": ["string", "null"], "maxLength": 50 }, "post_code": { "type": ["string", "null"], "maxLength": 20 }, "country_code": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Country", "type": "string", "enum": ["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CD", "CG", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "UM", "US", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"] }, "phone": { "type": ["string", "null"], "maxLength": 30 }, "click_collect_id": { "type": ["string", "null"] }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" } }, "required": ["first_name", "last_name", "address1", "city", "country_code"] }, { "type": ["null"] }], "example": { "first_name": "Alice", "last_name": "Johnson", "address1": "123 Main St", "address2": "Apt 4B", "city": "London", "post_code": "SW1A 1AA", "country_code": "GB", "phone": "+44 7700 900000" } }, "shipping_address": { "anyOf": [{ "$ref": "#/allOf/0/properties/billing_address/anyOf/0" }, { "type": ["null"] }], "example": { "first_name": "Alice", "last_name": "Johnson", "address1": "123 Main St", "address2": "Apt 4B", "city": "London", "post_code": "SW1A 1AA", "country_code": "GB", "phone": "+44 7700 900000" } }, "collection_point_id": { "type": ["string", "null"] }, "shipments": { "type": "array", "minItems": 1, "prefixItems": [{ "anyOf": [{ "$ref": "#/allOf/0/properties/shipments/items/anyOf/0" }, { "$ref": "#/allOf/0/properties/shipments/items/anyOf/2" }] }], "items": { "anyOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order Shipment Shipped Outbound", "type": "object", "allOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Shipment", "type": "object", "allOf": [{ "$ref": "#/allOf/0/properties/items/items/allOf/0" }, { "type": "object", "properties": { "erp_id": { "type": ["string"] }, "type": { "type": ["string"], "enum": ["SHIPPED-OUTBOUND", "SHIPPED-RETURN", "POS-OUTBOUND", "POS-RETURN"] }, "shipped_at": { "type": ["string"], "format": "date-time" }, "status": { "type": ["string"], "enum": ["PENDING", "SHIPPED", "RECEIVED", "CANCELLED"] }, "discount_code": { "type": ["string", "null"] }, "discount_campaign": { "type": ["string", "null"] }, "courier_name": { "type": ["string", "null"], "enum": ["GLOBALE", "ROYALMAIL", "EVRI", "WAITROSE", null] }, "tracking_code": { "type": ["string", "null"] }, "class_name": { "type": ["string"], "enum": ["STANDARD", "PRIORITY"] }, "items": { "type": ["array"], "items": { "type": "object", "anyOf": [{ "$ref": "#/allOf/0/properties/shipments/items/anyOf/0/allOf/1/properties/items/items" }, { "$ref": "#/allOf/0/properties/shipments/items/anyOf/3/allOf/1/properties/items/items" }] } } } }], "required": ["erp_id", "shipped_at", "status", "items"] }, { "type": "object", "properties": { "type": { "type": ["string"], "enum": ["SHIPPED-OUTBOUND"] }, "shipped_by": { "type": ["string"], "enum": ["TORQUE", "GLOBALE"] }, "items": { "type": "array", "items": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order Shipment Item", "type": "object", "properties": { "lineNumber": { "type": ["integer"], "minimum": 0 }, "sku": { "type": ["string"] }, "quantity": { "type": ["integer"], "minimum": 1 } }, "required": ["lineNumber", "sku", "quantity"] } } } }] }, { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order Shipment Shipped Return", "type": "object", "allOf": [{ "$ref": "#/allOf/0/properties/shipments/items/anyOf/0/allOf/0" }, { "type": "object", "properties": { "type": { "type": ["string"], "enum": ["SHIPPED-RETURN"] }, "shipped_by": { "type": ["string"], "enum": ["CUSTOMER"] }, "items": { "type": "array", "items": { "$ref": "#/allOf/0/properties/shipments/items/anyOf/0/allOf/1/properties/items/items" } } }, "required": ["type", "shipped_by", "items"] }] }, { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order Shipment POS Outbound", "type": "object", "additionalProperties": false, "allOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order Shipment Outbound", "type": "object", "allOf": [{ "$ref": "#/allOf/0/properties/shipments/items/anyOf/0/allOf/0" }, { "type": "object", "properties": { "type": { "type": ["string"], "enum": ["POS-OUTBOUND", "POS-RETURN"] }, "status": { "type": ["string"], "enum": ["RECEIVED"] }, "store_id": { "type": ["string", "null"] }, "store_name": { "type": ["string", "null"] }, "associate_id": { "type": ["string", "null"] }, "associate_name": { "type": ["string", "null"] } }, "required": ["store_id", "store_name", "associate_id", "associate_name"] }] }, { "type": "object", "additionalProperties": false, "properties": { "type": { "type": ["string"], "enum": ["POS-OUTBOUND"] }, "shipped_by": { "type": ["string"], "enum": ["TORQUE", "GLOBALE"] }, "items": { "type": "array", "items": { "$ref": "#/allOf/0/properties/shipments/items/anyOf/0/allOf/1/properties/items/items" } } }, "required": ["type", "shipped_by", "items"] }] }, { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order Shipment POS Return", "type": "object", "additionalProperties": false, "allOf": [{ "$ref": "#/allOf/0/properties/shipments/items/anyOf/2/allOf/0" }, { "type": "object", "additionalProperties": false, "properties": { "type": { "type": ["string"], "enum": ["POS-RETURN"] }, "items": { "type": "array", "items": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Order Shipment Item Returned", "type": "object", "allOf": [{ "$ref": "#/allOf/0/properties/shipments/items/anyOf/0/allOf/1/properties/items/items" }, { "type": "object", "properties": { "returnReasonCode": { "type": ["string"] }, "returnReason": { "type": ["string", "null"] } }, "required": ["returnReasonCode", "returnReason"] }] } } } }] }] }, "example": [{ "erp_id": "SP123456789", "type": "SHIPPED-OUTBOUND", "shipped_at": "2024-12-26T10:00:00Z", "status": "SHIPPED", "shipped_by": "TORQUE", "courier_name": "EVRI", "tracking_code": "TRK002345678901", "class_name": "PRIORITY", "items": [{ "lineNumber": 1, "sku": "PROD004-4001-14", "quantity": 1 }] }] }, "items": { "type": "array", "minItems": 1, "items": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Item", "type": "object", "allOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Total", "type": "object", "properties": { "amount_net": { "title": "Amount Net", "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "value": { "type": "integer", "minimum": 0 }, "decimal_places": { "type": "integer", "minimum": 0, "maximum": 4 }, "currency": { "title": "Currency", "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "enum": ["AFN", "ALL", "DZD", "USD", "EUR", "AOA", "XCD", "ARS", "AMD", "AWG", "AUD", "AZN", "BSD", "BHD", "BDT", "BBD", "BYN", "BZD", "XOF", "BMD", "BTN", "INR", "BOB", "BOV", "BAM", "BWP", "NOK", "BRL", "BND", "BGN", "BIF", "CVE", "KHR", "XAF", "CAD", "KYD", "CLF", "CLP", "CNY", "COP", "COU", "KMF", "CDF", "NZD", "CRC", "CUC", "CUP", "ANG", "CZK", "DKK", "DJF", "DOP", "EGP", "SVC", "ERN", "ETB", "FKP", "FJD", "XPF", "GMD", "GEL", "GHS", "GIP", "GTQ", "GBP", "GNF", "GYD", "HTG", "HNL", "HKD", "HUF", "ISK", "IDR", "XDR", "IRR", "IQD", "ILS", "JMD", "JPY", "JOD", "KZT", "KES", "KPW", "KRW", "KWD", "KGS", "LAK", "LBP", "LSL", "ZAR", "LRD", "LYD", "CHF", "MOP", "MGA", "MWK", "MYR", "MVR", "MRU", "MUR", "XUA", "MXN", "MXV", "MDL", "MNT", "MAD", "MZN", "MMK", "NAD", "NPR", "NIO", "NGN", "OMR", "PKR", "PAB", "PGK", "PYG", "PEN", "PHP", "PLN", "QAR", "MKD", "RON", "RUB", "RWF", "SHP", "WST", "STN", "SAR", "RSD", "SCR", "SLE", "SGD", "XSU", "SBD", "SOS", "SSP", "LKR", "SDG", "SRD", "SZL", "SEK", "CHE", "CHW", "SYP", "TWD", "TJS", "TZS", "THB", "TOP", "TTD", "TND", "TRY", "TMT", "UGX", "UAH", "AED", "USN", "UYI", "UYU", "UZS", "VUV", "VEF", "VED", "VND", "YER", "ZMW", "ZWL"] }, "lcy_value": { "type": "integer", "minimum": 0 }, "lcy_currency": { "$ref": "#/allOf/0/properties/total/properties/amount_net/properties/currency", "title": "LCY Currency" }, "lcy_decimal_places": { "type": "integer", "minimum": 0, "maximum": 4 } }, "required": ["value", "currency", "lcy_value", "lcy_currency", "decimal_places", "lcy_decimal_places"] }, "amount_gross": { "$ref": "#/allOf/0/properties/total/properties/amount_net", "title": "Amount gross" }, "discount_amount_net": { "$ref": "#/allOf/0/properties/total/properties/amount_net", "title": "Discount Amount Net" }, "discount_amount_gross": { "$ref": "#/allOf/0/properties/total/properties/amount_net", "title": "Discount Amount Gross" }, "discount_amount_percent": { "type": "number", "title": "Discount Amount Percent", "minimum": 0, "maximum": 100 } }, "required": ["amount_net", "amount_gross", "discount_amount_net", "discount_amount_gross", "discount_amount_percent"] }, { "type": "object", "properties": { "sku": { "type": ["string"] }, "linked_style_id": { "type": ["string", "null"] }, "colour_id": { "type": ["string", "null"] }, "style_id": { "type": ["string", "null"] }, "product_id": { "type": ["string", "null"] }, "colour_name": { "type": ["string"] }, "size_name": { "type": ["string"] }, "preorder_date": { "type": ["string", "null"], "format": "date" }, "quantity": { "type": ["integer"], "minimum": 0 }, "unit_price_status": { "type": "string", "enum": ["rrp", "perm", "pos"] }, "returned_quantity": { "type": ["integer"], "minimum": 0 }, "unit_price_net": { "$ref": "#/allOf/0/properties/total/properties/amount_net" }, "unit_price_gross": { "$ref": "#/allOf/0/properties/total/properties/amount_net" }, "discount_code": { "type": ["string", "null"] }, "discount_campaign": { "type": ["string", "null"] }, "cost_net": { "$ref": "#/allOf/0/properties/total/properties/amount_net" }, "order_line_no": { "type": ["integer", "null"] } }, "required": ["sku", "colour_id", "style_id", "quantity", "unit_price_net", "unit_price_gross", "unit_price_status"] }] }, "example": [{ "sku": "PROD004-4001-14", "colour_id": "4001", "style_id": "PROD004", "product_id": "PROD004-4001", "quantity": 1, "returned_quantity": 0, "unit_price_net": { "currency": "GBP", "value": 6584, "decimal_places": 2, "lcy_value": 6584, "lcy_currency": "GBP", "lcy_decimal_places": 2 }, "unit_price_gross": { "currency": "GBP", "value": 7900, "decimal_places": 2, "lcy_value": 7900, "lcy_currency": "GBP", "lcy_decimal_places": 2 }, "unit_price_status": "perm" }] }, "total": { "$ref": "#/allOf/0/properties/items/items/allOf/0" }, "return_total": { "$ref": "#/allOf/0/properties/items/items/allOf/0" }, "net_total": { "$ref": "#/allOf/0/properties/items/items/allOf/0" }, "shipping_method": { "type": ["string", "null"] } }, "required": ["erp_order_id", "status", "ordered_at", "items", "total"] }, { "type": "object", "additionalProperties": false, "properties": { "status": { "type": ["string"], "enum": ["SHIPPED", "PARTIALLY-SHIPPED", "RETURNED", "PARTIALLY-RETURNED", "CANCELLED"] } }, "required": ["erp_order_id", "shipments", "items", "total"] }], "$id": "https://shushed.example.com/messages/order/delivered.schema.json" };
4
4
  exports.default = schema;