ordercloud-python 2026.4.1__py3-none-any.whl

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 (114) hide show
  1. ordercloud/__init__.py +37 -0
  2. ordercloud/auth.py +136 -0
  3. ordercloud/client.py +211 -0
  4. ordercloud/config.py +42 -0
  5. ordercloud/errors.py +47 -0
  6. ordercloud/http.py +218 -0
  7. ordercloud/middleware.py +66 -0
  8. ordercloud/models/__init__.py +271 -0
  9. ordercloud/models/address.py +47 -0
  10. ordercloud/models/api_client.py +116 -0
  11. ordercloud/models/approval.py +73 -0
  12. ordercloud/models/assignments.py +402 -0
  13. ordercloud/models/auth_models.py +114 -0
  14. ordercloud/models/bundle.py +31 -0
  15. ordercloud/models/buyer.py +271 -0
  16. ordercloud/models/catalog.py +33 -0
  17. ordercloud/models/category.py +35 -0
  18. ordercloud/models/cost_center.py +27 -0
  19. ordercloud/models/credit_card.py +35 -0
  20. ordercloud/models/delivery.py +277 -0
  21. ordercloud/models/discount.py +63 -0
  22. ordercloud/models/integration.py +76 -0
  23. ordercloud/models/inventory_record.py +53 -0
  24. ordercloud/models/line_item.py +95 -0
  25. ordercloud/models/line_item_types.py +89 -0
  26. ordercloud/models/message_sender.py +80 -0
  27. ordercloud/models/misc.py +280 -0
  28. ordercloud/models/open_id_connect.py +47 -0
  29. ordercloud/models/order.py +477 -0
  30. ordercloud/models/order_return.py +92 -0
  31. ordercloud/models/payment.py +77 -0
  32. ordercloud/models/price_schedule.py +76 -0
  33. ordercloud/models/product.py +227 -0
  34. ordercloud/models/product_collection.py +186 -0
  35. ordercloud/models/promotion.py +297 -0
  36. ordercloud/models/security.py +89 -0
  37. ordercloud/models/shared.py +131 -0
  38. ordercloud/models/shipment.py +150 -0
  39. ordercloud/models/spec.py +67 -0
  40. ordercloud/models/spending_account.py +33 -0
  41. ordercloud/models/subscription.py +125 -0
  42. ordercloud/models/supplier.py +43 -0
  43. ordercloud/models/sync.py +172 -0
  44. ordercloud/models/user.py +207 -0
  45. ordercloud/models/user_group.py +27 -0
  46. ordercloud/models/webhook.py +58 -0
  47. ordercloud/py.typed +0 -0
  48. ordercloud/resources/__init__.py +65 -0
  49. ordercloud/resources/addresses.py +228 -0
  50. ordercloud/resources/admin_addresses.py +128 -0
  51. ordercloud/resources/admin_user_groups.py +185 -0
  52. ordercloud/resources/admin_users.py +150 -0
  53. ordercloud/resources/api_clients.py +308 -0
  54. ordercloud/resources/approval_rules.py +144 -0
  55. ordercloud/resources/base.py +145 -0
  56. ordercloud/resources/bundle_line_items.py +59 -0
  57. ordercloud/resources/bundle_subscription_items.py +54 -0
  58. ordercloud/resources/bundles.py +278 -0
  59. ordercloud/resources/buyer_groups.py +128 -0
  60. ordercloud/resources/buyers.py +164 -0
  61. ordercloud/resources/cart.py +613 -0
  62. ordercloud/resources/catalogs.py +311 -0
  63. ordercloud/resources/categories.py +392 -0
  64. ordercloud/resources/cost_centers.py +222 -0
  65. ordercloud/resources/credit_cards.py +227 -0
  66. ordercloud/resources/delivery_configurations.py +132 -0
  67. ordercloud/resources/discounts.py +201 -0
  68. ordercloud/resources/entity_syncs.py +534 -0
  69. ordercloud/resources/error_configs.py +71 -0
  70. ordercloud/resources/forgotten_credentials.py +74 -0
  71. ordercloud/resources/group_orders.py +28 -0
  72. ordercloud/resources/impersonation_configs.py +132 -0
  73. ordercloud/resources/incrementors.py +128 -0
  74. ordercloud/resources/integration_events.py +203 -0
  75. ordercloud/resources/inventory_integrations.py +65 -0
  76. ordercloud/resources/inventory_records.py +484 -0
  77. ordercloud/resources/line_items.py +262 -0
  78. ordercloud/resources/locales.py +203 -0
  79. ordercloud/resources/me.py +1882 -0
  80. ordercloud/resources/message_senders.py +261 -0
  81. ordercloud/resources/open_id_connects.py +128 -0
  82. ordercloud/resources/order_returns.py +306 -0
  83. ordercloud/resources/order_syncs.py +65 -0
  84. ordercloud/resources/orders.py +689 -0
  85. ordercloud/resources/payments.py +176 -0
  86. ordercloud/resources/price_schedules.py +164 -0
  87. ordercloud/resources/product_collections.py +116 -0
  88. ordercloud/resources/product_facets.py +128 -0
  89. ordercloud/resources/product_syncs.py +76 -0
  90. ordercloud/resources/products.py +454 -0
  91. ordercloud/resources/promotion_integrations.py +65 -0
  92. ordercloud/resources/promotions.py +203 -0
  93. ordercloud/resources/security_profiles.py +222 -0
  94. ordercloud/resources/seller_approval_rules.py +128 -0
  95. ordercloud/resources/shipments.py +256 -0
  96. ordercloud/resources/specs.py +313 -0
  97. ordercloud/resources/spending_accounts.py +227 -0
  98. ordercloud/resources/subscription_integrations.py +65 -0
  99. ordercloud/resources/subscription_items.py +146 -0
  100. ordercloud/resources/subscriptions.py +128 -0
  101. ordercloud/resources/supplier_addresses.py +144 -0
  102. ordercloud/resources/supplier_user_groups.py +210 -0
  103. ordercloud/resources/supplier_users.py +170 -0
  104. ordercloud/resources/suppliers.py +190 -0
  105. ordercloud/resources/tracking_events.py +130 -0
  106. ordercloud/resources/user_groups.py +210 -0
  107. ordercloud/resources/users.py +254 -0
  108. ordercloud/resources/webhooks.py +128 -0
  109. ordercloud/resources/xp_indices.py +77 -0
  110. ordercloud/sync_client.py +170 -0
  111. ordercloud_python-2026.4.1.dist-info/METADATA +552 -0
  112. ordercloud_python-2026.4.1.dist-info/RECORD +114 -0
  113. ordercloud_python-2026.4.1.dist-info/WHEEL +4 -0
  114. ordercloud_python-2026.4.1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,477 @@
