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/customers/client.py CHANGED
@@ -5,13 +5,11 @@ import typing
5
5
 
6
6
  from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
7
7
  from ..core.request_options import RequestOptions
8
- from ..types.address import Address
9
- from ..types.cost_traces_response import CostTracesResponse
10
- from ..types.creation_source import CreationSource
11
8
  from ..types.customer import Customer
12
- from ..types.entitlement_usage import EntitlementUsage
13
- from ..types.tax_exempt_status import TaxExemptStatus
14
- from ..types.usage_summaries_response import UsageSummariesResponse
9
+ from ..types.customer_billing_address import CustomerBillingAddress
10
+ from ..types.customer_creation_state import CustomerCreationState
11
+ from ..types.customer_list_response import CustomerListResponse
12
+ from ..types.empty_response import EmptyResponse
15
13
  from .raw_client import AsyncRawCustomersClient, RawCustomersClient
16
14
 
17
15
  # this is used as the default value for optional parameters
@@ -33,17 +31,29 @@ class CustomersClient:
33
31
  """
34
32
  return self._raw_client
35
33
 
36
- def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Customer]:
34
+ def list_customers(
35
+ self,
36
+ *,
37
+ limit: typing.Optional[int] = None,
38
+ offset: typing.Optional[int] = None,
39
+ request_options: typing.Optional[RequestOptions] = None,
40
+ ) -> CustomerListResponse:
37
41
  """
42
+ Get a list of customers for the organization
43
+
38
44
  Parameters
39
45
  ----------
46
+ limit : typing.Optional[int]
47
+
48
+ offset : typing.Optional[int]
49
+
40
50
  request_options : typing.Optional[RequestOptions]
41
51
  Request-specific configuration.
42
52
 
43
53
  Returns
44
54
  -------
45
- typing.List[Customer]
46
- Success response
55
+ CustomerListResponse
56
+ 200
47
57
 
48
58
  Examples
49
59
  --------
@@ -52,49 +62,50 @@ class CustomersClient:
52
62
  client = Paid(
53
63
  token="YOUR_TOKEN",
54
64
  )
55
- client.customers.list()
65
+ client.customers.list_customers()
56
66
  """
57
- _response = self._raw_client.list(request_options=request_options)
67
+ _response = self._raw_client.list_customers(limit=limit, offset=offset, request_options=request_options)
58
68
  return _response.data
59
69
 
60
- def create(
70
+ def create_a_new_customer(
61
71
  self,
62
72
  *,
63
73
  name: str,
64
- external_id: typing.Optional[str] = OMIT,
74
+ legal_name: typing.Optional[str] = OMIT,
75
+ email: typing.Optional[str] = OMIT,
65
76
  phone: typing.Optional[str] = OMIT,
66
- employee_count: typing.Optional[float] = OMIT,
67
- annual_revenue: typing.Optional[float] = OMIT,
68
- tax_exempt_status: typing.Optional[TaxExemptStatus] = OMIT,
69
- creation_source: typing.Optional[CreationSource] = OMIT,
70
77
  website: typing.Optional[str] = OMIT,
71
- billing_address: typing.Optional[Address] = OMIT,
78
+ external_id: typing.Optional[str] = OMIT,
79
+ billing_address: typing.Optional[CustomerBillingAddress] = OMIT,
80
+ creation_state: typing.Optional[CustomerCreationState] = OMIT,
81
+ vat_number: typing.Optional[str] = OMIT,
72
82
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
73
83
  request_options: typing.Optional[RequestOptions] = None,
74
84
  ) -> Customer:
75
85
  """
86
+ Creates a new customer for the organization
87
+
76
88
  Parameters
77
89
  ----------
78
90
  name : str
79
91
 
80
- external_id : typing.Optional[str]
92
+ legal_name : typing.Optional[str]
81
93
 
82
- phone : typing.Optional[str]
94
+ email : typing.Optional[str]
83
95
 
84
- employee_count : typing.Optional[float]
96
+ phone : typing.Optional[str]
85
97
 
86
- annual_revenue : typing.Optional[float]
98
+ website : typing.Optional[str]
87
99
 
88
- tax_exempt_status : typing.Optional[TaxExemptStatus]
100
+ external_id : typing.Optional[str]
89
101
 
90
- creation_source : typing.Optional[CreationSource]
102
+ billing_address : typing.Optional[CustomerBillingAddress]
91
103
 
92
- website : typing.Optional[str]
104
+ creation_state : typing.Optional[CustomerCreationState]
93
105
 
94
- billing_address : typing.Optional[Address]
106
+ vat_number : typing.Optional[str]
95
107
 
96
108
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
97
- Flexible JSON field for storing custom metadata about the customer
98
109
 
99
110
  request_options : typing.Optional[RequestOptions]
100
111
  Request-specific configuration.
@@ -102,7 +113,7 @@ class CustomersClient:
102
113
  Returns
103
114
  -------
104
115
  Customer
105
- Success response
116
+ 201
106
117
 
107
118
  Examples
108
119
  --------
@@ -111,31 +122,32 @@ class CustomersClient:
111
122
  client = Paid(
112
123
  token="YOUR_TOKEN",
113
124
  )
