Typescript
import { Polar } from "@polar-sh/sdk"; const polar = new Polar({ accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "", }); async function run() { const result = await polar.refunds.create({ orderId: "<value>", reason: "customer_request", amount: 90, }); console.log(result); } run();
{ "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 }
Create a refund.
Scopes: refunds:write
refunds:write
You can generate an Organization Access Token from your organization's settings.
Successful Response
The response is of type object.
object
Was this page helpful?