paid-python 0.6.0__py3-none-any.whl → 1.0.0a1__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 (140) hide show
  1. paid/__init__.py +65 -95
  2. paid/client.py +17 -494
  3. paid/contacts/client.py +415 -133
  4. paid/contacts/raw_client.py +1046 -118
  5. paid/core/client_wrapper.py +9 -10
  6. paid/customers/client.py +270 -566
  7. paid/customers/raw_client.py +731 -537
  8. paid/environment.py +1 -1
  9. paid/errors/bad_request_error.py +2 -2
  10. paid/errors/forbidden_error.py +2 -2
  11. paid/errors/internal_server_error.py +2 -2
  12. paid/errors/not_found_error.py +2 -2
  13. paid/invoices/client.py +369 -0
  14. paid/invoices/raw_client.py +692 -0
  15. paid/orders/__init__.py +0 -3
  16. paid/orders/client.py +371 -128
  17. paid/orders/raw_client.py +829 -121
  18. paid/products/__init__.py +0 -3
  19. paid/products/client.py +129 -265
  20. paid/products/raw_client.py +563 -233
  21. paid/signals/client.py +130 -0
  22. paid/signals/raw_client.py +190 -0
  23. paid/tracing/autoinstrumentation.py +12 -6
  24. paid/tracing/context_manager.py +2 -6
  25. paid/tracing/distributed_tracing.py +3 -3
  26. paid/tracing/signal.py +3 -3
  27. paid/tracing/wrappers/openai_agents/openaiAgentsHook.py +1 -1
  28. paid/types/__init__.py +62 -86
  29. paid/types/attribution.py +8 -0
  30. paid/types/{agent_attribute.py → bulk_signals_response.py} +4 -5
  31. paid/types/contact.py +12 -20
  32. paid/types/{address.py → contact_billing_address.py} +6 -7
  33. paid/types/{traces_response.py → contact_list_response.py} +5 -9
  34. paid/types/customer.py +15 -22
  35. paid/types/customer_attribution.py +8 -0
  36. paid/types/customer_billing_address.py +26 -0
  37. paid/types/{usage_summary_order.py → customer_by_external_id.py} +3 -5
  38. paid/types/{usage_summary_order_line.py → customer_by_id.py} +3 -5
  39. paid/types/customer_creation_state.py +5 -0
  40. paid/types/customer_list_response.py +22 -0
  41. paid/types/empty_response.py +17 -0
  42. paid/types/{error.py → error_response.py} +4 -7
  43. paid/types/invoice.py +57 -0
  44. paid/types/invoice_line.py +42 -0
  45. paid/types/invoice_line_payment_status.py +7 -0
  46. paid/types/invoice_lines_response.py +22 -0
  47. paid/types/invoice_list_response.py +22 -0
  48. paid/types/invoice_payment_status.py +5 -0
  49. paid/types/invoice_source.py +5 -0
  50. paid/types/invoice_status.py +7 -0
  51. paid/types/invoice_tax_status.py +7 -0
  52. paid/types/order.py +30 -29
  53. paid/types/order_creation_state.py +5 -0
  54. paid/types/order_line.py +6 -24
  55. paid/types/order_lines_response.py +22 -0
  56. paid/types/order_list_response.py +22 -0
  57. paid/types/pagination.py +24 -0
  58. paid/types/product.py +4 -29
  59. paid/types/{tier.py → product_by_external_id.py} +5 -4
  60. paid/types/{cost_amount.py → product_by_id.py} +5 -12
  61. paid/types/product_list_response.py +22 -0
  62. paid/types/signal.py +8 -34
  63. paid/types/{agent.py → update_contact_request.py} +10 -11
  64. paid/types/update_customer_request.py +38 -0
  65. paid/types/{product_update.py → update_product_request.py} +2 -12
  66. {paid_python-0.6.0.dist-info → paid_python-1.0.0a1.dist-info}/METADATA +27 -11
  67. paid_python-1.0.0a1.dist-info/RECORD +110 -0
  68. opentelemetry/instrumentation/openai/__init__.py +0 -54
  69. opentelemetry/instrumentation/openai/shared/__init__.py +0 -399
  70. opentelemetry/instrumentation/openai/shared/audio_wrappers.py +0 -247
  71. opentelemetry/instrumentation/openai/shared/chat_wrappers.py +0 -1192
  72. opentelemetry/instrumentation/openai/shared/completion_wrappers.py +0 -292
  73. opentelemetry/instrumentation/openai/shared/config.py +0 -15
  74. opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py +0 -311
  75. opentelemetry/instrumentation/openai/shared/event_emitter.py +0 -108
  76. opentelemetry/instrumentation/openai/shared/event_models.py +0 -41
  77. opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py +0 -68
  78. opentelemetry/instrumentation/openai/shared/span_utils.py +0 -0
  79. opentelemetry/instrumentation/openai/utils.py +0 -213
  80. opentelemetry/instrumentation/openai/v0/__init__.py +0 -176
  81. opentelemetry/instrumentation/openai/v1/__init__.py +0 -394
  82. opentelemetry/instrumentation/openai/v1/assistant_wrappers.py +0 -329
  83. opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py +0 -134
  84. opentelemetry/instrumentation/openai/v1/responses_wrappers.py +0 -1113
  85. opentelemetry/instrumentation/openai/version.py +0 -1
  86. paid/agents/client.py +0 -880
  87. paid/agents/raw_client.py +0 -785
  88. paid/orders/lines/client.py +0 -144
  89. paid/orders/lines/raw_client.py +0 -129
  90. paid/plans/__init__.py +0 -4
  91. paid/plans/client.py +0 -332
  92. paid/plans/raw_client.py +0 -464
  93. paid/products/types/__init__.py +0 -7
  94. paid/products/types/product_create_type.py +0 -5
  95. paid/traces/__init__.py +0 -4
  96. paid/traces/client.py +0 -218
  97. paid/traces/raw_client.py +0 -226
  98. paid/types/agent_price_point.py +0 -27
  99. paid/types/agent_price_point_tiers.py +0 -23
  100. paid/types/agent_update.py +0 -29
  101. paid/types/api_error.py +0 -29
  102. paid/types/billing_frequency.py +0 -5
  103. paid/types/charge_type.py +0 -5
  104. paid/types/cost_trace.py +0 -55
  105. paid/types/cost_traces_response.py +0 -26
  106. paid/types/creation_source.py +0 -5
  107. paid/types/creation_state.py +0 -5
  108. paid/types/customer_update.py +0 -40
  109. paid/types/entitlement_usage.py +0 -48
  110. paid/types/order_line_attribute.py +0 -27
  111. paid/types/order_line_attribute_create_one.py +0 -5
  112. paid/types/order_line_attribute_pricing.py +0 -33
  113. paid/types/order_line_create.py +0 -72
  114. paid/types/pagination_meta.py +0 -84
  115. paid/types/plan.py +0 -81
  116. paid/types/plan_group.py +0 -60
  117. paid/types/plan_plan_products_item.py +0 -35
  118. paid/types/plan_plan_products_item_plan_product_attribute_item.py +0 -34
  119. paid/types/price_point.py +0 -25
  120. paid/types/pricing.py +0 -31
  121. paid/types/pricing_model_type.py +0 -7
  122. paid/types/product_type.py +0 -5
  123. paid/types/product_update_type.py +0 -5
  124. paid/types/salutation.py +0 -5
  125. paid/types/signal_v_2.py +0 -56
  126. paid/types/tax_exempt_status.py +0 -5
  127. paid/types/trace.py +0 -69
  128. paid/types/usage_pagination_meta.py +0 -43
  129. paid/types/usage_summaries_response.py +0 -26
  130. paid/types/usage_summary.py +0 -121
  131. paid/usage/__init__.py +0 -7
  132. paid/usage/client.py +0 -321
  133. paid/usage/raw_client.py +0 -387
  134. paid/usage/types/__init__.py +0 -7
  135. paid/usage/types/usage_check_usage_response.py +0 -53
  136. paid_python-0.6.0.dist-info/RECORD +0 -153
  137. /paid/{agents → invoices}/__init__.py +0 -0
  138. /paid/{orders/lines → signals}/__init__.py +0 -0
  139. {paid_python-0.6.0.dist-info → paid_python-1.0.0a1.dist-info}/LICENSE +0 -0
  140. {paid_python-0.6.0.dist-info → paid_python-1.0.0a1.dist-info}/WHEEL +0 -0
