(refunds)
List products.
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:
res = polar.refunds.list()
while res is not None:
# Handle items
res = res.next()
Parameter | Type | Required | Description |
---|---|---|---|
id |
OptionalNullable[models.RefundIDFilter] | ➖ | Filter by refund ID. |
organization_id |
OptionalNullable[models.RefundsListQueryParamOrganizationIDFilter] | ➖ | Filter by organization ID. |
order_id |
OptionalNullable[models.OrderIDFilter] | ➖ | Filter by order ID. |
subscription_id |
OptionalNullable[models.SubscriptionIDFilter] | ➖ | Filter by subscription ID. |
customer_id |
OptionalNullable[models.RefundsListQueryParamCustomerIDFilter] | ➖ | Filter by customer ID. |
succeeded |
OptionalNullable[bool] | ➖ | Filter by succeeded . |
page |
Optional[int] | ➖ | Page number, defaults to 1. |
limit |
Optional[int] | ➖ | Size of a page, defaults to 10. Maximum is 100. |
sorting |
List[models.RefundSortProperty] | ➖ | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign - before the criteria name to sort by descending order. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Error Type | Status Code | Content Type |
---|---|---|
models.HTTPValidationError | 422 | application/json |
models.SDKError | 4XX, 5XX | */* |
Create a refund.
import polar_sdk
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:
res = polar.refunds.create(request={
"order_id": "<value>",
"reason": polar_sdk.RefundReason.CUSTOMER_REQUEST,
"amount": 638424,
})
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.RefundCreate | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Error Type | Status Code | Content Type |
---|---|---|
models.RefundAmountTooHigh | 400 | application/json |
models.RefundedAlready | 403 | application/json |
models.HTTPValidationError | 422 | application/json |
models.SDKError | 4XX, 5XX | */* |