General
Core API
- Checkout
- Checkout Links
- Custom Checkout Fields
- Customers
- Subscriptions
- Orders
- Discounts
- Refunds
- Products
- Events
- Meters
- Benefits
- Customer Meters
- License Keys
- Files
- Organizations
- Metrics
Customer Portal API
- GETGet Customer
- GETGet Organization
- Sessions
- Subscriptions
- Orders
- License Keys
- File Downloads
Webhook Events
- Customer Events
- Billing Events
- Organization Events
Integrations
- OpenID Connect
- OAuth 2.0 Clients
- Webhooks
Refunds
Create Refund
Create a refund.
Scopes: refunds:write
POST
/
v1
/
refunds
/
Copy
Ask AI
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": 90,
})
assert res is not None
# Handle response
print(res)
Copy
Ask AI
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"metadata": {},
"status": "pending",
"reason": "duplicate",
"amount": 123,
"tax_amount": 123,
"currency": "<string>",
"organization_id": "<string>",
"order_id": "<string>",
"subscription_id": "<string>",
"customer_id": "<string>",
"revoke_benefits": true
}
Authorizations
You can generate an Organization Access Token from your organization's settings.
Body
application/json
Response
200
application/json
Successful Response
The response is of type object
.
Was this page helpful?
Copy
Ask AI
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": 90,
})
assert res is not None
# Handle response
print(res)
Copy
Ask AI
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"metadata": {},
"status": "pending",
"reason": "duplicate",
"amount": 123,
"tax_amount": 123,
"currency": "<string>",
"organization_id": "<string>",
"order_id": "<string>",
"subscription_id": "<string>",
"customer_id": "<string>",
"revoke_benefits": true
}
Assistant
Responses are generated using AI and may contain mistakes.