Chunk ledger sync by 30 days (Etsy caps window at 31)
The ledger-entries endpoint rejects ranges over 2678400s (31 days) with a 400. Reduce the chunk window from 90 to 30 days. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
03979a9b48
commit
7a626257cd
1 changed files with 2 additions and 1 deletions
|
|
@ -376,7 +376,8 @@ export const syncLedgerEntries = async (
|
|||
unknownDebits: [],
|
||||
};
|
||||
|
||||
const windowSeconds = 90 * 24 * 60 * 60;
|
||||
// Etsy caps the ledger query window at 31 days (2678400s); use 30 to be safe
|
||||
const windowSeconds = 30 * 24 * 60 * 60;
|
||||
const nowSec = Math.floor(Date.now() / 1000);
|
||||
let windowStart = Math.floor(startDate.getTime() / 1000);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue