Search code examples
recurly

Recurly: Detecting if an Invoices has non-subscription charges/adjustment


Is there a way to differentiate between a charge created programmatically vs a charge created by a renewing subscription vs a manual charge?

Programmatic way: https://dev.recurly.com/docs/create-a-charge-or-credit

Subscription way: a charge is automatically created by Recurly

Manual way: https://docs.recurly.com/docs/adjustments#section-charging-an-account


Solution

  • Probably the best way to differentiate between charge types would be to use a distinct accounting code for each type of charge. For example: a charge created programmatically: P-12345 a charge created by a renewing subscription: R-12345 a manual charge: M-12345

    Then for example with a list account's adjustments API call, loop through the returned data, filter by the accounting_code parameter for strings that contain an P, R or M, and return the details of the specific adjustment of interest.