Skip to content

Commit 29e5823

Browse files
authored
Merge pull request #126 from square/release/34.0.0.20240118
Generated PR for Release: 34.0.0.20240118
2 parents da0efa5 + 71ebfe0 commit 29e5823

File tree

63 files changed

+653
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+653
-81
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ assignees: ''
88
---
99

1010
## **ATTENTION**
11-
This issue template is for **bugs** or **documentation** errors in this SDK Repo. Please direct all technical support questions, feature requests, API-related issues, and general discussions to our Square-supported developer channels. For public support, [join us in our BuildWithSquare Slack](https://squ.re/slack) or [post in our Developer Forums](https://developer.squareup.com/forums). For private support, [contact our Developer Success Engineers](https://squareup.com/help/us/en/contact?panel=BF53A9C8EF68) directly.
11+
This issue template is for **bugs** or **documentation** errors in this SDK Repo. Please direct all technical support questions, feature requests, API-related issues, and general discussions to our Square-supported developer channels. For public support, [join us in our Square Developer Discord server](https://discord.com/invite/squaredev) or [post in our Developer Forums](https://developer.squareup.com/forums). For private support, [contact our Developer Success Engineers](https://squareup.com/help/us/en/contact?panel=BF53A9C8EF68) directly.
1212

1313
**Describe the bug**
1414
A clear and concise description of what the bug is.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ contact_links:
33
- name: Square Developer Forums
44
url: https://developer.squareup.com/forums
55
about: Public discussion threads for technical support, feature requests, api discussion, and all things related to square development.
6-
- name: BuildWithSquare Slack Channel
7-
url: https://squ.re/slack
6+
- name: Square Developer Discord Server
7+
url: https://discord.com/invite/squaredev
88
about: Community slack channel for real time support and conversations about building with square.
99
- name: Developer Support
1010
url: https://squareup.com/help/us/en/contact?panel=BF53A9C8EF68

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2023 Square, Inc.
1+
Copyright 2024 Square, Inc.
22
Licensed under the Apache License, Version 2.0 (the "License");
33
you may not use this file except in compliance with the License.
44
You may obtain a copy of the License at

doc/api/booking-custom-attributes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def list_booking_custom_attributes(self,
354354
| `booking_id` | `str` | Template, Required | The ID of the target [booking](entity:Booking). |
355355
| `limit` | `int` | Query, Optional | The maximum number of results to return in a single paged response. This limit is advisory.<br>The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.<br>The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |
356356
| `cursor` | `str` | Query, Optional | The cursor returned in the paged response from the previous call to this endpoint.<br>Provide this cursor to retrieve the next page of results for your original request. For more<br>information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |
357-
| `with_definitions` | `bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each<br>custom attribute. Set this parameter to `true` to get the name and description of each custom<br>attribute, information about the data type, or other definition details. The default value is `false`.<br>**Default**: `False` |
357+
| `with_definitions` | `bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each<br>custom attribute. Set this parameter to `true` to get the name and description of each custom<br>attribute, information about the data type, or other definition details. The default value is `false`. |
358358

359359
## Response Type
360360

@@ -448,7 +448,7 @@ def retrieve_booking_custom_attribute(self,
448448
| --- | --- | --- | --- |
449449
| `booking_id` | `str` | Template, Required | The ID of the target [booking](entity:Booking). |
450450
| `key` | `str` | Template, Required | The key of the custom attribute to retrieve. This key must match the `key` of a custom<br>attribute definition in the Square seller account. If the requesting application is not the<br>definition owner, you must use the qualified key. |
451-
| `with_definition` | `bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of<br>the custom attribute. Set this parameter to `true` to get the name and description of the custom<br>attribute, information about the data type, or other definition details. The default value is `false`.<br>**Default**: `False` |
451+
| `with_definition` | `bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of<br>the custom attribute. Set this parameter to `true` to get the name and description of the custom<br>attribute, information about the data type, or other definition details. The default value is `false`. |
452452
| `version` | `int` | Query, Optional | The current version of the custom attribute, which is used for strongly consistent reads to<br>guarantee that you receive the most up-to-date data. When included in the request, Square<br>returns the specified version or a higher version if one exists. If the specified version is<br>higher than the current version, Square returns a `BAD_REQUEST` error. |
453453

454454
## Response Type

doc/api/bookings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def list_team_member_booking_profiles(self,
317317

318318
| Parameter | Type | Tags | Description |
319319
| --- | --- | --- | --- |
320-
| `bookable_only` | `bool` | Query, Optional | Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`).<br>**Default**: `False` |
320+
| `bookable_only` | `bool` | Query, Optional | Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`). |
321321
| `limit` | `int` | Query, Optional | The maximum number of results to return in a paged response. |
322322
| `cursor` | `str` | Query, Optional | The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. |
323323
| `location_id` | `str` | Query, Optional | Indicates whether to include only team members enabled at the given location in the returned result. |

doc/api/cards.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def list_cards(self,
3636
| --- | --- | --- | --- |
3737
| `cursor` | `str` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this to retrieve the next set of results for your original query.<br><br>See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. |
3838
| `customer_id` | `str` | Query, Optional | Limit results to cards associated with the customer supplied.<br>By default, all cards owned by the merchant are returned. |
39-
| `include_disabled` | `bool` | Query, Optional | Includes disabled cards.<br>By default, all enabled cards owned by the merchant are returned.<br>**Default**: `False` |
39+
| `include_disabled` | `bool` | Query, Optional | Includes disabled cards.<br>By default, all enabled cards owned by the merchant are returned. |
4040
| `reference_id` | `str` | Query, Optional | Limit results to cards associated with the reference_id supplied. |
4141
| `sort_order` | [`str (Sort Order)`](../../doc/models/sort-order.md) | Query, Optional | Sorts the returned list by when the card was created with the specified order.<br>This field defaults to ASC. |
4242

doc/api/catalog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,9 @@ def retrieve_catalog_object(self,
587587
| Parameter | Type | Tags | Description |
588588
| --- | --- | --- | --- |
589589
| `object_id` | `str` | Template, Required | The object ID of any type of catalog objects to be retrieved. |
590-
| `include_related_objects` | `bool` | Query, Optional | If `true`, the response will include additional objects that are related to the<br>requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field<br>of the response. These objects are put in the `related_objects` field. Setting this to `true` is<br>helpful when the objects are needed for immediate display to a user.<br>This process only goes one level deep. Objects referenced by the related objects will not be included. For example,<br><br>if the `objects` field of the response contains a CatalogItem, its associated<br>CatalogCategory objects, CatalogTax objects, CatalogImage objects and<br>CatalogModifierLists will be returned in the `related_objects` field of the<br>response. If the `objects` field of the response contains a CatalogItemVariation,<br>its parent CatalogItem will be returned in the `related_objects` field of<br>the response.<br><br>Default value: `false`<br>**Default**: `False` |
590+
| `include_related_objects` | `bool` | Query, Optional | If `true`, the response will include additional objects that are related to the<br>requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field<br>of the response. These objects are put in the `related_objects` field. Setting this to `true` is<br>helpful when the objects are needed for immediate display to a user.<br>This process only goes one level deep. Objects referenced by the related objects will not be included. For example,<br><br>if the `objects` field of the response contains a CatalogItem, its associated<br>CatalogCategory objects, CatalogTax objects, CatalogImage objects and<br>CatalogModifierLists will be returned in the `related_objects` field of the<br>response. If the `objects` field of the response contains a CatalogItemVariation,<br>its parent CatalogItem will be returned in the `related_objects` field of<br>the response.<br><br>Default value: `false` |
591591
| `catalog_version` | `long\|int` | Query, Optional | Requests objects as of a specific version of the catalog. This allows you to retrieve historical<br>versions of objects. The value to retrieve a specific version of an object can be found<br>in the version field of [CatalogObject](../../doc/models/catalog-object.md)s. If not included, results will<br>be from the current version of the catalog. |
592-
| `include_category_path_to_root` | `bool` | Query, Optional | Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists<br>of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category<br>and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned<br>in the response payload.<br>**Default**: `False` |
592+
| `include_category_path_to_root` | `bool` | Query, Optional | Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists<br>of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category<br>and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned<br>in the response payload. |
593593

594594
## Response Type
595595

doc/api/customer-custom-attributes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def list_customer_custom_attributes(self,
327327
| `customer_id` | `str` | Template, Required | The ID of the target [customer profile](entity:Customer). |
328328
| `limit` | `int` | Query, Optional | The maximum number of results to return in a single paged response. This limit is advisory.<br>The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.<br>The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |
329329
| `cursor` | `str` | Query, Optional | The cursor returned in the paged response from the previous call to this endpoint.<br>Provide this cursor to retrieve the next page of results for your original request. For more<br>information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |
330-
| `with_definitions` | `bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each<br>custom attribute. Set this parameter to `true` to get the name and description of each custom<br>attribute, information about the data type, or other definition details. The default value is `false`.<br>**Default**: `False` |
330+
| `with_definitions` | `bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each<br>custom attribute. Set this parameter to `true` to get the name and description of each custom<br>attribute, information about the data type, or other definition details. The default value is `false`. |
331331

332332
## Response Type
333333

@@ -423,7 +423,7 @@ def retrieve_customer_custom_attribute(self,
423423
| --- | --- | --- | --- |
424424
| `customer_id` | `str` | Template, Required | The ID of the target [customer profile](entity:Customer). |
425425
| `key` | `str` | Template, Required | The key of the custom attribute to retrieve. This key must match the `key` of a custom<br>attribute definition in the Square seller account. If the requesting application is not the<br>definition owner, you must use the qualified key. |
426-
| `with_definition` | `bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of<br>the custom attribute. Set this parameter to `true` to get the name and description of the custom<br>attribute, information about the data type, or other definition details. The default value is `false`.<br>**Default**: `False` |
426+
| `with_definition` | `bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of<br>the custom attribute. Set this parameter to `true` to get the name and description of the custom<br>attribute, information about the data type, or other definition details. The default value is `false`. |
427427
| `version` | `int` | Query, Optional | The current version of the custom attribute, which is used for strongly consistent reads to<br>guarantee that you receive the most up-to-date data. When included in the request, Square<br>returns the specified version or a higher version if one exists. If the specified version is<br>higher than the current version, Square returns a `BAD_REQUEST` error. |
428428

429429
## Response Type

doc/api/customers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def list_customers(self,
4747
| `limit` | `int` | Query, Optional | The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.<br>If the specified limit is less than 1 or greater than 100, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100.<br><br>For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |
4848
| `sort_field` | [`str (Customer Sort Field)`](../../doc/models/customer-sort-field.md) | Query, Optional | Indicates how customers should be sorted.<br><br>The default value is `DEFAULT`. |
4949
| `sort_order` | [`str (Sort Order)`](../../doc/models/sort-order.md) | Query, Optional | Indicates whether customers should be sorted in ascending (`ASC`) or<br>descending (`DESC`) order.<br><br>The default value is `ASC`. |
50-
| `count` | `bool` | Query, Optional | Indicates whether to return the total count of customers in the `count` field of the response.<br><br>The default value is `false`.<br>**Default**: `False` |
50+
| `count` | `bool` | Query, Optional | Indicates whether to return the total count of customers in the `count` field of the response.<br><br>The default value is `false`. |
5151

5252
## Response Type
5353

@@ -276,7 +276,7 @@ elif result.is_error():
276276
# Update Customer
277277

278278
Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request.
279-
To add or update a field, specify the new value. To remove a field, specify `null` and include the `X-Clear-Null` header set to `true`
279+
To add or update a field, specify the new value. To remove a field, specify `null`
280280
(recommended) or specify an empty string (string fields only).
281281

282282
As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control.

doc/api/invoices.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ invoices_api = client.invoices
1616
* [Delete Invoice](../../doc/api/invoices.md#delete-invoice)
1717
* [Get Invoice](../../doc/api/invoices.md#get-invoice)
1818
* [Update Invoice](../../doc/api/invoices.md#update-invoice)
19+
* [Create Invoice Attachment](../../doc/api/invoices.md#create-invoice-attachment)
20+
* [Delete Invoice Attachment](../../doc/api/invoices.md#delete-invoice-attachment)
1921
* [Cancel Invoice](../../doc/api/invoices.md#cancel-invoice)
2022
* [Publish Invoice](../../doc/api/invoices.md#publish-invoice)
2123

@@ -332,6 +334,99 @@ elif result.is_error():
332334
```
333335

334336

337+
# Create Invoice Attachment
338+
339+
Uploads a file and attaches it to an invoice. This endpoint accepts HTTP multipart/form-data file uploads
340+
with a JSON `request` part and a `file` part. The `file` part must be a `readable stream` that contains a file
341+
in a supported format: GIF, JPEG, PNG, TIFF, BMP, or PDF.
342+
343+
Invoices can have up to 10 attachments with a total file size of 25 MB. Attachments can be added only to invoices
344+
in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state.
345+
346+
```python
347+
def create_invoice_attachment(self,
348+
invoice_id,
349+
request=None,
350+
image_file=None)
351+
```
352+
353+
## Parameters
354+
355+
| Parameter | Type | Tags | Description |
356+
| --- | --- | --- | --- |
357+
| `invoice_id` | `str` | Template, Required | The ID of the [invoice](entity:Invoice) to attach the file to. |
358+
| `request` | [`Create Invoice Attachment Request`](../../doc/models/create-invoice-attachment-request.md) | Form (JSON-Encoded), Optional | Represents a [CreateInvoiceAttachment](../../doc/api/invoices.md#create-invoice-attachment) request. |
359+
| `image_file` | `typing.BinaryIO` | Form, Optional | - |
360+
361+
## Response Type
362+
363+
This method returns a `ApiResponse` instance. The `body` property of this instance returns the response data which is of type [`Create Invoice Attachment Response`](../../doc/models/create-invoice-attachment-response.md).
364+
365+
## Example Usage
366+
367+
```python
368+
invoice_id = 'invoice_id0'
369+
370+
request = {
371+
'idempotency_key': 'ae5e84f9-4742-4fc1-ba12-a3ce3748f1c3',
372+
'description': 'Service contract'
373+
}
374+
375+
result = invoices_api.create_invoice_attachment(
376+
invoice_id,
377+
request=request
378+
)
379+
print(result)
380+
381+
if result.is_success():
382+
print(result.body)
383+
elif result.is_error():
384+
print(result.errors)
385+
```
386+
387+
388+
# Delete Invoice Attachment
389+
390+
Removes an attachment from an invoice and permanently deletes the file. Attachments can be removed only
391+
from invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state.
392+
393+
```python
394+
def delete_invoice_attachment(self,
395+
invoice_id,
396+
attachment_id)
397+
```
398+
399+
## Parameters
400+
401+
| Parameter | Type | Tags | Description |
402+
| --- | --- | --- | --- |
403+
| `invoice_id` | `str` | Template, Required | The ID of the [invoice](entity:Invoice) to delete the attachment from. |
404+
| `attachment_id` | `str` | Template, Required | The ID of the [attachment](entity:InvoiceAttachment) to delete. |
405+
406+
## Response Type
407+
408+
This method returns a `ApiResponse` instance. The `body` property of this instance returns the response data which is of type [`Delete Invoice Attachment Response`](../../doc/models/delete-invoice-attachment-response.md).
409+
410+
## Example Usage
411+
412+
```python
413+
invoice_id = 'invoice_id0'
414+
415+
attachment_id = 'attachment_id6'
416+
417+
result = invoices_api.delete_invoice_attachment(
418+
invoice_id,
419+
attachment_id
420+
)
421+
print(result)
422+
423+
if result.is_success():
424+
print(result.body)
425+
elif result.is_error():
426+
print(result.errors)
427+
```
428+
429+
335430
# Cancel Invoice
336431

337432
Cancels an invoice. The seller cannot collect payments for

0 commit comments

Comments
 (0)