Skip to content

Latest commit

 

History

History
104 lines (71 loc) · 10.9 KB

README.md

File metadata and controls

104 lines (71 loc) · 10.9 KB

Refunds

(refunds)

Overview

Available Operations

list

List products.

Example Usage

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()

Parameters

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.

Response

models.RefundsListResponse

Errors

Error Type Status Code Content Type
models.HTTPValidationError 422 application/json
models.SDKError 4XX, 5XX */*

create

Create a refund.

Example Usage

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)

Parameters

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.

Response

models.Refund

Errors

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 */*