paid/orders/client.py CHANGED
@@ -1,12 +1,15 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
+ import datetime as dt
3
4
  import typing
4
5
 
5
6
  from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
7
  from ..core.request_options import RequestOptions
8
+ from ..types.empty_response import EmptyResponse
7
9
  from ..types.order import Order
8
- from ..types.order_line_create import OrderLineCreate
9
- from .lines.client import AsyncLinesClient, LinesClient
10
+ from ..types.order_creation_state import OrderCreationState
11
+ from ..types.order_lines_response import OrderLinesResponse
12
+ from ..types.order_list_response import OrderListResponse
10
13
  from .raw_client import AsyncRawOrdersClient, RawOrdersClient
11
14
 
12
15
  # this is used as the default value for optional parameters
@@ -16,7 +19,6 @@ OMIT = typing.cast(typing.Any, ...)
16
19
  class OrdersClient:
17
20
  def __init__(self, *, client_wrapper: SyncClientWrapper):
18
21
  self._raw_client = RawOrdersClient(client_wrapper=client_wrapper)
19
- self.lines = LinesClient(client_wrapper=client_wrapper)
20
22
 
21
23
  @property
22
24
  def with_raw_response(self) -> RawOrdersClient:
@@ -29,17 +31,29 @@ class OrdersClient:
29
31
  """
30
32
  return self._raw_client
31
33
 
32
- def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Order]:
34
+ def list_orders(
35
+ self,
36
+ *,
37
+ limit: typing.Optional[int] = None,
38
+ offset: typing.Optional[int] = None,
39
+ request_options: typing.Optional[RequestOptions] = None,
40
+ ) -> OrderListResponse:
33
41
  """
