@shushed/helpers 0.0.275 → 0.0.276

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