API ReferenceapipaymentsPOST /v1/admin/refunds

POST /v1/admin/refunds

Service: payments · operationId: (none)

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "charge_id": {
      "type": "string",
      "minLength": 1
    },
    "amount_cents": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "full": {
      "type": "boolean"
    },
    "reason": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "charge_id"
  ]
}

Responses

201 Refund initiated

{
  "type": "object",
  "properties": {
    "refund_id": {
      "type": "string"
    },
    "payment_id": {
      "type": "string"
    },
    "charge_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "amount_cents": {
      "type": "integer"
    },
    "status": {
      "type": "string"
    },
    "stripe_refund_id": {
      "type": "string"
    }
  },
  "required": [
    "refund_id",
    "payment_id",
    "charge_id",
    "amount_cents",
    "status",
    "stripe_refund_id"
  ]
}

404 Charge or payment not found

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

409 Already refunded

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

412 Payment not succeeded

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

422 Validation error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://payments.platform.loop.health/v1/admin/refunds \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'