42
+ Get a list of orders for the organization
43
+
34
44
  Parameters
35
45
  ----------
46
+ limit : typing.Optional[int]
47
+
48
+ offset : typing.Optional[int]
49
+
36
50
  request_options : typing.Optional[RequestOptions]
37
51
  Request-specific configuration.
38
52
 
39
53
  Returns
40
54
  -------
41
- typing.List[Order]
42
- Success response
55
+ OrderListResponse
56
+ 200
43
57
 
44
58
  Examples
45
59
  --------
@@ -48,49 +62,56 @@ class OrdersClient:
48
62
  client = Paid(
49
63
  token="YOUR_TOKEN",
50
64
  )
51
- client.orders.list()
65
+ client.orders.list_orders()
52
66
  """
53
- _response = self._raw_client.list(request_options=request_options)
67
+ _response = self._raw_client.list_orders(limit=limit, offset=offset, request_options=request_options)
54
68
  return _response.data
55
69
 
56
- def create(
70
+ def create_a_new_order(
57
71
  self,
58
72
  *,
59
- name: str,
60
- start_date: str,
61
- currency: str,
62
- customer_id: typing.Optional[str] = OMIT,
63
- customer_external_id: typing.Optional[str] = OMIT,
64
- billing_contact_id: typing.Optional[str] = OMIT,
65
- description: typing.Optional[str] = OMIT,
66
- end_date: typing.Optional[str] = OMIT,
67
- plan_id: typing.Optional[str] = OMIT,
68
- order_lines: typing.Optional[typing.Sequence[OrderLineCreate]] = OMIT,
73
+ customer_id: str,
74
+ billing_customer_id: typing.Optional[str] = OMIT,
75
+ billing_contact_ids: typing.Optional[typing.Sequence[str]] = OMIT,
76
+ name: typing.Optional[str] = OMIT,
77
+ start_date: typing.Optional[dt.datetime] = OMIT,
78
+ end_date: typing.Optional[dt.datetime] = OMIT,
79
+ subscription_terms: typing.Optional[int] = OMIT,
80
+ creation_state: typing.Optional[OrderCreationState] = OMIT,
81
+ billing_anchor: typing.Optional[float] = OMIT,
82
+ payment_terms: typing.Optional[str] = OMIT,
83
+ external_id: typing.Optional[str] = OMIT,
84
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
69
85
  request_options: typing.Optional[RequestOptions] = None,
70
86
  ) -> Order:
71
87
  """
88
+ Creates a new order for the organization
89
+
72
90
  Parameters
73
91
  ----------
74
- name : str
92
+ customer_id : str
93
+
94
+ billing_customer_id : typing.Optional[str]
95
+
96
+ billing_contact_ids : typing.Optional[typing.Sequence[str]]
75
97
 
76
- start_date : str
98
+ name : typing.Optional[str]
77
99
 
78
- currency : str
100
+ start_date : typing.Optional[dt.datetime]
79
101
 
80
- customer_id : typing.Optional[str]
102
+ end_date : typing.Optional[dt.datetime]
81
103
 