1
+ # GENERATED by tools/codegen — DO NOT EDIT
2
+ # Source: ordercloud-openapi-v3.json
3
+ """OrderCloud OrderApprovalInfo and related models."""
4
+
5
+ from __future__ import annotations
6
+ from typing import Generic, Optional
7
+ from pydantic import Field
8
+
9
+ from .shared import OrderCloudModel, XP
10
+ from .address import Address
11
+ from .approval import ApprovalStatus
12
+ from .line_item import LineItem
13
+ from .line_item_types import LineItemProduct, LineItemSpec, LineItemVariant
14
+ from .misc import OrderDirection, OrderStatus
15
+ from .product import AdHocProduct
16
+ from .promotion import PromotionOverride
17
+ from .shipment import ShipEstimateResponse
18
+ from .subscription import Subscription, SubscriptionIntegrationResponse
19
+ from .user import OrderUser, User
20
+
21
+ __all__ = [
22
+ "OrderApprovalInfo",
23
+ "ApprovalInfo",
24
+ "OrderApproval",
25
+ "OrderPromotion",
26
+ "ShipMethodSelection",
27
+ "OrderShipMethodSelection",
28
+ "OrderSplitResult",
29
+ "OrderSubmitResponse",
30
+ "OrderSubmitForApprovalResponse",
31
+ "OrderApprovedResponse",
32
+ "OrderCalculateResponse",
33
+ "LineItemOverride",
34
+ "ExtendedLineItem",
35
+ "OrderWorksheet",
36
+ "Order",
37
+ "OrderDirection",
38
+ "OrderStatus",
39
+ ]
40
+ _Subscription = Subscription
41
+ _ShipEstimateResponse = ShipEstimateResponse
42
+ _SubscriptionIntegrationResponse = SubscriptionIntegrationResponse
43
+
44
+
45
+ class OrderApprovalInfo(OrderCloudModel):
46
+ """An OrderCloud OrderApprovalInfo.
47
+
48
+ Attributes:
49
+ allow_resubmit: Only relevant when declining an order. Changes the order Status back to Unsubmitted and allows the user to make changes and resubmit.
50
+ comments: Comments to be saved with the order approval or denial.
51
+ """
52
+
53
+ allow_resubmit: Optional[bool] = Field(None, alias="AllowResubmit")
54
+ comments: Optional[str] = Field(None, alias="Comments")
55
+
56
+
57
+ class ApprovalInfo(OrderCloudModel):
58
+ """An OrderCloud ApprovalInfo.
59
+
60
+ Attributes:
61
+ comments: Comments to be saved with the order approval or denial.
62
+ """
63
+
64
+ comments: Optional[str] = Field(None, alias="Comments")
65
+
66
+
67
+ class OrderApproval(OrderCloudModel):
68
+ """An OrderCloud OrderApproval.
69
+
70
+ Attributes:
71
+ allow_resubmit: If true, the submitting user will be able to modify the order and resubmit for approval. (read-only)
72
+ approval_rule_id: (read-only)
73
+ approving_group_id: (read-only)
74
+ status: (read-only)
75
+ date_created: (read-only)
76
+ date_completed: (read-only)
77
+ approver: (read-only)
78
+ comments: (read-only)
79
+ """
80
+
81
+ allow_resubmit: Optional[bool] = Field(None, alias="AllowResubmit")
82
+ approval_rule_id: Optional[str] = Field(None, alias="ApprovalRuleID")
83
+ approving_group_id: Optional[str] = Field(None, alias="ApprovingGroupID")
84
+ status: Optional[ApprovalStatus] = Field(None, alias="Status")
85
+ date_created: Optional[str] = Field(None, alias="DateCreated")
86
+ date_completed: Optional[str] = Field(None, alias="DateCompleted")
87
+ approver: Optional[User] = Field(None, alias="Approver")
88
+ comments: Optional[str] = Field(None, alias="Comments")
89
+
90
+
91
+ class OrderPromotion(OrderCloudModel, Generic[XP]):
92
+ """An OrderCloud OrderPromotion.
93
+
94
+ Attributes:
95
+ amount: (read-only)
96
+ line_item_id: (read-only)
97
+ amount_overridden: True when the Amount has been set via PromotionOverrides. (read-only)
98
+ date_applied: (read-only)
99
+ id:
100
+ line_item_level: If true, certain eligible expression requirements must be met, and the PromotionDiscount will be applied at the line item level.
101
+ code: Must be unique. Entered by buyer when adding promo to order.
102
+ name:
103
+ redemption_limit: Limit the total number of orders this promotion can be applied to across all users.
104
+ redemption_limit_per_user: Limit the total number of orders this promotion can be applied to per user.
105
+ redemption_count: The number of times this promotion has been applied to an order. (read-only)
106
+ quantity_limit_per_order: Can only be used when LineItemLevel is true and ItemLimitPerOrder does not have a value. When defined the ValueExpression will be the discount applied to each qualifying quantity of eligible items. When no ItemSortBy is defined, items will be sorted by DateAdded ascending.
107
+ item_limit_per_order: Can only be used when LineItemLevel is true and QuantityLimitPerOrder does not have a value. Limits the number of items the promotion will apply to when eligible. When no ItemSortBy is defined, items will be sorted by DateAdded ascending.
108
+ item_sort_by: Comma delimited list of properties to sort by. Can only be used when ItemLimitPerOrder is true. Used to determine the order in which the promotion is applied to the specified limit of items. Use ! to reverse sort order on a property.
109
+ description:
110
+ fine_print: For reference only. Terms, conditions, and other legal jargon.
111
+ start_date:
112
+ expiration_date:
113
+ eligible_expression: The expression evaluated to determine if an item or order is eligible for a promotion. See rules engine documentation for formatting details.
114
+ value_expression: The expression evaluated to determine the discount amount of an eligible promotion. See rules engine documentation for formatting details.
115
+ can_combine: If true, the promotion can be applied to an order that already other promotions applied, as long as they can also be combined.
116
+ allow_all_buyers: Allow promo to be used by all buyers without creating explicit assignments.
117
+ owner_id: ID of the organization that owns the promotion. Only the marketplace owner can override the OwnerID on create.
118
+ auto_apply:
119
+ active:
120
+ use_integration:
121
+ priority: Used to control the order in which promotions are applied when calling the auto apply or refresh endpoint.
122
+ xp:
123
+ """
124
+
125
+ amount: float = Field(0.0, alias="Amount")
126
+ line_item_id: Optional[str] = Field(None, alias="LineItemID")
127
+ amount_overridden: Optional[bool] = Field(None, alias="AmountOverridden")
128
+ date_applied: Optional[str] = Field(None, alias="DateApplied")
129
+ id: Optional[str] = Field(None, alias="ID")
130
+ line_item_level: Optional[bool] = Field(None, alias="LineItemLevel")
131
+ code: Optional[str] = Field(None, alias="Code")
132
+ name: Optional[str] = Field(None, alias="Name")
133
+ redemption_limit: Optional[int] = Field(None, alias="RedemptionLimit")
134
+ redemption_limit_per_user: Optional[int] = Field(None, alias="RedemptionLimitPerUser")
135
+ redemption_count: int = Field(0, alias="RedemptionCount")
136
+ quantity_limit_per_order: Optional[int] = Field(None, alias="QuantityLimitPerOrder")
137
+ item_limit_per_order: Optional[int] = Field(None, alias="ItemLimitPerOrder")
138
+ item_sort_by: Optional[str] = Field(None, alias="ItemSortBy")
139
+ description: Optional[str] = Field(None, alias="Description")
140
+ fine_print: Optional[str] = Field(None, alias="FinePrint")
141
+ start_date: Optional[str] = Field(None, alias="StartDate")
142
+ expiration_date: Optional[str] = Field(None, alias="ExpirationDate")
143
+ eligible_expression: Optional[str] = Field(None, alias="EligibleExpression")
144
+ value_expression: Optional[str] = Field(None, alias="ValueExpression")
145
+ can_combine: Optional[bool] = Field(None, alias="CanCombine")
146
+ allow_all_buyers: Optional[bool] = Field(None, alias="AllowAllBuyers")
147
+ owner_id: Optional[str] = Field(None, alias="OwnerID")
148
+ auto_apply: bool = Field(False, alias="AutoApply")
149
+ active: bool = Field(True, alias="Active")
150
+ use_integration: Optional[bool] = Field(None, alias="UseIntegration")
151
+ priority: Optional[int] = Field(None, alias="Priority")
152
+ xp: Optional[XP] = Field(None, alias="xp")
153
+
154
+
155
+ class ShipMethodSelection(OrderCloudModel):
156
+ """An OrderCloud ShipMethodSelection.
157
+
158
+ Attributes:
159
+ ship_estimate_id:
160
+ ship_method_id:
161
+ """
162
+
163
+ ship_estimate_id: Optional[str] = Field(None, alias="ShipEstimateID")
164
+ ship_method_id: Optional[str] = Field(None, alias="ShipMethodID")
165
+
166
+
167
+ class OrderShipMethodSelection(OrderCloudModel):
168
+ """An OrderCloud OrderShipMethodSelection.
169
+
170
+ Attributes:
171
+ ship_method_selections:
172
+ """
173
+
174
+ ship_method_selections: Optional[list[ShipMethodSelection]] = Field(
175
+ None, alias="ShipMethodSelections"
176
+ )
177
+
178
+
179
+ class OrderSplitResult(OrderCloudModel):
180
+ """An OrderCloud OrderSplitResult.
181
+
182
+ Attributes:
183
+ outgoing_orders: The outgoing orders created, one for each unique Product.DefaultSupplierID on the original order.
184
+ remaining_line_item_i_ds: IDs of line items not added to an outgoing order, most likely because Product.DefaultSupplierID is not set.
185
+ """
186
+
187
+ outgoing_orders: Optional[list[Order]] = Field(None, alias="OutgoingOrders")
188
+ remaining_line_item_i_ds: Optional[list[str]] = Field(None, alias="RemainingLineItemIDs")
189
+
190
+
191
+ class OrderSubmitResponse(OrderCloudModel, Generic[XP]):
192
+ """An OrderCloud OrderSubmitResponse.
193
+
194
+ Attributes:
195
+ http_status_code:
196
+ unhandled_error_body:
197
+ xp:
198
+ succeeded:
199
+ """
200
+
201
+ http_status_code: Optional[int] = Field(None, alias="HttpStatusCode")
202
+ unhandled_error_body: Optional[str] = Field(None, alias="UnhandledErrorBody")
203
+ xp: Optional[XP] = Field(None, alias="xp")
204
+ succeeded: Optional[bool] = Field(None, alias="Succeeded")
205
+
206
+
207
+ class OrderSubmitForApprovalResponse(OrderCloudModel, Generic[XP]):
208
+ """An OrderCloud OrderSubmitForApprovalResponse.
209
+
210
+ Attributes:
211
+ http_status_code:
212
+ unhandled_error_body:
213
+ xp:
214
+ succeeded:
215
+ """
216
+
217
+ http_status_code: Optional[int] = Field(None, alias="HttpStatusCode")
218
+ unhandled_error_body: Optional[str] = Field(None, alias="UnhandledErrorBody")
219
+ xp: Optional[XP] = Field(None, alias="xp")
220
+ succeeded: Optional[bool] = Field(None, alias="Succeeded")
221
+
222
+
223
+ class OrderApprovedResponse(OrderCloudModel, Generic[XP]):
224
+ """An OrderCloud OrderApprovedResponse.
225
+
226
+ Attributes:
227
+ http_status_code:
228
+ unhandled_error_body:
229
+ xp:
230
+ succeeded:
231
+ """
232
+
233
+ http_status_code: Optional[int] = Field(None, alias="HttpStatusCode")
234
+ unhandled_error_body: Optional[str] = Field(None, alias="UnhandledErrorBody")
235
+ xp: Optional[XP] = Field(None, alias="xp")
236
+ succeeded: Optional[bool] = Field(None, alias="Succeeded")
237
+
238
+
239
+ class OrderCalculateResponse(OrderCloudModel, Generic[XP]):
240
+ """An OrderCloud OrderCalculateResponse.
241
+
242
+ Attributes:
243
+ line_item_overrides:
244
+ shipping_total:
245
+ tax_total:
246
+ fee_total:
247
+ http_status_code:
248
+ unhandled_error_body:
249
+ xp:
250
+ succeeded:
251
+ """
252
+
253
+ line_item_overrides: Optional[list[LineItemOverride]] = Field(None, alias="LineItemOverrides")
254
+ shipping_total: Optional[float] = Field(None, alias="ShippingTotal")
255
+ tax_total: Optional[float] = Field(None, alias="TaxTotal")
256
+ fee_total: Optional[float] = Field(None, alias="FeeTotal")
257
+ http_status_code: Optional[int] = Field(None, alias="HttpStatusCode")
258
+ unhandled_error_body: Optional[str] = Field(None, alias="UnhandledErrorBody")
259
+ xp: Optional[XP] = Field(None, alias="xp")
260
+ succeeded: Optional[bool] = Field(None, alias="Succeeded")
261
+
262
+
263
+ class LineItemOverride(OrderCloudModel):
264
+ """An OrderCloud LineItemOverride.
265
+
266
+ Attributes:
267
+ line_item_id:
268
+ unit_price:
269
+ product:
270
+ promotion_overrides:
271
+ inventory_record_id:
272
+ remove:
273
+ """
274
+
275
+ line_item_id: Optional[str] = Field(None, alias="LineItemID")
276
+ unit_price: Optional[float] = Field(None, alias="UnitPrice")
277
+ product: Optional[AdHocProduct] = Field(None, alias="Product")
278
+ promotion_overrides: Optional[list[PromotionOverride]] = Field(None, alias="PromotionOverrides")
279
+ inventory_record_id: Optional[str] = Field(None, alias="InventoryRecordID")
280
+ remove: Optional[bool] = Field(None, alias="Remove")
281
+
282
+
283
+ class ExtendedLineItem(OrderCloudModel, Generic[XP]):
284
+ """An OrderCloud ExtendedLineItem.
285
+
286
+ Attributes:
287
+ order_id:
288
+ order: Currently unused.
289
+ id:
290
+ product_id:
291
+ quantity:
292
+ bundle_item_id: The ID of the line item that represents the bundle. Signifies that the product is being purchased as part of a bundle. (read-only)
293
+ is_bundle: When true, this item represents a bundle being purchased. (read-only)
294
+ date_added: (read-only)
295
+ quantity_shipped: Sum of QuantityShipped from all shipment items. (read-only)
296
+ unit_price: Auto calculated price per quantity. Modification requires OverrideUnitPrice role.
297
+ promotion_discount: Sum of all line item level promotion discount amounts applied. (read-only)
298
+ base_discount: Discount amount from discount assignments applied to this line item. (read-only)
299
+ discount_id: ID of the discount applied to this line item. (read-only)
300
+ line_total: LineSubtotal - BaseDiscount - PromotionDiscount (read-only)
301
+ line_subtotal: UnitPrice x Quantity (read-only)
302
+ cost_center: For reference only, does not influence any OrderCloud behavior.
303
+ date_needed:
304
+ shipping_account: For reference only, does not influence any OrderCloud behavior.
305
+ shipping_address_id:
306
+ ship_from_address_id: Marketplace owner or supplier AddressID where the product will be shipped from. Can be used to calculate shipping costs.
307
+ product: (read-only)
308
+ variant: (read-only)
309
+ shipping_address: (read-only)
310
+ ship_from_address: (read-only)
311
+ supplier_id: (read-only)
312
+ inventory_record_id: InventoryRecordID of which product inventory location to use. Cannot be modified once an order is submitted.
313
+ price_schedule_id: PriceScheduleID used to determine unit price. (read-only)
314
+ is_on_sale: True when the price schedule and price break has an active SalePrice. (read-only)
315
+ price_overridden: If true, UnitPrice was overridden. (read-only)
316
+ specs:
317
+ incoming_order_id: ID of the original order. Only returns a value for the marketplace owner. (read-only)
318
+ outgoing_order_id: ID of the split or forwarded order. Only returns a value for the marketplace owner. (read-only)
319
+ invitation_id: (read-only)
320
+ xp:
321
+ """
322
+
323
+ order_id: Optional[str] = Field(None, alias="OrderID")
324
+ order: Optional[_Order] = Field(None, alias="Order")
325
+ id: Optional[str] = Field(None, alias="ID")
326
+ product_id: Optional[str] = Field(None, alias="ProductID")
327
+ quantity: int = Field(1, alias="Quantity")
328
+ bundle_item_id: Optional[str] = Field(None, alias="BundleItemID")
329
+ is_bundle: Optional[bool] = Field(None, alias="IsBundle")
330
+ date_added: Optional[str] = Field(None, alias="DateAdded")
331
+ quantity_shipped: int = Field(0, alias="QuantityShipped")
332
+ unit_price: Optional[float] = Field(None, alias="UnitPrice")
333
+ promotion_discount: float = Field(0.0, alias="PromotionDiscount")
334
+ base_discount: float = Field(0.0, alias="BaseDiscount")
335
+ discount_id: Optional[str] = Field(None, alias="DiscountID")
336
+ line_total: float = Field(0.0, alias="LineTotal")
337
+ line_subtotal: float = Field(0.0, alias="LineSubtotal")
338
+ cost_center: Optional[str] = Field(None, alias="CostCenter")
339
+ date_needed: Optional[str] = Field(None, alias="DateNeeded")
340
+ shipping_account: Optional[str] = Field(None, alias="ShippingAccount")
341
+ shipping_address_id: Optional[str] = Field(None, alias="ShippingAddressID")
342
+ ship_from_address_id: Optional[str] = Field(None, alias="ShipFromAddressID")
343
+ product: Optional[LineItemProduct] = Field(None, alias="Product")
344
+ variant: Optional[LineItemVariant] = Field(None, alias="Variant")
345
+ shipping_address: Optional[Address] = Field(None, alias="ShippingAddress")
346
+ ship_from_address: Optional[Address] = Field(None, alias="ShipFromAddress")
347
+ supplier_id: Optional[str] = Field(None, alias="SupplierID")
348
+ inventory_record_id: Optional[str] = Field(None, alias="InventoryRecordID")
349
+ price_schedule_id: Optional[str] = Field(None, alias="PriceScheduleID")
350
+ is_on_sale: Optional[bool] = Field(None, alias="IsOnSale")
351
+ price_overridden: Optional[bool] = Field(None, alias="PriceOverridden")
352
+ specs: Optional[list[LineItemSpec]] = Field(None, alias="Specs")
353
+ incoming_order_id: Optional[str] = Field(None, alias="IncomingOrderID")
354
+ outgoing_order_id: Optional[str] = Field(None, alias="OutgoingOrderID")
355
+ invitation_id: Optional[str] = Field(None, alias="InvitationID")
356
+ xp: Optional[XP] = Field(None, alias="xp")
357
+
358
+
359
+ class OrderWorksheet(OrderCloudModel):
360
+ """An OrderCloud OrderWorksheet.
361
+
362
+ Attributes:
363
+ order:
364
+ line_items:
365
+ order_promotions:
366
+ subscription:
367
+ ship_estimate_response:
368
+ order_calculate_response:
369
+ order_submit_response:
370
+ order_submit_for_approval_response:
371
+ order_approved_response:
372
+ subscription_integration_response:
373
+ """
374
+
375
+ order: Optional[_Order] = Field(None, alias="Order")
376
+ line_items: Optional[list[LineItem]] = Field(None, alias="LineItems")
377
+ order_promotions: Optional[list[OrderPromotion]] = Field(None, alias="OrderPromotions")
378
+ subscription: Optional[_Subscription] = Field(None, alias="Subscription")
379
+ ship_estimate_response: Optional[_ShipEstimateResponse] = Field(
380
+ None, alias="ShipEstimateResponse"
381
+ )
382
+ order_calculate_response: Optional[_OrderCalculateResponse] = Field(
383
+ None, alias="OrderCalculateResponse"
384
+ )
385
+ order_submit_response: Optional[_OrderSubmitResponse] = Field(None, alias="OrderSubmitResponse")
386
+ order_submit_for_approval_response: Optional[_OrderSubmitForApprovalResponse] = Field(
387
+ None, alias="OrderSubmitForApprovalResponse"
388
+ )
389
+ order_approved_response: Optional[_OrderApprovedResponse] = Field(
390
+ None, alias="OrderApprovedResponse"
391
+ )
392
+ subscription_integration_response: Optional[_SubscriptionIntegrationResponse] = Field(
393
+ None, alias="SubscriptionIntegrationResponse"
394
+ )
395
+
396
+
397
+ class Order(OrderCloudModel, Generic[XP]):
398
+ """An OrderCloud Order.
399
+
400
+ Attributes:
401
+ id:
402
+ from_user: User placing the order. (read-only)
403
+ from_company_id: ID of the Buyer placing the order, or the marketplace owner when an order is being forwarded. Mainly useful to the marketplace owner or supplier receiving it.
404
+ to_company_id: ID of the marketplace owner or supplier receiving the order, only writable on create. Mainly useful to the user placing it.
405
+ from_user_id: This property is only writable when creating an order on behalf of a buyer user.
406
+ billing_address_id:
407
+ billing_address: (read-only)
408
+ shipping_address_id: ID of the ShippingAddress for all line items on the order. Null when there are multiple shipping addresses defined.
409
+ comments:
410
+ line_item_count: (read-only)
411
+ status: (read-only)
412
+ date_created: (read-only)
413
+ date_submitted: Null until the order passes from the buyer to the marketplace owner, including when Status is PendingApproval. (read-only)
414
+ date_approved: (read-only)
415
+ date_declined: (read-only)
416
+ date_canceled: (read-only)
417
+ date_completed: Populated when all items on an order have shipped, or the order is explicitly completed. (read-only)
418
+ last_updated: (read-only)
419
+ subtotal: Sum of all LineItem.LineSubtotals. (read-only)
420
+ shipping_cost: Modifying requires OverrideShipping role.
421
+ tax_cost: Modifying requires TaxOverride role.
422
+ gratuity:
423
+ fees: Fees associated with order or line items (read-only)
424
+ base_discount: Sum of all discount amounts from discount assignments applied to line items on this order. (read-only)
425
+ promotion_discount: Sum of all promotion amounts applied to the order. (read-only)
426
+ currency: Inherited from the user placing the order. (read-only)
427
+ total: Subtotal - BaseDiscount - PromotionDiscount + TaxCost + ShippingCost + Gratuity + Fees (read-only)
428
+ is_submitted: True if this order has been passed from the Buyer to the marketplace owner or supplier. (read-only)
429
+ subscription_id: ID of the subscription used to create an order in an automated process. (read-only)
430
+ xp:
431
+ """
432
+
433
+ id: Optional[str] = Field(None, alias="ID")
434
+ from_user: Optional[OrderUser] = Field(None, alias="FromUser")
435
+ from_company_id: Optional[str] = Field(None, alias="FromCompanyID")
436
+ to_company_id: Optional[str] = Field(None, alias="ToCompanyID")
437
+ from_user_id: Optional[str] = Field(None, alias="FromUserID")
438
+ billing_address_id: Optional[str] = Field(None, alias="BillingAddressID")
439
+ billing_address: Optional[Address] = Field(None, alias="BillingAddress")
440
+ shipping_address_id: Optional[str] = Field(None, alias="ShippingAddressID")
441
+ comments: Optional[str] = Field(None, alias="Comments")
442
+ line_item_count: int = Field(0, alias="LineItemCount")
443
+ status: Optional[OrderStatus] = Field(None, alias="Status")
444
+ date_created: Optional[str] = Field(None, alias="DateCreated")
445
+ date_submitted: Optional[str] = Field(None, alias="DateSubmitted")
446
+ date_approved: Optional[str] = Field(None, alias="DateApproved")
447
+ date_declined: Optional[str] = Field(None, alias="DateDeclined")
448
+ date_canceled: Optional[str] = Field(None, alias="DateCanceled")
449
+ date_completed: Optional[str] = Field(None, alias="DateCompleted")
450
+ last_updated: Optional[str] = Field(None, alias="LastUpdated")
451
+ subtotal: float = Field(0.0, alias="Subtotal")
452
+ shipping_cost: Optional[float] = Field(None, alias="ShippingCost")
453
+ tax_cost: Optional[float] = Field(None, alias="TaxCost")
454
+ gratuity: float = Field(0, alias="Gratuity")
455
+ fees: float = Field(0, alias="Fees")
456
+ base_discount: float = Field(0.0, alias="BaseDiscount")
457
+ promotion_discount: float = Field(0.0, alias="PromotionDiscount")
458
+ currency: Optional[str] = Field(None, alias="Currency")
459
+ total: float = Field(0.0, alias="Total")
460
+ is_submitted: Optional[bool] = Field(None, alias="IsSubmitted")
461
+ subscription_id: Optional[str] = Field(None, alias="SubscriptionID")
462
+ xp: Optional[XP] = Field(None, alias="xp")
463
+
464
+
465
+ _Order = Order
466
+
467
+
468
+ _OrderCalculateResponse = OrderCalculateResponse
469
+
470
+
471
+ _OrderSubmitResponse = OrderSubmitResponse
472
+
473
+
474
+ _OrderSubmitForApprovalResponse = OrderSubmitForApprovalResponse
475
+
476
+
477
+ _OrderApprovedResponse = OrderApprovedResponse
@@ -0,0 +1,92 @@
1
+ # GENERATED by tools/codegen — DO NOT EDIT
2
+ # Source: ordercloud-openapi-v3.json
3
+ """OrderCloud OrderReturnItem, OrderReturnApproval, OrderReturn models."""
4
+
5
+ from __future__ import annotations
6
+ from typing import Generic, Optional
7
+ from pydantic import Field
8
+
9
+ from .shared import OrderCloudModel, XP
10
+ from .approval import ApprovalStatus
11
+ from .misc import OrderStatus
12
+ from .user import User
13
+
14
+ __all__ = ["OrderReturnItem", "OrderReturnApproval", "OrderReturn"]
15
+
16
+
17
+ class OrderReturnItem(OrderCloudModel):
18
+ """An OrderCloud OrderReturnItem.
19
+
20
+ Attributes:
21
+ line_item_id:
22
+ quantity:
23
+ refund_amount:
24
+ comments:
25
+ """
26
+
27
+ line_item_id: Optional[str] = Field(None, alias="LineItemID")
28
+ quantity: int = Field(0, alias="Quantity")
29
+ refund_amount: Optional[float] = Field(None, alias="RefundAmount")
30
+ comments: Optional[str] = Field(None, alias="Comments")
31
+
32
+
33
+ class OrderReturnApproval(OrderCloudModel):
34
+ """An OrderCloud OrderReturnApproval.
35
+
36
+ Attributes:
37
+ order_return_id:
38
+ approval_rule_id: (read-only)
39
+ approving_group_id: (read-only)
40
+ status: (read-only)
41
+ date_created: (read-only)
42
+ date_completed: (read-only)
43
+ approver: (read-only)
44
+ comments: (read-only)
45
+ """
46
+
47
+ order_return_id: Optional[str] = Field(None, alias="OrderReturnID")
48
+ approval_rule_id: Optional[str] = Field(None, alias="ApprovalRuleID")
49
+ approving_group_id: Optional[str] = Field(None, alias="ApprovingGroupID")
50
+ status: Optional[ApprovalStatus] = Field(None, alias="Status")
51
+ date_created: Optional[str] = Field(None, alias="DateCreated")
52
+ date_completed: Optional[str] = Field(None, alias="DateCompleted")
53
+ approver: Optional[User] = Field(None, alias="Approver")
54
+ comments: Optional[str] = Field(None, alias="Comments")
55
+
56
+
57
+ class OrderReturn(OrderCloudModel, Generic[XP]):
58
+ """An OrderCloud OrderReturn.
59
+
60
+ Attributes:
61
+ id:
62
+ order_id:
63
+ payment_i_ds: IDs of payments associated with this order return. (read-only)
64
+ status: (read-only)
65
+ date_created: (read-only)
66
+ date_submitted: Will be null until the order return passes from the buyer to the seller, including when Status is PendingApproval. (read-only)
67
+ date_approved: (read-only)
68
+ date_declined: (read-only)
69
+ date_canceled: (read-only)
70
+ date_completed: Populated when payment to customer has been completed. (read-only)
71
+ last_updated: (read-only)
72
+ refund_amount: Sum of all RefundAmounts for items. This value can be overridden by a user with the OrderAdmin role. To remove the override set the value to null.
73
+ comments:
74
+ items_to_return:
75
+ xp:
76
+ """
77
+
78
+ id: Optional[str] = Field(None, alias="ID")
79
+ order_id: Optional[str] = Field(None, alias="OrderID")
80
+ payment_i_ds: Optional[list[str]] = Field(None, alias="PaymentIDs")
81
+ status: Optional[OrderStatus] = Field(None, alias="Status")
82
+ date_created: Optional[str] = Field(None, alias="DateCreated")
83
+ date_submitted: Optional[str] = Field(None, alias="DateSubmitted")
84
+ date_approved: Optional[str] = Field(None, alias="DateApproved")
85
+ date_declined: Optional[str] = Field(None, alias="DateDeclined")
86
+ date_canceled: Optional[str] = Field(None, alias="DateCanceled")
87
+ date_completed: Optional[str] = Field(None, alias="DateCompleted")
88
+ last_updated: Optional[str] = Field(None, alias="LastUpdated")
89
+ refund_amount: Optional[float] = Field(None, alias="RefundAmount")
90
+ comments: Optional[str] = Field(None, alias="Comments")
91
+ items_to_return: Optional[list[OrderReturnItem]] = Field(None, alias="ItemsToReturn")
92
+ xp: Optional[XP] = Field(None, alias="xp")
@@ -0,0 +1,77 @@
1
+ # GENERATED by tools/codegen — DO NOT EDIT
2
+ # Source: ordercloud-openapi-v3.json
3
+ """OrderCloud PaymentType, PaymentTransaction, Payment models."""
4
+
5
+ from __future__ import annotations
6
+ from typing import Generic, Optional
7
+ from pydantic import Field
8
+
9
+ from .shared import OrderCloudEnum, OrderCloudModel, XP
10
+
11
+ __all__ = ["PaymentType", "PaymentTransaction", "Payment"]
12
+
13
+
14
+ class PaymentType(OrderCloudEnum):
15
+ """"""
16
+
17
+ PurchaseOrder = "PurchaseOrder"
18
+ CreditCard = "CreditCard"
19
+ SpendingAccount = "SpendingAccount"
20
+
21
+
22
+ class PaymentTransaction(OrderCloudModel, Generic[XP]):
23
+ """An OrderCloud PaymentTransaction.
24
+
25
+ Attributes:
26
+ id:
27
+ type:
28
+ date_executed:
29
+ currency: Usually the same as Payment.Currency, but can be different. A marketplace owner may capture funds from the buyer user in one currency and process a payout to the seller in another.
30
+ amount: Usually the same as Payment.Amount, but can be different. A charge might have a subsequent partial credit, for example.
31
+ succeeded:
32
+ result_code:
33
+ result_message:
34
+ xp:
35
+ """
36
+
37
+ id: Optional[str] = Field(None, alias="ID")
38
+ type: Optional[str] = Field(None, alias="Type")
39
+ date_executed: Optional[str] = Field(None, alias="DateExecuted")
40
+ currency: Optional[str] = Field(None, alias="Currency")
41
+ amount: Optional[float] = Field(None, alias="Amount")
42
+ succeeded: Optional[bool] = Field(None, alias="Succeeded")
43
+ result_code: Optional[str] = Field(None, alias="ResultCode")
44
+ result_message: Optional[str] = Field(None, alias="ResultMessage")
45
+ xp: Optional[XP] = Field(None, alias="xp")
46
+
47
+
48
+ class Payment(OrderCloudModel, Generic[XP]):
49
+ """An OrderCloud Payment.
50
+
51
+ Attributes:
52
+ id:
53
+ type:
54
+ date_created: (read-only)
55
+ credit_card_id: Only writeable on create.
56
+ spending_account_id: Only writeable on create.
57
+ description:
58
+ currency: Inherited from order. (read-only)
59
+ amount: If null, payment applies to order total (or total of specific line items, if set), less any other payments where Amount is set. Value can only be negative if processing a payment for an order return.
60
+ accepted: All payments must be Accepted to submit an order. This property should be updated after authorizing or capturing the payment in your middleware by a user with the elevated OrderAdmin role.
61
+ order_return_id: Used to indicate this payment is associated with an order return.
62
+ xp:
63
+ transactions: (read-only)
64
+ """
65
+
66
+ id: Optional[str] = Field(None, alias="ID")
67
+ type: Optional[PaymentType] = Field(None, alias="Type")
68
+ date_created: Optional[str] = Field(None, alias="DateCreated")
69
+ credit_card_id: Optional[str] = Field(None, alias="CreditCardID")
70
+ spending_account_id: Optional[str] = Field(None, alias="SpendingAccountID")
71
+ description: Optional[str] = Field(None, alias="Description")
72
+ currency: Optional[str] = Field(None, alias="Currency")
73
+ amount: Optional[float] = Field(None, alias="Amount")
74
+ accepted: Optional[bool] = Field(None, alias="Accepted")
75
+ order_return_id: Optional[str] = Field(None, alias="OrderReturnID")
76
+ xp: Optional[XP] = Field(None, alias="xp")
77
+ transactions: Optional[list[PaymentTransaction]] = Field(None, alias="Transactions")