@shushed/helpers 0.0.276 → 0.0.277-glopal-20260225095840
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.
- package/dist/cjs/contracts/gift-voucher.schema.json +4 -12
- package/dist/cjs/contracts/order/item.schema.json +21 -79
- package/dist/cjs/contracts/order/shipment.schema.json +8 -50
- package/dist/cjs/dist-dereferenced/gift-voucher.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/delivered.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/new.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/processed.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/return-initiated.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/returned.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/shipped.js +1 -1
- package/dist/cjs/dist-dereferenced/order/item.js +1 -1
- package/dist/cjs/dist-dereferenced/order/orderMain.js +1 -1
- package/dist/cjs/dist-dereferenced/order/shipment/pos/outbound.js +1 -1
- package/dist/cjs/dist-dereferenced/order/shipment/pos/posMain.js +1 -1
- package/dist/cjs/dist-dereferenced/order/shipment/pos/return.js +1 -1
- package/dist/cjs/dist-dereferenced/order/shipment/shipmentMain.js +1 -1
- package/dist/cjs/dist-dereferenced/order/shipment/shipped/outbound.js +1 -1
- package/dist/cjs/dist-dereferenced/order/shipment/shipped/return.js +1 -1
- package/dist/cjs/dist-dereferenced/order/shipment/shipped/shippedMain.js +1 -1
- package/dist/cjs/src-public/env.js +0 -2
- package/dist/cjs/src-public/fredhopper/fredhopper.base.js +7 -26
- package/dist/cjs/src-public/glopal.js +33 -0
- package/dist/cjs/src-public/index.js +1 -0
- package/dist/cjs/src-public/pubsub.js +16 -49
- package/dist/cjs/src-public/utils.js +1 -0
- package/dist/types/dist-dereferenced/gift-voucher.d.ts +1 -7
- package/dist/types/dist-dereferenced/messages/order/delivered.d.ts +0 -9
- package/dist/types/dist-dereferenced/messages/order/new.d.ts +0 -9
- package/dist/types/dist-dereferenced/messages/order/processed.d.ts +0 -9
- package/dist/types/dist-dereferenced/messages/order/return-initiated.d.ts +0 -9
- package/dist/types/dist-dereferenced/messages/order/returned.d.ts +0 -9
- package/dist/types/dist-dereferenced/messages/order/shipped.d.ts +0 -9
- package/dist/types/dist-dereferenced/order/index.d.ts +0 -9
- package/dist/types/dist-dereferenced/order/item.d.ts +0 -3
- package/dist/types/dist-dereferenced/order/orderMain.d.ts +0 -9
- package/dist/types/dist-dereferenced/order/shipment/index.d.ts +0 -6
- package/dist/types/dist-dereferenced/order/shipment/pos/index.d.ts +0 -6
- package/dist/types/dist-dereferenced/order/shipment/pos/outbound.d.ts +0 -6
- package/dist/types/dist-dereferenced/order/shipment/pos/posMain.d.ts +0 -6
- package/dist/types/dist-dereferenced/order/shipment/pos/return.d.ts +0 -6
- package/dist/types/dist-dereferenced/order/shipment/shipmentMain.d.ts +0 -6
- package/dist/types/dist-dereferenced/order/shipment/shipped/index.d.ts +0 -6
- package/dist/types/dist-dereferenced/order/shipment/shipped/outbound.d.ts +0 -6
- package/dist/types/dist-dereferenced/order/shipment/shipped/return.d.ts +0 -6
- package/dist/types/dist-dereferenced/order/shipment/shipped/shippedMain.d.ts +0 -6
- package/dist/types/dist-types/gift-voucher.d.ts +3 -13
- package/dist/types/dist-types/messages/order/delivered.d.ts +0 -3
- package/dist/types/dist-types/messages/order/new.d.ts +0 -3
- package/dist/types/dist-types/messages/order/processed.d.ts +0 -3
- package/dist/types/dist-types/messages/order/return-initiated.d.ts +0 -3
- package/dist/types/dist-types/messages/order/returned.d.ts +0 -3
- package/dist/types/dist-types/messages/order/shipped.d.ts +0 -3
- package/dist/types/dist-types/order/item.d.ts +0 -1
- package/dist/types/dist-types/order/orderMain.d.ts +0 -3
- package/dist/types/dist-types/order/shipment/pos/outbound.d.ts +0 -2
- package/dist/types/dist-types/order/shipment/pos/posMain.d.ts +0 -2
- package/dist/types/dist-types/order/shipment/pos/return.d.ts +0 -2
- package/dist/types/dist-types/order/shipment/shipmentMain.d.ts +0 -2
- package/dist/types/dist-types/order/shipment/shipped/outbound.d.ts +0 -2
- package/dist/types/dist-types/order/shipment/shipped/return.d.ts +0 -2
- package/dist/types/dist-types/order/shipment/shipped/shippedMain.d.ts +0 -2
- package/dist/types/src-public/fredhopper/fredhopper.base.d.ts +0 -1
- package/dist/types/src-public/glopal.d.ts +170 -0
- package/dist/types/src-public/index.d.ts +1 -0
- package/dist/types/src-public/pubsub.d.ts +0 -5
- package/dist/types/src-public/types.d.ts +0 -2
- package/package.json +1 -1
|
@@ -39,14 +39,8 @@
|
|
|
39
39
|
]
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
|
-
"is_expired": {
|
|
43
|
-
"type": "boolean"
|
|
44
|
-
},
|
|
45
42
|
"customer_email": {
|
|
46
|
-
"type": [
|
|
47
|
-
"string",
|
|
48
|
-
"null"
|
|
49
|
-
],
|
|
43
|
+
"type": ["string", "null"],
|
|
50
44
|
"format": "email",
|
|
51
45
|
"description": "Normalized and lowercased email. Null if invalid.",
|
|
52
46
|
"example": "alice.johnson@example.com"
|
|
@@ -61,10 +55,6 @@
|
|
|
61
55
|
]
|
|
62
56
|
}
|
|
63
57
|
},
|
|
64
|
-
"original_amount": {
|
|
65
|
-
"$ref": "https://shushed.example.com/money.schema.json",
|
|
66
|
-
"description": "Original Gift Voucher Amount"
|
|
67
|
-
},
|
|
68
58
|
"balance": {
|
|
69
59
|
"$ref": "https://shushed.example.com/money.schema.json",
|
|
70
60
|
"description": "Balance currently on the voucher - Example: 25.50"
|
|
@@ -85,6 +75,8 @@
|
|
|
85
75
|
"valid_until",
|
|
86
76
|
"customer_email",
|
|
87
77
|
"purchased_at",
|
|
88
|
-
"balance"
|
|
78
|
+
"balance",
|
|
79
|
+
"is_physical",
|
|
80
|
+
"has_been_emailed"
|
|
89
81
|
]
|
|
90
82
|
}
|
|
@@ -12,105 +12,59 @@
|
|
|
12
12
|
"type": "object",
|
|
13
13
|
"properties": {
|
|
14
14
|
"sku": {
|
|
15
|
-
"type": [
|
|
16
|
-
|
|
17
|
-
],
|
|
18
|
-
"faker": {
|
|
19
|
-
"custom.sku": []
|
|
20
|
-
},
|
|
15
|
+
"type": ["string"],
|
|
16
|
+
"faker": { "custom.sku": [] },
|
|
21
17
|
"description": "Stock Keeping Unit identifier for the item.Combination of style code and colour code and "
|
|
22
18
|
},
|
|
23
19
|
"linked_style_id": {
|
|
24
|
-
"type": [
|
|
25
|
-
|
|
26
|
-
"null"
|
|
27
|
-
],
|
|
28
|
-
"faker": {
|
|
29
|
-
"custom.style": []
|
|
30
|
-
},
|
|
20
|
+
"type": ["string", "null"],
|
|
21
|
+
"faker": { "custom.style": [] },
|
|
31
22
|
"description": "Style ID of the parent item if this is a variation."
|
|
32
23
|
},
|
|
33
24
|
"colour_id": {
|
|
34
|
-
"type": [
|
|
35
|
-
|
|
36
|
-
"null"
|
|
37
|
-
],
|
|
38
|
-
"faker": {
|
|
39
|
-
"custom.color": []
|
|
40
|
-
},
|
|
25
|
+
"type": ["string", "null"],
|
|
26
|
+
"faker": { "custom.color": [] },
|
|
41
27
|
"description": "Code from Object Colorway - Example: 3203, null if not applicable (e.g., non-product items like NEWSLETTER)"
|
|
42
28
|
},
|
|
43
29
|
"style_id": {
|
|
44
|
-
"type": [
|
|
45
|
-
|
|
46
|
-
"null"
|
|
47
|
-
],
|
|
48
|
-
"faker": {
|
|
49
|
-
"custom.style": []
|
|
50
|
-
},
|
|
30
|
+
"type": ["string", "null"],
|
|
31
|
+
"faker": { "custom.style": [] },
|
|
51
32
|
"description": "Code from Object style - Example: 000697, null if not applicable (e.g., non-product items like NEWSLETTER)"
|
|
52
33
|
},
|
|
53
34
|
"product_id": {
|
|
54
|
-
"type": [
|
|
55
|
-
"string",
|
|
56
|
-
"null"
|
|
57
|
-
],
|
|
35
|
+
"type": ["string", "null"],
|
|
58
36
|
"description": "Code from Object style and colour - Example: 000697-3203"
|
|
59
37
|
},
|
|
60
38
|
"colour_name": {
|
|
61
|
-
"type": [
|
|
62
|
-
|
|
63
|
-
],
|
|
64
|
-
"faker": {
|
|
65
|
-
"color.human": []
|
|
66
|
-
},
|
|
39
|
+
"type": ["string"],
|
|
40
|
+
"faker": { "color.human": [] },
|
|
67
41
|
"description": "Node Name from Object Colorway - Example: Toffee Brown"
|
|
68
42
|
},
|
|
69
43
|
"size_name": {
|
|
70
|
-
"type": [
|
|
71
|
-
|
|
72
|
-
],
|
|
73
|
-
"faker": {
|
|
74
|
-
"custom.size": []
|
|
75
|
-
},
|
|
44
|
+
"type": ["string"],
|
|
45
|
+
"faker": { "custom.size": [] },
|
|
76
46
|
"description": "HS_ColorwayAttr_SizeRangeNodeName from Object ColorwayAttributes - Example: 10-16"
|
|
77
47
|
},
|
|
78
48
|
"preorder_date": {
|
|
79
|
-
"type": [
|
|
80
|
-
"string",
|
|
81
|
-
"null"
|
|
82
|
-
],
|
|
49
|
+
"type": ["string", "null"],
|
|
83
50
|
"format": "date",
|
|
84
51
|
"description": "Expected availability date if the item is on preorder."
|
|
85
52
|
},
|
|
86
53
|
"quantity": {
|
|
87
|
-
"type": [
|
|
88
|
-
"integer"
|
|
89
|
-
],
|
|
54
|
+
"type": ["integer"],
|
|
90
55
|
"minimum": 0,
|
|
91
|
-
"faker": {
|
|
92
|
-
"minimum": 0,
|
|
93
|
-
"maximum": 10
|
|
94
|
-
},
|
|
56
|
+
"faker": { "minimum": 0, "maximum": 10 },
|
|
95
57
|
"description": "Number of units ordered. Represented as integer."
|
|
96
58
|
},
|
|
97
59
|
"unit_price_status": {
|
|
98
60
|
"type": "string",
|
|
99
|
-
"enum": [
|
|
100
|
-
"rrp",
|
|
101
|
-
"perm",
|
|
102
|
-
"pos"
|
|
103
|
-
],
|
|
61
|
+
"enum": ["rrp", "perm", "pos"],
|
|
104
62
|
"description": "Pricing status: rrp (Full Price), perm (Markdown), pos (Promotional)."
|
|
105
63
|
},
|
|
106
64
|
"returned_quantity": {
|
|
107
|
-
"type": [
|
|
108
|
-
"integer"
|
|
109
|
-
],
|
|
65
|
+
"type": ["integer"],
|
|
110
66
|
"minimum": 0,
|
|
111
|
-
"faker": {
|
|
112
|
-
"maximum": 1
|
|
113
|
-
},
|
|
67
|
+
"faker": { "maximum": 1 },
|
|
114
68
|
"description": "Number of units returned. Represented as integer."
|
|
115
69
|
},
|
|
116
70
|
"unit_price_net": {
|
|
@@ -122,22 +76,10 @@
|
|
|
122
76
|
"description": "Gross unit price in smallest currency unit. Represented as integer."
|
|
123
77
|
},
|
|
124
78
|
"discount_code": {
|
|
125
|
-
"type": [
|
|
126
|
-
|
|
127
|
-
"null"
|
|
128
|
-
],
|
|
129
|
-
"faker": {
|
|
130
|
-
"format": "uuid"
|
|
131
|
-
},
|
|
79
|
+
"type": ["string", "null"],
|
|
80
|
+
"faker": { "format": "uuid" },
|
|
132
81
|
"description": "Code applied to trigger a discount, if any."
|
|
133
82
|
},
|
|
134
|
-
"discount_campaign": {
|
|
135
|
-
"type": [
|
|
136
|
-
"string",
|
|
137
|
-
"null"
|
|
138
|
-
],
|
|
139
|
-
"description": "Voucher code or campaign name for the purchase"
|
|
140
|
-
},
|
|
141
83
|
"cost_net": {
|
|
142
84
|
"$ref": "https://shushed.example.com/money.schema.json"
|
|
143
85
|
}
|
|
@@ -12,21 +12,12 @@
|
|
|
12
12
|
"type": "object",
|
|
13
13
|
"properties": {
|
|
14
14
|
"erp_id": {
|
|
15
|
-
"type": [
|
|
16
|
-
|
|
17
|
-
],
|
|
18
|
-
"faker": {
|
|
19
|
-
"custom.documentid": [
|
|
20
|
-
"SP",
|
|
21
|
-
9
|
|
22
|
-
]
|
|
23
|
-
},
|
|
15
|
+
"type": ["string"],
|
|
16
|
+
"faker": { "custom.documentid": ["SP", 9] },
|
|
24
17
|
"description": "Unique identifier for the shipment from the ERP system."
|
|
25
18
|
},
|
|
26
19
|
"type": {
|
|
27
|
-
"type": [
|
|
28
|
-
"string"
|
|
29
|
-
],
|
|
20
|
+
"type": ["string"],
|
|
30
21
|
"enum": [
|
|
31
22
|
"SHIPPED-OUTBOUND",
|
|
32
23
|
"SHIPPED-RETURN",
|
|
@@ -36,45 +27,17 @@
|
|
|
36
27
|
"description": "Type of shipment. Can be shipped or returned from warehouse or POS."
|
|
37
28
|
},
|
|
38
29
|
"shipped_at": {
|
|
39
|
-
"type": [
|
|
40
|
-
"string"
|
|
41
|
-
],
|
|
30
|
+
"type": ["string"],
|
|
42
31
|
"format": "date-time",
|
|
43
32
|
"description": "Date and time the shipment was shipped."
|
|
44
33
|
},
|
|
45
34
|
"status": {
|
|
46
|
-
"type": [
|
|
47
|
-
|
|
48
|
-
],
|
|
49
|
-
"enum": [
|
|
50
|
-
"PENDING",
|
|
51
|
-
"SHIPPED",
|
|
52
|
-
"RECEIVED",
|
|
53
|
-
"CANCELLED"
|
|
54
|
-
],
|
|
35
|
+
"type": ["string"],
|
|
36
|
+
"enum": ["PENDING", "SHIPPED", "RECEIVED", "CANCELLED"],
|
|
55
37
|
"description": "Current status of the shipment."
|
|
56
38
|
},
|
|
57
|
-
"discount_code": {
|
|
58
|
-
"type": [
|
|
59
|
-
"string",
|
|
60
|
-
"null"
|
|
61
|
-
],
|
|
62
|
-
"faker": {
|
|
63
|
-
"format": "uuid"
|
|
64
|
-
},
|
|
65
|
-
"description": "Code applied to trigger a discount, if any."
|
|
66
|
-
},
|
|
67
|
-
"discount_campaign": {
|
|
68
|
-
"type": [
|
|
69
|
-
"string",
|
|
70
|
-
"null"
|
|
71
|
-
],
|
|
72
|
-
"description": "Voucher code or campaign name for the purchase"
|
|
73
|
-
},
|
|
74
39
|
"items": {
|
|
75
|
-
"type": [
|
|
76
|
-
"array"
|
|
77
|
-
],
|
|
40
|
+
"type": ["array"],
|
|
78
41
|
"items": {
|
|
79
42
|
"type": "object",
|
|
80
43
|
"anyOf": [
|
|
@@ -91,10 +54,5 @@
|
|
|
91
54
|
}
|
|
92
55
|
}
|
|
93
56
|
],
|
|
94
|
-
"required": [
|
|
95
|
-
"erp_id",
|
|
96
|
-
"shipped_at",
|
|
97
|
-
"status",
|
|
98
|
-
"items"
|
|
99
|
-
]
|
|
57
|
+
"required": ["erp_id", "shipped_at", "status", "items"]
|
|
100
58
|
}
|
|
@@ -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": "Gift Voucher", "additionalProperties": false, "type": "object", "properties": { "code": { "type": "string" }, "last_modified_at": { "type": "string", "format": "date-time" }, "valid_from": { "type": "string", "format": "date-time" }, "valid_until": { "type": "string", "format": "date-time" }, "
|
|
3
|
+
const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Gift Voucher", "additionalProperties": false, "type": "object", "properties": { "code": { "type": "string" }, "last_modified_at": { "type": "string", "format": "date-time" }, "valid_from": { "type": "string", "format": "date-time" }, "valid_until": { "type": "string", "format": "date-time" }, "customer_email": { "type": ["string", "null"], "format": "email", "example": "alice.johnson@example.com" }, "purchased_at": { "type": "string", "format": "date-time" }, "balance": { "$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": "#/properties/balance/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"] }, "is_physical": { "type": "boolean" }, "has_been_emailed": { "type": "boolean" } }, "required": ["code", "last_modified_at", "valid_from", "valid_until", "customer_email", "purchased_at", "balance", "is_physical", "has_been_emailed"], "$id": "https://shushed.example.com/gift-voucher.schema.json" };
|
|
4
4
|
exports.default = schema;
|
|
@@ -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"], "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"] }, "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"] }, "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" };
|
|
4
4
|
exports.default = schema;
|