Refund a gift payment
Try itGives some or all of ONE card payment of a gift back to the donor's card, through your connected Stripe account (a monthly gift is refunded one month's charge at a time — payments[].id). Leave out amount_cents for everything still refundable. The answer says the refund was SENT; refunded_cents goes up only when Stripe's signed confirmation arrives, then the donor is emailed in the business's name and the payment leaves their yearly summary. Stopping a monthly gift is stop_monthly_donation.
/api/v1/sites/{site_id}/donations/{donation_id}/payments/{payment_id}/refundAuthentication
An API key as Authorization: Bearer or x-api-key. It needs the donations:write scope — stop monthly gifts and send the yearly giving summaries (donors are emailed).
Parameters
Named placeholders go in the path; the rest in a JSON body.
site_idstringPath · required- The site's id.1 to 100 characters
donation_idstringPath · required- The donation's id.1 to 100 characters
payment_idstringPath · required- The payment's id.1 to 100 characters
amount_centsintegerBody · optional- Leave out to refund everything still refundable.1 to 10000000
reasonstringBody · optional- Your own note; never sent to the donor.At most 300 characters
Response
200 with JSON on success (schema on the right). Errors use the standard envelope; a retry with the same Idempotency-Key gets the first answer back (how retries work).
curl -X POST 'https://websites.workflowcorp.com/api/v1/sites/SITE_ID/donations/DONATION_ID/payments/PAYMENT_ID/refund' \
-H "Authorization: Bearer $WEBSITEBUDDY_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'{
"site_id": "SITE_ID",
"donation_id": "DONATION_ID",
"payment_id": "PAYMENT_ID"
}{
"type": "object",
"properties": {
"refund_id": {
"type": "string"
},
"amount_cents": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"status": {
"type": "string",
"const": "sent",
"description": "Sent to Stripe; confirmed later by its webhook."
},
"donation": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"number": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "The site's gift number (#1, #2 …)."
},
"frequency": {
"type": "string",
"enum": [
"once",
"monthly"
]
},
"status": {
"type": "string",
"enum": [
"paid",
"active",
"canceled"
],
"description": "paid = a one-time gift received; active = a monthly gift still giving; canceled = a monthly gift stopped."
},
"amount_cents": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "The gift (each month's, for a monthly one)."
},
"currency": {
"type": "string"
},
"donor": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"email": {
"type": "string"
}
},
"required": [
"name",
"email"
],
"additionalProperties": false
},
"note": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"purpose": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "What the gift is for — the Donate section's “purpose” when it was given."
},
"page_path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"received_cents": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Money received for this gift so far."
},
"refunded_cents": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Of that, given back by card refund (refund_donation_payment, or in Stripe)."
},
"last_paid_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"canceled_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"created_at": {
"type": "string"
},
"payments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"amount_cents": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"refunded_cents": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Given back by card refund — confirmed by Stripe."
},
"paid_at": {
"type": "string"
}
},
"required": [
"id",
"amount_cents",
"refunded_cents",
"paid_at"
],
"additionalProperties": false
},
"description": "Each charge, oldest first."
},
"is_sample": {
"type": "boolean"
}
},
"required": [
"id",
"number",
"frequency",
"status",
"amount_cents",
"currency",
"donor",
"note",
"purpose",
"page_path",
"received_cents",
"refunded_cents",
"last_paid_at",
"canceled_at",
"created_at",
"payments",
"is_sample"
],
"additionalProperties": false
}
},
"required": [
"refund_id",
"amount_cents",
"status",
"donation"
],
"additionalProperties": false
}