-
Notifications
You must be signed in to change notification settings - Fork 17
Description
I see from the git history (and from the forks of this project) that there is some confusion about the Invoices stream.
from streams.py
class Invoices(Stream):
name = "invoices"
replication_method = "INCREMENTAL"
# replication_key = "updated_at"
replication_key = "due_date"
# API endpoint filters only on `due_date`.We can see that the replication key has due_date and had been updated_at. There was a back and forth on this line in the commits.
The fact is there are actually two very different Invoice objects in Chargify:
- Legacy invoices (instances prior to Jan 2018)
https://reference.chargify.com/v1/invoices-legacy/invoices - Relationship Invoices (instances after Jan 2018)
https://reference.chargify.com/v1/relationship-invoicing/relationship-invoicing-intro
Legacy Invoices have a updated_at property
Relationship Invoices have a due_date property
Both of them have a completely different structure and are unrelated. The most confusing part is that they have the same endpoint in Chargify API: /invoices/
You'll get one or the other depending on the instance you have.
I will open a PR to fix this issue. Unfortunately, I only have instances with Legacy Invoices so I can only test this. But I will provide a scafolder for the new Relationship Invoices.