114
- client.customers.create(
115
- name="Acme, Inc.",
116
- external_id="acme-inc",
125
+ client.customers.create_a_new_customer(
126
+ name="name",
117
127
  )
118
128
  """
119
- _response = self._raw_client.create(
129
+ _response = self._raw_client.create_a_new_customer(
120
130
  name=name,
121
- external_id=external_id,
131
+ legal_name=legal_name,
132
+ email=email,
122
133
  phone=phone,
123
- employee_count=employee_count,
124
- annual_revenue=annual_revenue,
125
- tax_exempt_status=tax_exempt_status,
126
- creation_source=creation_source,
127
134
  website=website,
135
+ external_id=external_id,
128
136
  billing_address=billing_address,
137
+ creation_state=creation_state,
138
+ vat_number=vat_number,
129
139
  metadata=metadata,
130
140
  request_options=request_options,
131
141
  )
132
142
  return _response.data
133
143
 
134
- def get(self, customer_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Customer:
144
+ def get_customer(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Customer:
135
145
  """
146
+ Get a customer by its ID
147
+
136
148
  Parameters
137
149
  ----------
138
- customer_id : str
150
+ id : str
139
151
 
140
152
  request_options : typing.Optional[RequestOptions]
141
153
  Request-specific configuration.
@@ -143,7 +155,7 @@ class CustomersClient:
143
155
  Returns
144
156
  -------
145
157
  Customer
146
- Success response
158
+ 200
147
159
 
148
160
  Examples
149
161
  --------
@@ -152,54 +164,58 @@ class CustomersClient:
152
164
  client = Paid(
153
165
  token="YOUR_TOKEN",
154
166
  )
155
- client.customers.get(
156
- customer_id="customerId",
167
+ client.customers.get_customer(
168
+ id="id",
157
169
  )
158
170
  """
159
- _response = self._raw_client.get(customer_id, request_options=request_options)
171
+ _response = self._raw_client.get_customer(id, request_options=request_options)
160
172
  return _response.data
161
173
 
162
- def update(
174
+ def update_customer(
163
175
  self,
164
- customer_id: str,
176
+ id: str,
165
177
  *,
166
178
  name: typing.Optional[str] = OMIT,
167
- external_id: typing.Optional[str] = OMIT,
179
+ legal_name: typing.Optional[str] = OMIT,
180
+ email: typing.Optional[str] = OMIT,
168
181
  phone: typing.Optional[str] = OMIT,
169
- employee_count: typing.Optional[float] = OMIT,
170
- annual_revenue: typing.Optional[float] = OMIT,
171
- tax_exempt_status: typing.Optional[TaxExemptStatus] = OMIT,
172
- creation_source: typing.Optional[CreationSource] = OMIT,
173
182
  website: typing.Optional[str] = OMIT,
174
- billing_address: typing.Optional[Address] = OMIT,
183
+ external_id: typing.Optional[str] = OMIT,
184
+ billing_address: typing.Optional[CustomerBillingAddress] = OMIT,
185
+ creation_state: typing.Optional[CustomerCreationState] = OMIT,
186
+ churn_date: typing.Optional[dt.datetime] = OMIT,
187
+ vat_number: typing.Optional[str] = OMIT,
175
188
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
176
189
  request_options: typing.Optional[RequestOptions] = None,
177
190
  ) -> Customer:
178
191
  """
192
+ Update a customer by its ID
193
+
179
194
  Parameters
180
195
  ----------
181
- customer_id : str
196
+ id : str
182
197
 
183
198
  name : typing.Optional[str]
184
199
 
185
- external_id : typing.Optional[str]
200
+ legal_name : typing.Optional[str]
201
+
202
+ email : typing.Optional[str]
186
203
 
187
204
  phone : typing.Optional[str]
188
205
 
189
- employee_count : typing.Optional[float]
206
+ website : typing.Optional[str]
190
207
 
191
- annual_revenue : typing.Optional[float]
208
+ external_id : typing.Optional[str]
192
209
 
193
- tax_exempt_status : typing.Optional[TaxExemptStatus]
210
+ billing_address : typing.Optional[CustomerBillingAddress]
194
211
 
195
- creation_source : typing.Optional[CreationSource]
212
+ creation_state : typing.Optional[CustomerCreationState]
196
213
 
197
- website : typing.Optional[str]
214
+ churn_date : typing.Optional[dt.datetime]
198
215
 
199
- billing_address : typing.Optional[Address]
216
+ vat_number : typing.Optional[str]
200
217
 
201
218
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
202
- Flexible JSON field for storing custom metadata about the customer
203
219
 
204
220
  request_options : typing.Optional[RequestOptions]
205
221
  Request-specific configuration.
@@ -207,7 +223,7 @@ class CustomersClient:
207
223
  Returns
208
224
  -------
209
225
  Customer
210
- Customer updated successfully
226
+ 200
211
227
 
212
228
  Examples
213
229
  --------
@@ -216,73 +232,42 @@ class CustomersClient:
216
232
  client = Paid(
217
233
  token="YOUR_TOKEN",
218
234
  )
219
- client.customers.update(
220
- customer_id="customerId",
221
- name="Acme, Inc. (Updated)",
222
- phone="123-456-7890",
223
- employee_count=101.0,
224
- annual_revenue=1000001.0,
235
+ client.customers.update_customer(
236
+ id="id",
225
237
  )
226
238
  """
227
- _response = self._raw_client.update(
228
- customer_id,
239
+ _response = self._raw_client.update_customer(
240
+ id,
229
241
  name=name,
230
- external_id=external_id,
242
+ legal_name=legal_name,
243
+ email=email,
231
244
  phone=phone,
232
- employee_count=employee_count,
233
- annual_revenue=annual_revenue,
234
- tax_exempt_status=tax_exempt_status,
235
- creation_source=creation_source,
236
245
  website=website,
246
+ external_id=external_id,
237
247
  billing_address=billing_address,
248
+ creation_state=creation_state,
249
+ churn_date=churn_date,
250
+ vat_number=vat_number,
238
251
  metadata=metadata,
239
252
  request_options=request_options,
240
253
  )
241
254
  return _response.data
242
255
 
243
- def delete(self, customer_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
244
- """
245
- Parameters
246
- ----------
247
- customer_id : str
248
-
249
- request_options : typing.Optional[RequestOptions]
250
- Request-specific configuration.
251
-
252
- Returns
253
- -------
254
- None
255
-
256
- Examples
257
- --------
258
- from paid import Paid
259
-
260
- client = Paid(
261
- token="YOUR_TOKEN",
262
- )
263
- client.customers.delete(
264
- customer_id="customerId",
265
- )
256
+ def delete_customer(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> EmptyResponse:
266
257
  """
267
- _response = self._raw_client.delete(customer_id, request_options=request_options)
268
- return _response.data
258
+ Delete a customer by its ID
269
259
 
270
- def get_entitlements(
271
- self, customer_id: str, *, request_options: typing.Optional[RequestOptions] = None
272
- ) -> typing.List[EntitlementUsage]:
273
- """
274
260
  Parameters
275
261
  ----------
276
- customer_id : str
277
- The customer ID
262
+ id : str
278
263
 
279
264
  request_options : typing.Optional[RequestOptions]
280
265
  Request-specific configuration.
281
266
 
282
267
  Returns
283
268
  -------
284
- typing.List[EntitlementUsage]
285
- Success response
269
+ EmptyResponse
270
+ 200
286
271
 
287
272
  Examples
288
273
  --------
@@ -291,17 +276,19 @@ class CustomersClient:
291
276
  client = Paid(
292
277
  token="YOUR_TOKEN",
293
278
  )
294
- client.customers.get_entitlements(
295
- customer_id="customerId",
279
+ client.customers.delete_customer(
280
+ id="id",
296
281
  )
297
282
  """
298
- _response = self._raw_client.get_entitlements(customer_id, request_options=request_options)
283
+ _response = self._raw_client.delete_customer(id, request_options=request_options)
299
284
  return _response.data
300
285
 
301
- def get_by_external_id(
286
+ def get_customer_by_external_id(
302
287
  self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
303
288
  ) -> Customer:
304
289
  """
290
+ Get a customer by its externalId
291
+
305
292
  Parameters
306
293
  ----------
307
294
  external_id : str
@@ -312,7 +299,7 @@ class CustomersClient:
312
299
  Returns
313
300
  -------
314
301
  Customer
315
- Success response
302
+ 200
316
303
 
317
304
  Examples
318
305
  --------
@@ -321,54 +308,58 @@ class CustomersClient:
321
308
  client = Paid(
322
309
  token="YOUR_TOKEN",
323
310
  )
324
- client.customers.get_by_external_id(
311
+ client.customers.get_customer_by_external_id(
325
312
  external_id="externalId",
326
313
  )
327
314
  """
328
- _response = self._raw_client.get_by_external_id(external_id, request_options=request_options)
315
+ _response = self._raw_client.get_customer_by_external_id(external_id, request_options=request_options)
329
316
  return _response.data
330
317
 
331
- def update_by_external_id(
318
+ def update_customer_by_external_id(
332
319
  self,
333
320
  external_id_: str,
334
321
  *,
335
322
  name: typing.Optional[str] = OMIT,
336
- external_id: typing.Optional[str] = OMIT,
323
+ legal_name: typing.Optional[str] = OMIT,
324
+ email: typing.Optional[str] = OMIT,
337
325
  phone: typing.Optional[str] = OMIT,
338
- employee_count: typing.Optional[float] = OMIT,
339
- annual_revenue: typing.Optional[float] = OMIT,
340
- tax_exempt_status: typing.Optional[TaxExemptStatus] = OMIT,
341
- creation_source: typing.Optional[CreationSource] = OMIT,
342
326
  website: typing.Optional[str] = OMIT,
343
- billing_address: typing.Optional[Address] = OMIT,
327
+ external_id: typing.Optional[str] = OMIT,
328
+ billing_address: typing.Optional[CustomerBillingAddress] = OMIT,
329
+ creation_state: typing.Optional[CustomerCreationState] = OMIT,
330
+ churn_date: typing.Optional[dt.datetime] = OMIT,
331
+ vat_number: typing.Optional[str] = OMIT,
344
332
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
345
333
  request_options: typing.Optional[RequestOptions] = None,
346
334
  ) -> Customer:
347
335
  """
336
+ Update a customer by its externalId
337
+
348
338
  Parameters
349
339
  ----------
350
340
  external_id_ : str
351
341
 
352
342
  name : typing.Optional[str]
353
343
 
354
- external_id : typing.Optional[str]
344
+ legal_name : typing.Optional[str]
345
+
346
+ email : typing.Optional[str]
355
347
 
356
348
  phone : typing.Optional[str]
357
349
 
358
- employee_count : typing.Optional[float]
350
+ website : typing.Optional[str]
359
351
 
360
- annual_revenue : typing.Optional[float]
352
+ external_id : typing.Optional[str]
361
353
 
362
- tax_exempt_status : typing.Optional[TaxExemptStatus]
354
+ billing_address : typing.Optional[CustomerBillingAddress]
363
355
 
364
- creation_source : typing.Optional[CreationSource]
356
+ creation_state : typing.Optional[CustomerCreationState]
365
357
 
366
- website : typing.Optional[str]
358
+ churn_date : typing.Optional[dt.datetime]
367
359
 
368
- billing_address : typing.Optional[Address]
360
+ vat_number : typing.Optional[str]
369
361
 
370
362
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
371
- Flexible JSON field for storing custom metadata about the customer
372
363
 
373
364
  request_options : typing.Optional[RequestOptions]
374
365
  Request-specific configuration.
@@ -376,7 +367,7 @@ class CustomersClient:
376
367
  Returns
377
368
  -------
378
369
  Customer
379
- Success response
370
+ 200
380
371
 
381
372
  Examples
382
373
  --------
@@ -385,187 +376,57 @@ class CustomersClient:
385
376
  client = Paid(
386
377
  token="YOUR_TOKEN",
387
378
  )
388
- client.customers.update_by_external_id(
379
+ client.customers.update_customer_by_external_id(
389
380
  external_id_="externalId",
390
381
  )
391
382
  """
392
- _response = self._raw_client.update_by_external_id(
383
+ _response = self._raw_client.update_customer_by_external_id(
393
384
  external_id_,
394
385
  name=name,
395
- external_id=external_id,
386
+ legal_name=legal_name,
387
+ email=email,
396
388
  phone=phone,
397
- employee_count=employee_count,
398
- annual_revenue=annual_revenue,
399
- tax_exempt_status=tax_exempt_status,
400
- creation_source=creation_source,
401
389
  website=website,
390
+ external_id=external_id,
402
391
  billing_address=billing_address,
392
+ creation_state=creation_state,
393
+ churn_date=churn_date,
394
+ vat_number=vat_number,
403
395
  metadata=metadata,
404
396
  request_options=request_options,
405
397
  )
406
398
  return _response.data
407
399
 
408
- def delete_by_external_id(
400
+ def delete_customer_by_external_id(
409
401
  self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
410
- ) -> None:
402
+ ) -> EmptyResponse:
411
403
  """
412
- Parameters
413
- ----------
414
- external_id : str
404
+ Delete a customer by its externalId
415
405
 
416
- request_options : typing.Optional[RequestOptions]
417
- Request-specific configuration.
418
-
419
- Returns
420
- -------
421
- None
422
-
423
- Examples
424
- --------
425
- from paid import Paid
426
-
427
- client = Paid(
428
- token="YOUR_TOKEN",
429
- )
430
- client.customers.delete_by_external_id(
431
- external_id="externalId",
432
- )
433
- """
434
- _response = self._raw_client.delete_by_external_id(external_id, request_options=request_options)
435
- return _response.data
436
-
437
- def get_costs_by_external_id(
438
- self,
439
- external_id: str,
440
- *,
441
- limit: typing.Optional[int] = None,
442
- offset: typing.Optional[int] = None,
443
- start_time: typing.Optional[dt.datetime] = None,
444
- end_time: typing.Optional[dt.datetime] = None,
445
- request_options: typing.Optional[RequestOptions] = None,
446
- ) -> CostTracesResponse:
447
- """
448
406
  Parameters
449
407
  ----------
450
408
  external_id : str
451
- The external ID of the customer
452
-
453
- limit : typing.Optional[int]
454
- Maximum number of traces to return (1-1000)
455
-
456
- offset : typing.Optional[int]
457
- Number of traces to skip for pagination
458
-
459
- start_time : typing.Optional[dt.datetime]
460
- Filter traces starting from this time (ISO 8601 format)
461
-
462
- end_time : typing.Optional[dt.datetime]
463
- Filter traces up to this time (ISO 8601 format)
464
409
 
465
410
  request_options : typing.Optional[RequestOptions]
466
411
  Request-specific configuration.
467
412
 
468
413
  Returns
469
414
  -------
470
- CostTracesResponse
471
- Success response
415
+ EmptyResponse
416
+ 200
472
417
 
473
418
  Examples
474
419
  --------
475
- import datetime
476
-
477
420
  from paid import Paid
478
421
 
479
422
  client = Paid(
480
423
  token="YOUR_TOKEN",
481
424
  )
482
- client.customers.get_costs_by_external_id(
425
+ client.customers.delete_customer_by_external_id(
483
426
  external_id="externalId",
484
- limit=1,
485
- offset=1,
486
- start_time=datetime.datetime.fromisoformat(
487
- "2024-01-15 09:30:00+00:00",
488
- ),
489
- end_time=datetime.datetime.fromisoformat(
490
- "2024-01-15 09:30:00+00:00",
491
- ),
492
427
  )
493
428
  """
494
- _response = self._raw_client.get_costs_by_external_id(
495
- external_id,
496
- limit=limit,
497
- offset=offset,
498
- start_time=start_time,
499
- end_time=end_time,
500
- request_options=request_options,
501
- )
502
- return _response.data
503
-
504
- def get_usage_by_external_id(
505
- self,
506
- external_id: str,
507
- *,
508
- limit: typing.Optional[int] = None,
509
- offset: typing.Optional[int] = None,
510
- start_time: typing.Optional[dt.datetime] = None,
511
- end_time: typing.Optional[dt.datetime] = None,
512
- request_options: typing.Optional[RequestOptions] = None,
513
- ) -> UsageSummariesResponse:
514
- """
515
- Parameters
516
- ----------
517
- external_id : str
518
- The external ID of the customer
519
-
520
- limit : typing.Optional[int]
521
- Maximum number of usage summaries to return (1-1000)
522
-
523
- offset : typing.Optional[int]
524
- Number of usage summaries to skip for pagination
525
-
526
- start_time : typing.Optional[dt.datetime]
527
- Filter usage summaries starting from this time (ISO 8601 format). Returns summaries that overlap with the time range.
528
-
529
- end_time : typing.Optional[dt.datetime]
530
- Filter usage summaries up to this time (ISO 8601 format). Returns summaries that overlap with the time range.
531
-
532
- request_options : typing.Optional[RequestOptions]
533
- Request-specific configuration.
534
-
535
- Returns
536
- -------
537
- UsageSummariesResponse
538
- Success response
539
-
540
- Examples
541
- --------
542
- import datetime
543
-
544
- from paid import Paid
545
-
546
- client = Paid(
547
- token="YOUR_TOKEN",
548
- )
549
- client.customers.get_usage_by_external_id(
550
- external_id="externalId",
551
- limit=1,
552
- offset=1,
553
- start_time=datetime.datetime.fromisoformat(
554
- "2024-01-15 09:30:00+00:00",
555
- ),
556
- end_time=datetime.datetime.fromisoformat(
557
- "2024-01-15 09:30:00+00:00",
558
- ),
559
- )
560
- """
561
- _response = self._raw_client.get_usage_by_external_id(
562
- external_id,
563
- limit=limit,
564
- offset=offset,
565
- start_time=start_time,
566
- end_time=end_time,
567
- request_options=request_options,
568
- )
429
+ _response = self._raw_client.delete_customer_by_external_id(external_id, request_options=request_options)
569
430
  return _response.data
570
431
 
571
432
 
@@ -584,17 +445,29 @@ class AsyncCustomersClient:
584
445
  """
585
446
  return self._raw_client
586
447
 
587
- async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Customer]:
448
+ async def list_customers(
449
+ self,
450
+ *,
451
+ limit: typing.Optional[int] = None,
452
+ offset: typing.Optional[int] = None,
453
+ request_options: typing.Optional[RequestOptions] = None,
454
+ ) -> CustomerListResponse:
588
455
  """
456
+ Get a list of customers for the organization
457
+
589
458
  Parameters
590
459
  ----------
460
+ limit : typing.Optional[int]
461
+
462
+ offset : typing.Optional[int]
463
+
591
464
  request_options : typing.Optional[RequestOptions]
592
465
  Request-specific configuration.
593
466
 
594
467
  Returns
595
468
  -------
596
- typing.List[Customer]
597
- Success response
469
+ CustomerListResponse
470
+ 200
598
471
 
599
472
  Examples
600
473
  --------
@@ -608,52 +481,53 @@ class AsyncCustomersClient:
608
481
 
609
482
 
610
483
  async def main() -> None:
611
- await client.customers.list()
484
+ await client.customers.list_customers()
612
485
 
613
486
 
614
487
  asyncio.run(main())
615
488
  """
616
- _response = await self._raw_client.list(request_options=request_options)
489
+ _response = await self._raw_client.list_customers(limit=limit, offset=offset, request_options=request_options)
617
490
  return _response.data
618
491
 
619
- async def create(
492
+ async def create_a_new_customer(
620
493
  self,
621
494
  *,
622
495
  name: str,
623
- external_id: typing.Optional[str] = OMIT,
496
+ legal_name: typing.Optional[str] = OMIT,
497
+ email: typing.Optional[str] = OMIT,
624
498
  phone: typing.Optional[str] = OMIT,
625
- employee_count: typing.Optional[float] = OMIT,
626
- annual_revenue: typing.Optional[float] = OMIT,
627
- tax_exempt_status: typing.Optional[TaxExemptStatus] = OMIT,
628
- creation_source: typing.Optional[CreationSource] = OMIT,
629
499
  website: typing.Optional[str] = OMIT,
630
- billing_address: typing.Optional[Address] = OMIT,
500
+ external_id: typing.Optional[str] = OMIT,
501
+ billing_address: typing.Optional[CustomerBillingAddress] = OMIT,
502
+ creation_state: typing.Optional[CustomerCreationState] = OMIT,
503
+ vat_number: typing.Optional[str] = OMIT,
631
504
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
632
505
  request_options: typing.Optional[RequestOptions] = None,
633
506
  ) -> Customer:
634
507
  """
508
+ Creates a new customer for the organization
509
+
635
510
  Parameters
636
511
  ----------
637
512
  name : str
638
513
 
639
- external_id : typing.Optional[str]
514
+ legal_name : typing.Optional[str]
640
515
 
641
- phone : typing.Optional[str]
516
+ email : typing.Optional[str]
642
517
 
643
- employee_count : typing.Optional[float]
518
+ phone : typing.Optional[str]
644
519
 
645
- annual_revenue : typing.Optional[float]
520
+ website : typing.Optional[str]
646
521
 
647
- tax_exempt_status : typing.Optional[TaxExemptStatus]
522
+ external_id : typing.Optional[str]
648
523
 
649
- creation_source : typing.Optional[CreationSource]
524
+ billing_address : typing.Optional[CustomerBillingAddress]
650
525
 
651
- website : typing.Optional[str]
526
+ creation_state : typing.Optional[CustomerCreationState]
652
527
 
653
- billing_address : typing.Optional[Address]
528
+ vat_number : typing.Optional[str]
654
529
 
655
530
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
656
- Flexible JSON field for storing custom metadata about the customer
657
531
 
658
532
  request_options : typing.Optional[RequestOptions]
659
533
  Request-specific configuration.
@@ -661,7 +535,7 @@ class AsyncCustomersClient:
661
535
  Returns
662
536
  -------
663
537
  Customer
664
- Success response
538
+ 201
665
539
 
666
540
  Examples
667
541
  --------
@@ -675,34 +549,35 @@ class AsyncCustomersClient:
675
549
 
676
550
 
677
551
  async def main() -> None:
678
- await client.customers.create(
679
- name="Acme, Inc.",
680
- external_id="acme-inc",
552
+ await client.customers.create_a_new_customer(
553
+ name="name",
681
554
  )
682
555
 
683
556
 
684
557
  asyncio.run(main())
685
558
  """
686
- _response = await self._raw_client.create(
559
+ _response = await self._raw_client.create_a_new_customer(
687
560
  name=name,
688
- external_id=external_id,
561
+ legal_name=legal_name,
562
+ email=email,
689
563
  phone=phone,
690
- employee_count=employee_count,
691
- annual_revenue=annual_revenue,
692
- tax_exempt_status=tax_exempt_status,
693
- creation_source=creation_source,
694
564
  website=website,
565
+ external_id=external_id,
695
566
  billing_address=billing_address,
567
+ creation_state=creation_state,
568
+ vat_number=vat_number,
696
569
  metadata=metadata,
697
570
  request_options=request_options,
698
571
  )
699
572
  return _response.data
700
573
 
701
- async def get(self, customer_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Customer:
574
+ async def get_customer(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Customer:
702
575
  """
576
+ Get a customer by its ID
577
+
703
578
  Parameters
704
579
  ----------
705
- customer_id : str
580
+ id : str
706
581
 
707
582
  request_options : typing.Optional[RequestOptions]
708
583
  Request-specific configuration.
@@ -710,7 +585,7 @@ class AsyncCustomersClient:
710
585
  Returns
711
586
  -------
712
587
  Customer
713
- Success response
588
+ 200
714
589
 
715
590
  Examples
716
591
  --------
@@ -724,57 +599,61 @@ class AsyncCustomersClient:
724
599
 
725
600
 
726
601
  async def main() -> None:
727
- await client.customers.get(
728
- customer_id="customerId",
602
+ await client.customers.get_customer(
603
+ id="id",
729
604
  )
730
605
 
731
606
 
732
607
  asyncio.run(main())
733
608
  """
734
- _response = await self._raw_client.get(customer_id, request_options=request_options)
609
+ _response = await self._raw_client.get_customer(id, request_options=request_options)
735
610
  return _response.data
736
611
 
737
- async def update(
612
+ async def update_customer(
738
613
  self,
739
- customer_id: str,
614
+ id: str,
740
615
  *,
741
616
  name: typing.Optional[str] = OMIT,
742
- external_id: typing.Optional[str] = OMIT,
617
+ legal_name: typing.Optional[str] = OMIT,
618
+ email: typing.Optional[str] = OMIT,
743
619
  phone: typing.Optional[str] = OMIT,
744
- employee_count: typing.Optional[float] = OMIT,
745
- annual_revenue: typing.Optional[float] = OMIT,
746
- tax_exempt_status: typing.Optional[TaxExemptStatus] = OMIT,
747
- creation_source: typing.Optional[CreationSource] = OMIT,
748
620
  website: typing.Optional[str] = OMIT,
749
- billing_address: typing.Optional[Address] = OMIT,
621
+ external_id: typing.Optional[str] = OMIT,
622
+ billing_address: typing.Optional[CustomerBillingAddress] = OMIT,
623
+ creation_state: typing.Optional[CustomerCreationState] = OMIT,
624
+ churn_date: typing.Optional[dt.datetime] = OMIT,
625
+ vat_number: typing.Optional[str] = OMIT,
750
626
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
751
627
  request_options: typing.Optional[RequestOptions] = None,
752
628
  ) -> Customer:
753
629
  """
630
+ Update a customer by its ID
631
+
754
632
  Parameters
755
633
  ----------
756
- customer_id : str
634
+ id : str
757
635
 
758
636
  name : typing.Optional[str]
759
637
 
760
- external_id : typing.Optional[str]
638
+ legal_name : typing.Optional[str]
639
+
640
+ email : typing.Optional[str]
761
641
 
762
642
  phone : typing.Optional[str]
763
643
 
764
- employee_count : typing.Optional[float]
644
+ website : typing.Optional[str]
765
645
 
766
- annual_revenue : typing.Optional[float]
646
+ external_id : typing.Optional[str]
767
647
 
768
- tax_exempt_status : typing.Optional[TaxExemptStatus]
648
+ billing_address : typing.Optional[CustomerBillingAddress]
769
649
 
770
- creation_source : typing.Optional[CreationSource]
650
+ creation_state : typing.Optional[CustomerCreationState]
771
651
 
772
- website : typing.Optional[str]
652
+ churn_date : typing.Optional[dt.datetime]
773
653
 
774
- billing_address : typing.Optional[Address]
654
+ vat_number : typing.Optional[str]
775
655
 
776
656
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
777
- Flexible JSON field for storing custom metadata about the customer
778
657
 
779
658
  request_options : typing.Optional[RequestOptions]
780
659
  Request-specific configuration.
@@ -782,7 +661,7 @@ class AsyncCustomersClient:
782
661
  Returns
783
662
  -------
784
663
  Customer
785
- Customer updated successfully
664
+ 200
786
665
 
787
666
  Examples
788
667
  --------
@@ -796,84 +675,47 @@ class AsyncCustomersClient:
796
675
 
797
676
 
798
677
  async def main() -> None:
799
- await client.customers.update(
800
- customer_id="customerId",
801
- name="Acme, Inc. (Updated)",
802
- phone="123-456-7890",
803
- employee_count=101.0,
804
- annual_revenue=1000001.0,
678
+ await client.customers.update_customer(
679
+ id="id",
805
680
  )
806
681
 
807
682
 
808
683
  asyncio.run(main())
809
684
  """
810
- _response = await self._raw_client.update(
811
- customer_id,
685
+ _response = await self._raw_client.update_customer(
686
+ id,
812
687
  name=name,
813
- external_id=external_id,
688
+ legal_name=legal_name,
689
+ email=email,
814
690
  phone=phone,
815
- employee_count=employee_count,
816
- annual_revenue=annual_revenue,
817
- tax_exempt_status=tax_exempt_status,
818
- creation_source=creation_source,
819
691
  website=website,
692
+ external_id=external_id,
820
693
  billing_address=billing_address,
694
+ creation_state=creation_state,
695
+ churn_date=churn_date,
696
+ vat_number=vat_number,
821
697
  metadata=metadata,
822
698
  request_options=request_options,
823
699
  )
824
700
  return _response.data
825
701
 
826
- async def delete(self, customer_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
827
- """
828
- Parameters
829
- ----------
830
- customer_id : str
831
-
832
- request_options : typing.Optional[RequestOptions]
833
- Request-specific configuration.
834
-
835
- Returns
836
- -------
837
- None
838
-
839
- Examples
840
- --------
841
- import asyncio
842
-
843
- from paid import AsyncPaid
844
-
845
- client = AsyncPaid(
846
- token="YOUR_TOKEN",
847
- )
848
-
849
-
850
- async def main() -> None:
851
- await client.customers.delete(
852
- customer_id="customerId",
853
- )
854
-
855
-
856
- asyncio.run(main())
702
+ async def delete_customer(
703
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
704
+ ) -> EmptyResponse:
857
705
  """
858
- _response = await self._raw_client.delete(customer_id, request_options=request_options)
859
- return _response.data
706
+ Delete a customer by its ID
860
707
 
861
- async def get_entitlements(
862
- self, customer_id: str, *, request_options: typing.Optional[RequestOptions] = None
863
- ) -> typing.List[EntitlementUsage]:
864
- """
865
708
  Parameters
866
709
  ----------
867
- customer_id : str
868
- The customer ID
710
+ id : str
869
711
 
870
712
  request_options : typing.Optional[RequestOptions]
871
713
  Request-specific configuration.
872
714
 
873
715
  Returns
874
716
  -------
875
- typing.List[EntitlementUsage]
876
- Success response
717
+ EmptyResponse
718
+ 200
877
719
 
878
720
  Examples
879
721
  --------
@@ -887,20 +729,22 @@ class AsyncCustomersClient:
887
729
 
888
730
 
889
731
  async def main() -> None:
890
- await client.customers.get_entitlements(
891
- customer_id="customerId",
732
+ await client.customers.delete_customer(
733
+ id="id",
892
734
  )
893
735
 
894
736
 
895
737
  asyncio.run(main())
896
738
  """
897
- _response = await self._raw_client.get_entitlements(customer_id, request_options=request_options)
739
+ _response = await self._raw_client.delete_customer(id, request_options=request_options)
898
740
  return _response.data
899
741
 
900
- async def get_by_external_id(
742
+ async def get_customer_by_external_id(
901
743
  self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
902
744
  ) -> Customer:
903
745
  """
746
+ Get a customer by its externalId
747
+
904
748
  Parameters
905
749
  ----------
906
750
  external_id : str
@@ -911,7 +755,7 @@ class AsyncCustomersClient:
911
755
  Returns
912
756
  -------
913
757
  Customer
914
- Success response
758
+ 200
915
759
 
916
760
  Examples
917
761
  --------
@@ -925,57 +769,61 @@ class AsyncCustomersClient:
925
769
 
926
770
 
927
771
  async def main() -> None:
928
- await client.customers.get_by_external_id(
772
+ await client.customers.get_customer_by_external_id(
929
773
  external_id="externalId",
930
774
  )
931
775
 
932
776
 
933
777
  asyncio.run(main())
934
778
  """
935
- _response = await self._raw_client.get_by_external_id(external_id, request_options=request_options)
779
+ _response = await self._raw_client.get_customer_by_external_id(external_id, request_options=request_options)
936
780
  return _response.data
937
781
 
938
- async def update_by_external_id(
782
+ async def update_customer_by_external_id(
939
783
  self,
940
784
  external_id_: str,
941
785
  *,
942
786
  name: typing.Optional[str] = OMIT,
943
- external_id: typing.Optional[str] = OMIT,
787
+ legal_name: typing.Optional[str] = OMIT,
788
+ email: typing.Optional[str] = OMIT,
944
789
  phone: typing.Optional[str] = OMIT,
945
- employee_count: typing.Optional[float] = OMIT,
946
- annual_revenue: typing.Optional[float] = OMIT,
947
- tax_exempt_status: typing.Optional[TaxExemptStatus] = OMIT,
948
- creation_source: typing.Optional[CreationSource] = OMIT,
949
790
  website: typing.Optional[str] = OMIT,
950
- billing_address: typing.Optional[Address] = OMIT,
791
+ external_id: typing.Optional[str] = OMIT,
792
+ billing_address: typing.Optional[CustomerBillingAddress] = OMIT,
793
+ creation_state: typing.Optional[CustomerCreationState] = OMIT,
794
+ churn_date: typing.Optional[dt.datetime] = OMIT,
795
+ vat_number: typing.Optional[str] = OMIT,
951
796
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
952
797
  request_options: typing.Optional[RequestOptions] = None,
953
798
  ) -> Customer:
954
799
  """
800
+ Update a customer by its externalId
801
+
955
802
  Parameters
956
803
  ----------
957
804
  external_id_ : str
958
805
 
959
806
  name : typing.Optional[str]
960
807
 
961
- external_id : typing.Optional[str]
808
+ legal_name : typing.Optional[str]
809
+
810
+ email : typing.Optional[str]
962
811
 
963
812
  phone : typing.Optional[str]
964
813
 
965
- employee_count : typing.Optional[float]
814
+ website : typing.Optional[str]
966
815
 
967
- annual_revenue : typing.Optional[float]
816
+ external_id : typing.Optional[str]
968
817
 
969
- tax_exempt_status : typing.Optional[TaxExemptStatus]
818
+ billing_address : typing.Optional[CustomerBillingAddress]
970
819
 
971
- creation_source : typing.Optional[CreationSource]
820
+ creation_state : typing.Optional[CustomerCreationState]
972
821
 
973
- website : typing.Optional[str]
822
+ churn_date : typing.Optional[dt.datetime]
974
823
 
975
- billing_address : typing.Optional[Address]
824
+ vat_number : typing.Optional[str]
976
825
 
977
826
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
978
- Flexible JSON field for storing custom metadata about the customer
979
827
 
980
828
  request_options : typing.Optional[RequestOptions]
981
829
  Request-specific configuration.
@@ -983,7 +831,7 @@ class AsyncCustomersClient:
983
831
  Returns
984
832
  -------
985
833
  Customer
986
- Success response
834
+ 200
987
835
 
988
836
  Examples
989
837
  --------
@@ -997,106 +845,51 @@ class AsyncCustomersClient:
997
845
 
998
846
 
999
847
  async def main() -> None:
1000
- await client.customers.update_by_external_id(
848
+ await client.customers.update_customer_by_external_id(
1001
849
  external_id_="externalId",
1002
850
  )
1003
851
 
1004
852
 
1005
853
  asyncio.run(main())
1006
854
  """
1007
- _response = await self._raw_client.update_by_external_id(
855
+ _response = await self._raw_client.update_customer_by_external_id(
1008
856
  external_id_,
1009
857
  name=name,
1010
- external_id=external_id,
858
+ legal_name=legal_name,
859
+ email=email,
1011
860
  phone=phone,
1012
- employee_count=employee_count,
1013
- annual_revenue=annual_revenue,
1014
- tax_exempt_status=tax_exempt_status,
1015
- creation_source=creation_source,
1016
861
  website=website,
862
+ external_id=external_id,
1017
863
  billing_address=billing_address,
864
+ creation_state=creation_state,
865
+ churn_date=churn_date,
866
+ vat_number=vat_number,
1018
867
  metadata=metadata,
1019
868
  request_options=request_options,
1020
869
  )
1021
870
  return _response.data
1022
871
 
1023
- async def delete_by_external_id(
872
+ async def delete_customer_by_external_id(
1024
873
  self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
1025
- ) -> None:
874
+ ) -> EmptyResponse:
1026
875
  """
1027
- Parameters
1028
- ----------
1029
- external_id : str
1030
-
1031
- request_options : typing.Optional[RequestOptions]
1032
- Request-specific configuration.
876
+ Delete a customer by its externalId
1033
877
 
1034
- Returns
1035
- -------
1036
- None
1037
-
1038
- Examples
1039
- --------
1040
- import asyncio
1041
-
1042
- from paid import AsyncPaid
1043
-
1044
- client = AsyncPaid(
1045
- token="YOUR_TOKEN",
1046
- )
1047
-
1048
-
1049
- async def main() -> None:
1050
- await client.customers.delete_by_external_id(
1051
- external_id="externalId",
1052
- )
1053
-
1054
-
1055
- asyncio.run(main())
1056
- """
1057
- _response = await self._raw_client.delete_by_external_id(external_id, request_options=request_options)
1058
- return _response.data
1059
-
1060
- async def get_costs_by_external_id(
1061
- self,
1062
- external_id: str,
1063
- *,
1064
- limit: typing.Optional[int] = None,
1065
- offset: typing.Optional[int] = None,
1066
- start_time: typing.Optional[dt.datetime] = None,
1067
- end_time: typing.Optional[dt.datetime] = None,
1068
- request_options: typing.Optional[RequestOptions] = None,
1069
- ) -> CostTracesResponse:
1070
- """
1071
878
  Parameters
1072
879
  ----------
1073
880
  external_id : str
1074
- The external ID of the customer
1075
-
1076
- limit : typing.Optional[int]
1077
- Maximum number of traces to return (1-1000)
1078
-
1079
- offset : typing.Optional[int]
1080
- Number of traces to skip for pagination
1081
-
1082
- start_time : typing.Optional[dt.datetime]
1083
- Filter traces starting from this time (ISO 8601 format)
1084
-
1085
- end_time : typing.Optional[dt.datetime]
1086
- Filter traces up to this time (ISO 8601 format)
1087
881
 
1088
882
  request_options : typing.Optional[RequestOptions]
1089
883
  Request-specific configuration.
1090
884
 
1091
885
  Returns
1092
886
  -------
1093
- CostTracesResponse
1094
- Success response
887
+ EmptyResponse
888
+ 200
1095
889
 
1096
890
  Examples
1097
891
  --------
1098
892
  import asyncio
1099
- import datetime
1100
893
 
1101
894
  from paid import AsyncPaid
1102
895
 
@@ -1106,101 +899,12 @@ class AsyncCustomersClient:
1106
899
 
1107
900
 
1108
901
  async def main() -> None:
1109
- await client.customers.get_costs_by_external_id(
902
+ await client.customers.delete_customer_by_external_id(
1110
903
  external_id="externalId",
1111
- limit=1,
1112
- offset=1,
1113
- start_time=datetime.datetime.fromisoformat(
1114
- "2024-01-15 09:30:00+00:00",
1115
- ),
1116
- end_time=datetime.datetime.fromisoformat(
1117
- "2024-01-15 09:30:00+00:00",
1118
- ),
1119
904
  )
1120
905
 
1121
906
 
1122
907
  asyncio.run(main())
1123
908
  """
1124
- _response = await self._raw_client.get_costs_by_external_id(
1125
- external_id,
1126
- limit=limit,
1127
- offset=offset,
1128
- start_time=start_time,
1129
- end_time=end_time,
1130
- request_options=request_options,
1131
- )
1132
- return _response.data
1133
-
1134
- async def get_usage_by_external_id(
1135
- self,
1136
- external_id: str,
1137
- *,
1138
- limit: typing.Optional[int] = None,
1139
- offset: typing.Optional[int] = None,
1140
- start_time: typing.Optional[dt.datetime] = None,
1141
- end_time: typing.Optional[dt.datetime] = None,
1142
- request_options: typing.Optional[RequestOptions] = None,
1143
- ) -> UsageSummariesResponse:
1144
- """
1145
- Parameters
1146
- ----------
1147
- external_id : str
1148
- The external ID of the customer
1149
-
1150
- limit : typing.Optional[int]
1151
- Maximum number of usage summaries to return (1-1000)
1152
-
1153
- offset : typing.Optional[int]
1154
- Number of usage summaries to skip for pagination
1155
-
1156
- start_time : typing.Optional[dt.datetime]
1157
- Filter usage summaries starting from this time (ISO 8601 format). Returns summaries that overlap with the time range.
1158
-
1159
- end_time : typing.Optional[dt.datetime]
1160
- Filter usage summaries up to this time (ISO 8601 format). Returns summaries that overlap with the time range.
1161
-
1162
- request_options : typing.Optional[RequestOptions]
1163
- Request-specific configuration.
1164
-
1165
- Returns
1166
- -------
1167
- UsageSummariesResponse
1168
- Success response
1169
-
1170
- Examples
1171
- --------
1172
- import asyncio
1173
- import datetime
1174
-
1175
- from paid import AsyncPaid
1176
-
1177
- client = AsyncPaid(
1178
- token="YOUR_TOKEN",
1179
- )
1180
-
1181
-
1182
- async def main() -> None:
1183
- await client.customers.get_usage_by_external_id(
1184
- external_id="externalId",
1185
- limit=1,
1186
- offset=1,
1187
- start_time=datetime.datetime.fromisoformat(
1188
- "2024-01-15 09:30:00+00:00",
1189
- ),
1190
- end_time=datetime.datetime.fromisoformat(
1191
- "2024-01-15 09:30:00+00:00",
1192
- ),
1193
- )
1194
-
1195
-
1196
- asyncio.run(main())
1197
- """
1198
- _response = await self._raw_client.get_usage_by_external_id(
1199
- external_id,
1200
- limit=limit,
1201
- offset=offset,
1202
- start_time=start_time,
1203
- end_time=end_time,
1204
- request_options=request_options,
1205
- )
909
+ _response = await self._raw_client.delete_customer_by_external_id(external_id, request_options=request_options)
1206
910
  return _response.data