82
- customer_external_id : typing.Optional[str]
104
+ subscription_terms : typing.Optional[int]
83
105
 
84
- billing_contact_id : typing.Optional[str]
106
+ creation_state : typing.Optional[OrderCreationState]
85
107
 
86
- description : typing.Optional[str]
108
+ billing_anchor : typing.Optional[float]
87
109
 
88
- end_date : typing.Optional[str]
110
+ payment_terms : typing.Optional[str]
89
111
 
90
- plan_id : typing.Optional[str]
91
- Optional plan ID to associate with this order
112
+ external_id : typing.Optional[str]
92
113
 
93
- order_lines : typing.Optional[typing.Sequence[OrderLineCreate]]
114
+ metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
94
115
 
95
116
  request_options : typing.Optional[RequestOptions]
96
117
  Request-specific configuration.
@@ -98,7 +119,7 @@ class OrdersClient:
98
119
  Returns
99
120
  -------
100
121
  Order
101
- Success response
122
+ 201
102
123
 
103
124
  Examples
104
125
  --------
@@ -107,35 +128,102 @@ class OrdersClient:
107
128
  client = Paid(
108
129
  token="YOUR_TOKEN",
109
130
  )
110
- client.orders.create(
111
- customer_external_id="acme-inc",
112
- name="Acme Order",
113
- description="Acme Order is an order for Acme, Inc.",
114
- start_date="2025-01-01",
115
- end_date="2026-01-01",
116
- currency="USD",
131
+ client.orders.create_a_new_order(
132
+ customer_id="customerId",
117
133
  )
118
134
  """
119
- _response = self._raw_client.create(
135
+ _response = self._raw_client.create_a_new_order(
136
+ customer_id=customer_id,
137
+ billing_customer_id=billing_customer_id,
138
+ billing_contact_ids=billing_contact_ids,
120
139
  name=name,
121
140
  start_date=start_date,
122
- currency=currency,
123
- customer_id=customer_id,
124
- customer_external_id=customer_external_id,
125
- billing_contact_id=billing_contact_id,
126
- description=description,
127
141
  end_date=end_date,
128
- plan_id=plan_id,
129
- order_lines=order_lines,
142
+ subscription_terms=subscription_terms,
143
+ creation_state=creation_state,
144
+ billing_anchor=billing_anchor,
145
+ payment_terms=payment_terms,
146
+ external_id=external_id,
147
+ metadata=metadata,
130
148
  request_options=request_options,
131
149
  )
132
150
  return _response.data
133
151
 
134
- def get(self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Order:
152
+ def get_order(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Order:
153
+ """
154
+ Get an order by its ID
155
+
156
+ Parameters
157
+ ----------
158
+ id : str
159
+
160
+ request_options : typing.Optional[RequestOptions]
161
+ Request-specific configuration.
162
+
163
+ Returns
164
+ -------
165
+ Order
166
+ 200
167
+
168
+ Examples
169
+ --------
170
+ from paid import Paid
171
+
172
+ client = Paid(
173
+ token="YOUR_TOKEN",
174
+ )
175
+ client.orders.get_order(
176
+ id="id",
177
+ )
178
+ """
179
+ _response = self._raw_client.get_order(id, request_options=request_options)
180
+ return _response.data
181
+
182
+ def update_order(
183
+ self,
184
+ id: str,
185
+ *,
186
+ name: typing.Optional[str] = OMIT,
187
+ start_date: typing.Optional[dt.datetime] = OMIT,
188
+ end_date: typing.Optional[dt.datetime] = OMIT,
189
+ subscription_terms: typing.Optional[int] = OMIT,
190
+ creation_state: typing.Optional[OrderCreationState] = OMIT,
191
+ billing_anchor: typing.Optional[float] = OMIT,
192
+ payment_terms: typing.Optional[str] = OMIT,
193
+ external_id: typing.Optional[str] = OMIT,
194
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
195
+ billing_customer_id: typing.Optional[str] = OMIT,
196
+ billing_contact_ids: typing.Optional[typing.Sequence[str]] = OMIT,
197
+ request_options: typing.Optional[RequestOptions] = None,
198
+ ) -> Order:
135
199
  """
200
+ Update an order by its ID
201
+
136
202
  Parameters
137
203
  ----------
138
- order_id : str
204
+ id : str
205
+
206
+ name : typing.Optional[str]
207
+
208
+ start_date : typing.Optional[dt.datetime]
209
+
210
+ end_date : typing.Optional[dt.datetime]
211
+
212
+ subscription_terms : typing.Optional[int]
213
+
214
+ creation_state : typing.Optional[OrderCreationState]
215
+
216
+ billing_anchor : typing.Optional[float]
217
+
218
+ payment_terms : typing.Optional[str]
219
+
220
+ external_id : typing.Optional[str]
221
+
222
+ metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
223
+
224
+ billing_customer_id : typing.Optional[str]
225
+
226
+ billing_contact_ids : typing.Optional[typing.Sequence[str]]
139
227
 
140
228
  request_options : typing.Optional[RequestOptions]
141
229
  Request-specific configuration.
@@ -143,7 +231,7 @@ class OrdersClient:
143
231
  Returns
144
232
  -------
145
233
  Order
146
- Success response
234
+ 200
147
235
 
148
236
  Examples
149
237
  --------
@@ -152,25 +240,42 @@ class OrdersClient:
152
240
  client = Paid(
153
241
  token="YOUR_TOKEN",
154
242
  )
155
- client.orders.get(
156
- order_id="orderId",
243
+ client.orders.update_order(
244
+ id="id",
157
245
  )
158
246
  """
159
- _response = self._raw_client.get(order_id, request_options=request_options)
247
+ _response = self._raw_client.update_order(
248
+ id,
249
+ name=name,
250
+ start_date=start_date,
251
+ end_date=end_date,
252
+ subscription_terms=subscription_terms,
253
+ creation_state=creation_state,
254
+ billing_anchor=billing_anchor,
255
+ payment_terms=payment_terms,
256
+ external_id=external_id,
257
+ metadata=metadata,
258
+ billing_customer_id=billing_customer_id,
259
+ billing_contact_ids=billing_contact_ids,
260
+ request_options=request_options,
261
+ )
160
262
  return _response.data
161
263
 
162
- def delete(self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
264
+ def delete_order(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> EmptyResponse:
163
265
  """
266
+ Delete an order by its ID
267
+
164
268
  Parameters
165
269
  ----------
166
- order_id : str
270
+ id : str
167
271
 
168
272
  request_options : typing.Optional[RequestOptions]
169
273
  Request-specific configuration.
170
274
 
171
275
  Returns
172
276
  -------
173
- None
277
+ EmptyResponse
278
+ 200
174
279
 
175
280
  Examples
176
281
  --------
@@ -179,26 +284,39 @@ class OrdersClient:
179
284
  client = Paid(
180
285
  token="YOUR_TOKEN",
181
286
  )
182
- client.orders.delete(
183
- order_id="orderId",
287
+ client.orders.delete_order(
288
+ id="id",
184
289
  )
185
290
  """
186
- _response = self._raw_client.delete(order_id, request_options=request_options)
291
+ _response = self._raw_client.delete_order(id, request_options=request_options)
187
292
  return _response.data
188
293
 
189
- def activate(self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Order:
294
+ def get_order_lines(
295
+ self,
296
+ id: str,
297
+ *,
298
+ limit: typing.Optional[int] = None,
299
+ offset: typing.Optional[int] = None,
300
+ request_options: typing.Optional[RequestOptions] = None,
301
+ ) -> OrderLinesResponse:
190
302
  """
303
+ Get the order lines for an order by its ID
304
+
191
305
  Parameters
192
306
  ----------
193
- order_id : str
307
+ id : str
308
+
309
+ limit : typing.Optional[int]
310
+
311
+ offset : typing.Optional[int]
194
312
 
195
313
  request_options : typing.Optional[RequestOptions]
196
314
  Request-specific configuration.
197
315
 
198
316
  Returns
199
317
  -------
200
- Order
201
- Success response
318
+ OrderLinesResponse
319
+ 200
202
320
 
203
321
  Examples
204
322
  --------
@@ -207,18 +325,17 @@ class OrdersClient:
207
325
  client = Paid(
208
326
  token="YOUR_TOKEN",
209
327
  )
210
- client.orders.activate(
211
- order_id="orderId",
328
+ client.orders.get_order_lines(
329
+ id="id",
212
330
  )
213
331
  """
214
- _response = self._raw_client.activate(order_id, request_options=request_options)
332
+ _response = self._raw_client.get_order_lines(id, limit=limit, offset=offset, request_options=request_options)
215
333
  return _response.data
216
334
 
217
335
 
218
336
  class AsyncOrdersClient:
219
337
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
220
338
  self._raw_client = AsyncRawOrdersClient(client_wrapper=client_wrapper)
221
- self.lines = AsyncLinesClient(client_wrapper=client_wrapper)
222
339
 
223
340
  @property
224
341
  def with_raw_response(self) -> AsyncRawOrdersClient:
@@ -231,17 +348,29 @@ class AsyncOrdersClient:
231
348
  """
232
349
  return self._raw_client
233
350
 
234
- async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Order]:
351
+ async def list_orders(
352
+ self,
353
+ *,
354
+ limit: typing.Optional[int] = None,
355
+ offset: typing.Optional[int] = None,
356
+ request_options: typing.Optional[RequestOptions] = None,
357
+ ) -> OrderListResponse:
235
358
  """
359
+ Get a list of orders for the organization
360
+
236
361
  Parameters
237
362
  ----------
363
+ limit : typing.Optional[int]
364
+
365
+ offset : typing.Optional[int]
366
+
238
367
  request_options : typing.Optional[RequestOptions]
239
368
  Request-specific configuration.
240
369
 
241
370
  Returns
242
371
  -------
243
- typing.List[Order]
244
- Success response
372
+ OrderListResponse
373
+ 200
245
374
 
246
375
  Examples
247
376
  --------
@@ -255,52 +384,59 @@ class AsyncOrdersClient:
255
384
 
256
385
 
257
386
  async def main() -> None:
258
- await client.orders.list()
387
+ await client.orders.list_orders()
259
388
 
260
389
 
261
390
  asyncio.run(main())
262
391
  """
263
- _response = await self._raw_client.list(request_options=request_options)
392
+ _response = await self._raw_client.list_orders(limit=limit, offset=offset, request_options=request_options)
264
393
  return _response.data
265
394
 
266
- async def create(
395
+ async def create_a_new_order(
267
396
  self,
268
397
  *,
269
- name: str,
270
- start_date: str,
271
- currency: str,
272
- customer_id: typing.Optional[str] = OMIT,
273
- customer_external_id: typing.Optional[str] = OMIT,
274
- billing_contact_id: typing.Optional[str] = OMIT,
275
- description: typing.Optional[str] = OMIT,
276
- end_date: typing.Optional[str] = OMIT,
277
- plan_id: typing.Optional[str] = OMIT,
278
- order_lines: typing.Optional[typing.Sequence[OrderLineCreate]] = OMIT,
398
+ customer_id: str,
399
+ billing_customer_id: typing.Optional[str] = OMIT,
400
+ billing_contact_ids: typing.Optional[typing.Sequence[str]] = OMIT,
401
+ name: typing.Optional[str] = OMIT,
402
+ start_date: typing.Optional[dt.datetime] = OMIT,
403
+ end_date: typing.Optional[dt.datetime] = OMIT,
404
+ subscription_terms: typing.Optional[int] = OMIT,
405
+ creation_state: typing.Optional[OrderCreationState] = OMIT,
406
+ billing_anchor: typing.Optional[float] = OMIT,
407
+ payment_terms: typing.Optional[str] = OMIT,
408
+ external_id: typing.Optional[str] = OMIT,
409
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
279
410
  request_options: typing.Optional[RequestOptions] = None,
280
411
  ) -> Order:
281
412
  """
413
+ Creates a new order for the organization
414
+
282
415
  Parameters
283
416
  ----------
284
- name : str
417
+ customer_id : str
418
+
419
+ billing_customer_id : typing.Optional[str]
285
420
 
286
- start_date : str
421
+ billing_contact_ids : typing.Optional[typing.Sequence[str]]
287
422
 
288
- currency : str
423
+ name : typing.Optional[str]
289
424
 
290
- customer_id : typing.Optional[str]
425
+ start_date : typing.Optional[dt.datetime]
291
426
 
292
- customer_external_id : typing.Optional[str]
427
+ end_date : typing.Optional[dt.datetime]
293
428
 
294
- billing_contact_id : typing.Optional[str]
429
+ subscription_terms : typing.Optional[int]
295
430
 
296
- description : typing.Optional[str]
431
+ creation_state : typing.Optional[OrderCreationState]
297
432
 
298
- end_date : typing.Optional[str]
433
+ billing_anchor : typing.Optional[float]
299
434
 
300
- plan_id : typing.Optional[str]
301
- Optional plan ID to associate with this order
435
+ payment_terms : typing.Optional[str]
302
436
 
303
- order_lines : typing.Optional[typing.Sequence[OrderLineCreate]]
437
+ external_id : typing.Optional[str]
438
+
439
+ metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
304
440
 
305
441
  request_options : typing.Optional[RequestOptions]
306
442
  Request-specific configuration.
@@ -308,7 +444,7 @@ class AsyncOrdersClient:
308
444
  Returns
309
445
  -------
310
446
  Order
311
- Success response
447
+ 201
312
448
 
313
449
  Examples
314
450
  --------
@@ -322,38 +458,37 @@ class AsyncOrdersClient:
322
458
 
323
459
 
324
460
  async def main() -> None:
325
- await client.orders.create(
326
- customer_external_id="acme-inc",
327
- name="Acme Order",
328
- description="Acme Order is an order for Acme, Inc.",
329
- start_date="2025-01-01",
330
- end_date="2026-01-01",
331
- currency="USD",
461
+ await client.orders.create_a_new_order(
462
+ customer_id="customerId",
332
463
  )
333
464
 
334
465
 
335
466
  asyncio.run(main())
336
467
  """
337
- _response = await self._raw_client.create(
468
+ _response = await self._raw_client.create_a_new_order(
469
+ customer_id=customer_id,
470
+ billing_customer_id=billing_customer_id,
471
+ billing_contact_ids=billing_contact_ids,
338
472
  name=name,
339
473
  start_date=start_date,
340
- currency=currency,
341
- customer_id=customer_id,
342
- customer_external_id=customer_external_id,
343
- billing_contact_id=billing_contact_id,
344
- description=description,
345
474
  end_date=end_date,
346
- plan_id=plan_id,
347
- order_lines=order_lines,
475
+ subscription_terms=subscription_terms,
476
+ creation_state=creation_state,
477
+ billing_anchor=billing_anchor,
478
+ payment_terms=payment_terms,
479
+ external_id=external_id,
480
+ metadata=metadata,
348
481
  request_options=request_options,
349
482
  )
350
483
  return _response.data
351
484
 
352
- async def get(self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Order:
485
+ async def get_order(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Order:
353
486
  """
487
+ Get an order by its ID
488
+
354
489
  Parameters
355
490
  ----------
356
- order_id : str
491
+ id : str
357
492
 
358
493
  request_options : typing.Optional[RequestOptions]
359
494
  Request-specific configuration.
@@ -361,7 +496,7 @@ class AsyncOrdersClient:
361
496
  Returns
362
497
  -------
363
498
  Order
364
- Success response
499
+ 200
365
500
 
366
501
  Examples
367
502
  --------
@@ -375,28 +510,69 @@ class AsyncOrdersClient:
375
510
 
376
511
 
377
512
  async def main() -> None:
378
- await client.orders.get(
379
- order_id="orderId",
513
+ await client.orders.get_order(
514
+ id="id",
380
515
  )
381
516
 
382
517
 
383
518
  asyncio.run(main())
384
519
  """
385
- _response = await self._raw_client.get(order_id, request_options=request_options)
520
+ _response = await self._raw_client.get_order(id, request_options=request_options)
386
521
  return _response.data
387
522
 
388
- async def delete(self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
523
+ async def update_order(
524
+ self,
525
+ id: str,
526
+ *,
527
+ name: typing.Optional[str] = OMIT,
528
+ start_date: typing.Optional[dt.datetime] = OMIT,
529
+ end_date: typing.Optional[dt.datetime] = OMIT,
530
+ subscription_terms: typing.Optional[int] = OMIT,
531
+ creation_state: typing.Optional[OrderCreationState] = OMIT,
532
+ billing_anchor: typing.Optional[float] = OMIT,
533
+ payment_terms: typing.Optional[str] = OMIT,
534
+ external_id: typing.Optional[str] = OMIT,
535
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
536
+ billing_customer_id: typing.Optional[str] = OMIT,
537
+ billing_contact_ids: typing.Optional[typing.Sequence[str]] = OMIT,
538
+ request_options: typing.Optional[RequestOptions] = None,
539
+ ) -> Order:
389
540
  """
541
+ Update an order by its ID
542
+
390
543
  Parameters
391
544
  ----------
392
- order_id : str
545
+ id : str
546
+
547
+ name : typing.Optional[str]
548
+
549
+ start_date : typing.Optional[dt.datetime]
550
+
551
+ end_date : typing.Optional[dt.datetime]
552
+
553
+ subscription_terms : typing.Optional[int]
554
+
555
+ creation_state : typing.Optional[OrderCreationState]
556
+
557
+ billing_anchor : typing.Optional[float]
558
+
559
+ payment_terms : typing.Optional[str]
560
+
561
+ external_id : typing.Optional[str]
562
+
563
+ metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
564
+
565
+ billing_customer_id : typing.Optional[str]
566
+
567
+ billing_contact_ids : typing.Optional[typing.Sequence[str]]
393
568
 
394
569
  request_options : typing.Optional[RequestOptions]
395
570
  Request-specific configuration.
396
571
 
397
572
  Returns
398
573
  -------
399
- None
574
+ Order
575
+ 200
400
576
 
401
577
  Examples
402
578
  --------
@@ -410,29 +586,45 @@ class AsyncOrdersClient:
410
586
 
411
587
 
412
588
  async def main() -> None:
413
- await client.orders.delete(
414
- order_id="orderId",
589
+ await client.orders.update_order(
590
+ id="id",
415
591
  )
416
592
 
417
593
 
418
594
  asyncio.run(main())
419
595
  """
420
- _response = await self._raw_client.delete(order_id, request_options=request_options)
596
+ _response = await self._raw_client.update_order(
597
+ id,
598
+ name=name,
599
+ start_date=start_date,
600
+ end_date=end_date,
601
+ subscription_terms=subscription_terms,
602
+ creation_state=creation_state,
603
+ billing_anchor=billing_anchor,
604
+ payment_terms=payment_terms,
605
+ external_id=external_id,
606
+ metadata=metadata,
607
+ billing_customer_id=billing_customer_id,
608
+ billing_contact_ids=billing_contact_ids,
609
+ request_options=request_options,
610
+ )
421
611
  return _response.data
422
612
 
423
- async def activate(self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Order:
613
+ async def delete_order(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> EmptyResponse:
424
614
  """
615
+ Delete an order by its ID
616
+
425
617
  Parameters
426
618
  ----------
427
- order_id : str
619
+ id : str
428
620
 
429
621
  request_options : typing.Optional[RequestOptions]
430
622
  Request-specific configuration.
431
623
 
432
624
  Returns
433
625
  -------
434
- Order
435
- Success response
626
+ EmptyResponse
627
+ 200
436
628
 
437
629
  Examples
438
630
  --------
@@ -446,12 +638,63 @@ class AsyncOrdersClient:
446
638
 
447
639
 
448
640
  async def main() -> None:
449
- await client.orders.activate(
450
- order_id="orderId",
641
+ await client.orders.delete_order(
642
+ id="id",
451
643
  )
452
644
 
453
645
 
454
646
  asyncio.run(main())
455
647
  """
456
- _response = await self._raw_client.activate(order_id, request_options=request_options)
648
+ _response = await self._raw_client.delete_order(id, request_options=request_options)
649
+ return _response.data
650
+
651
+ async def get_order_lines(
652
+ self,
653
+ id: str,
654
+ *,
655
+ limit: typing.Optional[int] = None,
656
+ offset: typing.Optional[int] = None,
657
+ request_options: typing.Optional[RequestOptions] = None,
658
+ ) -> OrderLinesResponse:
659
+ """
660
+ Get the order lines for an order by its ID
661
+
662
+ Parameters
663
+ ----------
664
+ id : str
665
+
666
+ limit : typing.Optional[int]
667
+
668
+ offset : typing.Optional[int]
669
+
670
+ request_options : typing.Optional[RequestOptions]
671
+ Request-specific configuration.
672
+
673
+ Returns
674
+ -------
675
+ OrderLinesResponse
676
+ 200
677
+
678
+ Examples
679
+ --------
680
+ import asyncio
681
+
682
+ from paid import AsyncPaid
683
+
684
+ client = AsyncPaid(
685
+ token="YOUR_TOKEN",
686
+ )
687
+
688
+
689
+ async def main() -> None:
690
+ await client.orders.get_order_lines(
691
+ id="id",
692
+ )
693
+
694
+
695
+ asyncio.run(main())
696
+ """
697
+ _response = await self._raw_client.get_order_lines(
698
+ id, limit=limit, offset=offset, request_options=request_options
699
+ )
457
700
  return _response.data