Refunds service wrapping Stripe Refunds.
const refund = await stripe.refunds.create({ paymentIntentId: 'pi_123',}); Copy
const refund = await stripe.refunds.create({ paymentIntentId: 'pi_123',});
Create a refund.
Refund creation options
The created refund
When neither a payment nor charge is given
// Full refund of a paymentconst refund = await stripe.refunds.create({ paymentIntentId: 'pi_123' });// Partial refundconst partial = await stripe.refunds.create({ paymentIntentId: 'pi_123', amount: 500, reason: 'requested_by_customer',}); Copy
// Full refund of a paymentconst refund = await stripe.refunds.create({ paymentIntentId: 'pi_123' });// Partial refundconst partial = await stripe.refunds.create({ paymentIntentId: 'pi_123', amount: 500, reason: 'requested_by_customer',});
Retrieve a refund by ID.
Refund ID
The refund
const refund = await stripe.refunds.get('re_123'); Copy
const refund = await stripe.refunds.get('re_123');
List refunds with cursor-based pagination.
Optional
List options
Refunds and a cursor for the next page
const { data } = await stripe.refunds.list({ paymentIntentId: 'pi_123' }); Copy
const { data } = await stripe.refunds.list({ paymentIntentId: 'pi_123' });
Refunds service wrapping Stripe Refunds.
Example