This documentation site is deprecated. The latest up-to-date API reference is available at https://reference.chargify.com.
This site will remain available for historical reference until June 1, 2017

API: Refunds - External

External Refunds

Use this endpoint to record refunds done outside of Chargify, such as directly at the gateway or by sending a check to the subscriber.

  • amount The amount represented as a string with two decimal places, for example 14.50.
  • amount_in_cents The amount represented as a string in cents. For example if the refund was for $14.50, you would pass 1450
  • memo A description of why the refund occured

Note that external refunds will reduce revenue, but they do not affect the balance due for the subscription.

Methods

format may be either ‘xml’ or ‘json’.

Create

URL: https://<subdomain>.chargify.com/subscriptions/<subscription_id>/refunds.<format>
Method: POST
Required Parameters: XML or JSON data, as specified by the input attributes
Response: The created payment

Here is a sample JSON document that you might POST to https://<subdomain>.chargify.com/subscriptions/<subscription_id>/refunds.json


{
  "refund": {
    "amount": 20.00,
    "memo": "Refunded with check# 123"
  },
  "external": 1
}

or if you wish to work in cents the amount_in_cents field can be used:


{
  "refund": {
    "amount_in_cents": 2000,
    "memo": "Processed refund directly at gateway"
  },
  "external": 1
}

Here is a sample JSON response for a successful external refund:


{
    "refund": {
        "amount_in_cents": 1243,
        "component_id": null,
        "created_at": "2015-06-30T05:17:37+12:00",
        "customer_id": 9062530,
        "ending_balance_in_cents": 0,
        "gateway_order_id": null,
        "gateway_transaction_id": null,
        "gateway_used": null,
        "id": 99763961,
        "kind": null,
        "memo": "External refund via API",
        "payment_id": null,
        "product_id": 3692598,
        "starting_balance_in_cents": 0,
        "statement_id": 54115214,
        "subscription_id": 9306224,
        "success": true,
        "tax_id": null,
        "transaction_type": "refund",
        "type": "Refund"
    }
}