# Refunds [API Reference](https://docs.credyt.ai/api/customer-wallet-ops-create-adjustment.md) Refunds are not currently supported directly within Credyt. If you need to issue refunds, you must do so directly with your payment provider (your PSP or Stripe, if you use Credyt’s built-in payments). You can then use the Wallet Adjustments API to adjust the customer’s balance within Credyt. ## Refunds with an External PSP[​](#refunds-with-an-external-psp "Direct link to Refunds with an External PSP") If you use your own PSP for payment processing: 1. Initiate the refund through your PSP’s dashboard or API. 2. Notify Credyt of the refunded amount using the Adjustments API. Use a unique `transaction_id` and specify `reason: "external_refund"`. ### Example[​](#example "Direct link to Example") This subtracts $20 from the customer’s fiat account balance. * REST API * TypeScript SDK * Python SDK POST https\://api.credyt.ai/customers/cust\_473cr1y0ghbyc3m1yfbwvn3nxx/wallet/adjustments ```json { "transaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "account_name": "default", "asset": "USD", "amount": -20, "description": "Technical failure", "reason": "external_refund", "expires_at": "2024-07-29T15:51:28.071Z" } ``` **Response** ```json { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "created_at": "2024-07-29T15:51:28.071Z" } ``` ```typescript await client.customerWalletOps.createAdjustment("cust_473cr1y0ghbyc3m1yfbwvn3nxx", { transactionId: "3fa85f64-5717-4562-b3fc-2c963f66afa6", accountName: "default", asset: "USD", amount: -20, description: "Technical failure", reason: "external_refund", expiresAt: "2024-07-29T15:51:28.071Z", }); ``` [View full sample on GitHub](https://github.com/credyt/sdk-ts/blob/main/samples/walletsCustomerWalletOpsCreateAdjustmentSample.ts#L158) **SDK response object** ```typescript const response = { id: "3fa85f64-5717-4562-b3fc-2c963f66afa6", createdAt: "2024-07-29T15:51:28.071Z", }; ``` ```python response = client.customer_wallet_ops.create_adjustment( customer_id="cust_473cr1y0ghbyc3m1yfbwvn3nxx", body={ "transaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "account_name": "default", "asset": "USD", "amount": -20, "description": "Technical failure", "reason": "external_refund", "expires_at": "2024-07-29T15:51:28.071Z", }, ) ``` **SDK response object** ```python response = { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "created_at": "2024-07-29T15:51:28.071Z", } ``` ## Refunds with Credyt Payments[​](#refunds-with-credyt-payments "Direct link to Refunds with Credyt Payments") If you use Credyt’s built-in payments processing (via Stripe): 1. Initiate the refund in the Stripe Dashboard. Stripe handles payment reversal, receipts, and settlement. 2. Notify Credyt of the refund through the Adjustments API, so the customer’s balance is updated. ### Example[​](#example-1 "Direct link to Example") This subtracts $20 from the customer’s fiat account balance. * REST API * TypeScript SDK * Python SDK POST https\://api.credyt.ai/customers/cust\_473cr1y0ghbyc3m1yfbwvn3nxx/wallet/adjustments ```json { "transaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "account_name": "default", "asset": "USD", "amount": -20, "description": "Technical failure", "reason": "external_refund", "expires_at": "2024-07-29T15:51:28.071Z" } ``` **Response** ```json { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "created_at": "2024-07-29T15:51:28.071Z" } ``` ```typescript await client.customerWalletOps.createAdjustment("cust_473cr1y0ghbyc3m1yfbwvn3nxx", { transactionId: "3fa85f64-5717-4562-b3fc-2c963f66afa6", accountName: "default", asset: "USD", amount: -20, description: "Technical failure", reason: "external_refund", expiresAt: "2024-07-29T15:51:28.071Z", }); ``` [View full sample on GitHub](https://github.com/credyt/sdk-ts/blob/main/samples/walletsCustomerWalletOpsCreateAdjustmentSample.ts#L158) **SDK response object** ```typescript const response = { id: "3fa85f64-5717-4562-b3fc-2c963f66afa6", createdAt: "2024-07-29T15:51:28.071Z", }; ``` ```python response = client.customer_wallet_ops.create_adjustment( customer_id="cust_473cr1y0ghbyc3m1yfbwvn3nxx", body={ "transaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "account_name": "default", "asset": "USD", "amount": -20, "description": "Technical failure", "reason": "external_refund", "expires_at": "2024-07-29T15:51:28.071Z", }, ) ``` **SDK response object** ```python response = { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "created_at": "2024-07-29T15:51:28.071Z", } ``` ## Best Practices[​](#best-practices "Direct link to Best Practices") * Always send refunds as a negative adjustment with `reason: "external_refund"`. * Use a unique identifier for `transaction_id` that ties the refund to the original payment. The Adjustments API supports metadata, which you can use to attach identifiers or other relevant information to make reconciliation and traceability easier. * Keep refund amounts and currencies consistent with the original payment to avoid reconciliation issues.