Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cliVersion": "3.49.3",
"cliVersion": "3.98.5",
"generatorName": "fernapi/fern-python-sdk",
"generatorVersion": "4.55.4",
"generatorConfig": {
Expand All @@ -14,5 +14,5 @@
"use_typeddict_requests_for_file_upload": true,
"exclude_types_from_init_exports": true
},
"sdkVersion": "44.0.1.20260122"
"sdkVersion": "44.1.0.20260520"
}
10 changes: 10 additions & 0 deletions .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ legacy
src/square/core/api_error.py
src/square/utils/webhooks_helper.py
tests/integration
README.md
README.md
.fern/replay.lock
.fern/replay.yml
.gitattributes
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.fern/replay.lock linguist-generated=true
116 changes: 58 additions & 58 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dynamic = ["version"]

[tool.poetry]
name = "squareup"
version = "44.0.1.20260122"
version = "44.1.0.20260520"
description = ""
readme = "README.md"
authors = []
Expand Down
26 changes: 26 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -12826,6 +12826,19 @@ For more information, see [Permissions](https://developer.squareup.com/docs/paym
<dl>
<dd>

**app_fee_allocations:** `typing.Optional[typing.Sequence[typing.Any]]`

Details pertaining to recipients of the application fee. The sum of the amounts in the
app_fee_allocations must equal the app_fee_money amount, if present. If populated, an
allocation must be present for every party that expects to receive a portion of the application
fee, including the application developer.

</dd>
</dl>

<dl>
<dd>

**delay_duration:** `typing.Optional[str]`

The duration of time after the payment's creation when Square automatically
Expand Down Expand Up @@ -14154,6 +14167,19 @@ For more information, see [Permissions](https://developer.squareup.com/docs/paym
<dl>
<dd>

**app_fee_allocations:** `typing.Optional[typing.Sequence[typing.Any]]`

Details pertaining to contributors to the refund of the application fee.
The sum of the amounts in the app_fee_allocations must equal the app_fee_money amount, if
present. If populated, an allocation must be present for every party that expects to contribute
a portion of the refunded application fee, including the application developer.

</dd>
</dl>

<dl>
<dd>

**payment_id:** `typing.Optional[str]`

The unique ID of the payment being refunded.
Expand Down
6 changes: 3 additions & 3 deletions src/square/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ def get_headers(self) -> typing.Dict[str, str]:
import platform

headers: typing.Dict[str, str] = {
"User-Agent": "squareup/44.0.1.20260122",
"User-Agent": "squareup/44.1.0.20260520",
"X-Fern-Language": "Python",
"X-Fern-Runtime": f"python/{platform.python_version()}",
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
"X-Fern-SDK-Name": "squareup",
"X-Fern-SDK-Version": "44.0.1.20260122",
"X-Fern-SDK-Version": "44.1.0.20260520",
**(self.get_custom_headers() or {}),
}
token = self._get_token()
if token is not None:
headers["Authorization"] = f"Bearer {token}"
headers["Square-Version"] = self._version if self._version is not None else "2026-01-22"
headers["Square-Version"] = self._version if self._version is not None else "2026-05-20"
return headers

def _get_token(self) -> typing.Optional[str]:
Expand Down
16 changes: 16 additions & 0 deletions src/square/payments/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ def create(
amount_money: typing.Optional[MoneyParams] = OMIT,
tip_money: typing.Optional[MoneyParams] = OMIT,
app_fee_money: typing.Optional[MoneyParams] = OMIT,
app_fee_allocations: typing.Optional[typing.Sequence[typing.Any]] = OMIT,
delay_duration: typing.Optional[str] = OMIT,
delay_action: typing.Optional[str] = OMIT,
autocomplete: typing.Optional[bool] = OMIT,
Expand Down Expand Up @@ -305,6 +306,12 @@ def create(
To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required.
For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).

app_fee_allocations : typing.Optional[typing.Sequence[typing.Any]]
Details pertaining to recipients of the application fee. The sum of the amounts in the
app_fee_allocations must equal the app_fee_money amount, if present. If populated, an
allocation must be present for every party that expects to receive a portion of the application
fee, including the application developer.

delay_duration : typing.Optional[str]
The duration of time after the payment's creation when Square automatically
either completes or cancels the payment depending on the `delay_action` field value.
Expand Down Expand Up @@ -452,6 +459,7 @@ def create(
amount_money=amount_money,
tip_money=tip_money,
app_fee_money=app_fee_money,
app_fee_allocations=app_fee_allocations,
delay_duration=delay_duration,
delay_action=delay_action,
autocomplete=autocomplete,
Expand Down Expand Up @@ -881,6 +889,7 @@ async def create(
amount_money: typing.Optional[MoneyParams] = OMIT,
tip_money: typing.Optional[MoneyParams] = OMIT,
app_fee_money: typing.Optional[MoneyParams] = OMIT,
app_fee_allocations: typing.Optional[typing.Sequence[typing.Any]] = OMIT,
delay_duration: typing.Optional[str] = OMIT,
delay_action: typing.Optional[str] = OMIT,
autocomplete: typing.Optional[bool] = OMIT,
Expand Down Expand Up @@ -975,6 +984,12 @@ async def create(
To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required.
For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).

app_fee_allocations : typing.Optional[typing.Sequence[typing.Any]]
Details pertaining to recipients of the application fee. The sum of the amounts in the
app_fee_allocations must equal the app_fee_money amount, if present. If populated, an
allocation must be present for every party that expects to receive a portion of the application
fee, including the application developer.

delay_duration : typing.Optional[str]
The duration of time after the payment's creation when Square automatically
either completes or cancels the payment depending on the `delay_action` field value.
Expand Down Expand Up @@ -1130,6 +1145,7 @@ async def main() -> None:
amount_money=amount_money,
tip_money=tip_money,
app_fee_money=app_fee_money,
app_fee_allocations=app_fee_allocations,
delay_duration=delay_duration,
delay_action=delay_action,
autocomplete=autocomplete,
Expand Down
16 changes: 16 additions & 0 deletions src/square/payments/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def create(
amount_money: typing.Optional[MoneyParams] = OMIT,
tip_money: typing.Optional[MoneyParams] = OMIT,
app_fee_money: typing.Optional[MoneyParams] = OMIT,
app_fee_allocations: typing.Optional[typing.Sequence[typing.Any]] = OMIT,
delay_duration: typing.Optional[str] = OMIT,
delay_action: typing.Optional[str] = OMIT,
autocomplete: typing.Optional[bool] = OMIT,
Expand Down Expand Up @@ -308,6 +309,12 @@ def create(
To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required.
For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).

app_fee_allocations : typing.Optional[typing.Sequence[typing.Any]]
Details pertaining to recipients of the application fee. The sum of the amounts in the
app_fee_allocations must equal the app_fee_money amount, if present. If populated, an
allocation must be present for every party that expects to receive a portion of the application
fee, including the application developer.

delay_duration : typing.Optional[str]
The duration of time after the payment's creation when Square automatically
either completes or cancels the payment depending on the `delay_action` field value.
Expand Down Expand Up @@ -445,6 +452,7 @@ def create(
"app_fee_money": convert_and_respect_annotation_metadata(
object_=app_fee_money, annotation=MoneyParams, direction="write"
),
"app_fee_allocations": app_fee_allocations,
"delay_duration": delay_duration,
"delay_action": delay_action,
"autocomplete": autocomplete,
Expand Down Expand Up @@ -942,6 +950,7 @@ async def create(
amount_money: typing.Optional[MoneyParams] = OMIT,
tip_money: typing.Optional[MoneyParams] = OMIT,
app_fee_money: typing.Optional[MoneyParams] = OMIT,
app_fee_allocations: typing.Optional[typing.Sequence[typing.Any]] = OMIT,
delay_duration: typing.Optional[str] = OMIT,
delay_action: typing.Optional[str] = OMIT,
autocomplete: typing.Optional[bool] = OMIT,
Expand Down Expand Up @@ -1036,6 +1045,12 @@ async def create(
To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required.
For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).

app_fee_allocations : typing.Optional[typing.Sequence[typing.Any]]
Details pertaining to recipients of the application fee. The sum of the amounts in the
app_fee_allocations must equal the app_fee_money amount, if present. If populated, an
allocation must be present for every party that expects to receive a portion of the application
fee, including the application developer.

delay_duration : typing.Optional[str]
The duration of time after the payment's creation when Square automatically
either completes or cancels the payment depending on the `delay_action` field value.
Expand Down Expand Up @@ -1173,6 +1188,7 @@ async def create(
"app_fee_money": convert_and_respect_annotation_metadata(
object_=app_fee_money, annotation=MoneyParams, direction="write"
),
"app_fee_allocations": app_fee_allocations,
"delay_duration": delay_duration,
"delay_action": delay_action,
"autocomplete": autocomplete,
Expand Down
16 changes: 16 additions & 0 deletions src/square/refunds/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def refund_payment(
idempotency_key: str,
amount_money: MoneyParams,
app_fee_money: typing.Optional[MoneyParams] = OMIT,
app_fee_allocations: typing.Optional[typing.Sequence[typing.Any]] = OMIT,
payment_id: typing.Optional[str] = OMIT,
destination_id: typing.Optional[str] = OMIT,
unlinked: typing.Optional[bool] = OMIT,
Expand Down Expand Up @@ -236,6 +237,12 @@ def refund_payment(
To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required.
For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).

app_fee_allocations : typing.Optional[typing.Sequence[typing.Any]]
Details pertaining to contributors to the refund of the application fee.
The sum of the amounts in the app_fee_allocations must equal the app_fee_money amount, if
present. If populated, an allocation must be present for every party that expects to contribute
a portion of the refunded application fee, including the application developer.

payment_id : typing.Optional[str]
The unique ID of the payment being refunded.
Required when unlinked=false, otherwise must not be set.
Expand Down Expand Up @@ -310,6 +317,7 @@ def refund_payment(
idempotency_key=idempotency_key,
amount_money=amount_money,
app_fee_money=app_fee_money,
app_fee_allocations=app_fee_allocations,
payment_id=payment_id,
destination_id=destination_id,
unlinked=unlinked,
Expand Down Expand Up @@ -528,6 +536,7 @@ async def refund_payment(
idempotency_key: str,
amount_money: MoneyParams,
app_fee_money: typing.Optional[MoneyParams] = OMIT,
app_fee_allocations: typing.Optional[typing.Sequence[typing.Any]] = OMIT,
payment_id: typing.Optional[str] = OMIT,
destination_id: typing.Optional[str] = OMIT,
unlinked: typing.Optional[bool] = OMIT,
Expand Down Expand Up @@ -584,6 +593,12 @@ async def refund_payment(
To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required.
For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).

app_fee_allocations : typing.Optional[typing.Sequence[typing.Any]]
Details pertaining to contributors to the refund of the application fee.
The sum of the amounts in the app_fee_allocations must equal the app_fee_money amount, if
present. If populated, an allocation must be present for every party that expects to contribute
a portion of the refunded application fee, including the application developer.

payment_id : typing.Optional[str]
The unique ID of the payment being refunded.
Required when unlinked=false, otherwise must not be set.
Expand Down Expand Up @@ -666,6 +681,7 @@ async def main() -> None:
idempotency_key=idempotency_key,
amount_money=amount_money,
app_fee_money=app_fee_money,
app_fee_allocations=app_fee_allocations,
payment_id=payment_id,
destination_id=destination_id,
unlinked=unlinked,
Expand Down
16 changes: 16 additions & 0 deletions src/square/refunds/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def refund_payment(
idempotency_key: str,
amount_money: MoneyParams,
app_fee_money: typing.Optional[MoneyParams] = OMIT,
app_fee_allocations: typing.Optional[typing.Sequence[typing.Any]] = OMIT,
payment_id: typing.Optional[str] = OMIT,
destination_id: typing.Optional[str] = OMIT,
unlinked: typing.Optional[bool] = OMIT,
Expand Down Expand Up @@ -239,6 +240,12 @@ def refund_payment(
To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required.
For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).

app_fee_allocations : typing.Optional[typing.Sequence[typing.Any]]
Details pertaining to contributors to the refund of the application fee.
The sum of the amounts in the app_fee_allocations must equal the app_fee_money amount, if
present. If populated, an allocation must be present for every party that expects to contribute
a portion of the refunded application fee, including the application developer.

payment_id : typing.Optional[str]
The unique ID of the payment being refunded.
Required when unlinked=false, otherwise must not be set.
Expand Down Expand Up @@ -305,6 +312,7 @@ def refund_payment(
"app_fee_money": convert_and_respect_annotation_metadata(
object_=app_fee_money, annotation=MoneyParams, direction="write"
),
"app_fee_allocations": app_fee_allocations,
"payment_id": payment_id,
"destination_id": destination_id,
"unlinked": unlinked,
Expand Down Expand Up @@ -545,6 +553,7 @@ async def refund_payment(
idempotency_key: str,
amount_money: MoneyParams,
app_fee_money: typing.Optional[MoneyParams] = OMIT,
app_fee_allocations: typing.Optional[typing.Sequence[typing.Any]] = OMIT,
payment_id: typing.Optional[str] = OMIT,
destination_id: typing.Optional[str] = OMIT,
unlinked: typing.Optional[bool] = OMIT,
Expand Down Expand Up @@ -601,6 +610,12 @@ async def refund_payment(
To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required.
For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).

app_fee_allocations : typing.Optional[typing.Sequence[typing.Any]]
Details pertaining to contributors to the refund of the application fee.
The sum of the amounts in the app_fee_allocations must equal the app_fee_money amount, if
present. If populated, an allocation must be present for every party that expects to contribute
a portion of the refunded application fee, including the application developer.

payment_id : typing.Optional[str]
The unique ID of the payment being refunded.
Required when unlinked=false, otherwise must not be set.
Expand Down Expand Up @@ -667,6 +682,7 @@ async def refund_payment(
"app_fee_money": convert_and_respect_annotation_metadata(
object_=app_fee_money, annotation=MoneyParams, direction="write"
),
"app_fee_allocations": app_fee_allocations,
"payment_id": payment_id,
"destination_id": destination_id,
"unlinked": unlinked,
Expand Down
17 changes: 17 additions & 0 deletions src/square/requests/card_payment_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import typing_extensions
from .card import CardParams
from .card_payment_timeline import CardPaymentTimelineParams
from .card_surcharge_details import CardSurchargeDetailsParams
from .device_details import DeviceDetailsParams
from .error import ErrorParams

Expand Down Expand Up @@ -106,3 +107,19 @@ class CardPaymentDetailsParams(typing_extensions.TypedDict):
"""
Information about errors encountered during the request.
"""

applied_card_surcharge_details: typing_extensions.NotRequired[CardSurchargeDetailsParams]
"""
Additional information about a card_surcharge on the payment.
"""

wallet_type: typing_extensions.NotRequired[str]
"""
The type of digital wallet used for this card payment, if applicable.
Currently only populated for in-person Apple Pay payments. Detection has no false
positives but may have false negatives (some Apple Pay payments may not be detected).

For payments with `source_type` of `WALLET`, see `DigitalWalletDetails` instead.

Values: `APPLE_PAY`
"""
26 changes: 26 additions & 0 deletions src/square/requests/card_surcharge_details.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This file was auto-generated by Fern from our API Definition.

import typing_extensions
from .money import MoneyParams


class CardSurchargeDetailsParams(typing_extensions.TypedDict):
"""
Details related to an attempt to apply a card surcharge to this payment. When surcharge
eligibility is not known in advance, such as when the card type (debit or credit) is required
to make the eligibility determination, proposed_card_surcharge_money and
proposed_additional_amount_money will match the values in the request, while card_surcharge_money
and additional_amount_money are present only when the payment has a surcharge applied.
"""

card_surcharge_money: typing_extensions.NotRequired[MoneyParams]
"""
A specific surcharge levied by the merchant, if a card payment is used, instead of cash or
some other payment type. Should only include the base surcharge amount. Any additional fees related
to the surcharge (e.g. taxes on the surcharge) should only be included in the additional_amount_money.
This amount is specified in the smallest denomination of the applicable currency (for example,
US dollar amounts are specified in cents). For more information, see
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).
The currency code must match the currency associated with the business that is accepting the
payment.
"""
Loading
Loading