const response = await fetch("https://algapsa.com/api/v1/invoices/generate", {
method: "POST",
headers: {
"X-API-Key": "$ALGA_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"selector_input": {
"clientId": "01HN2K7VRB9PQ3Y0000000000",
"windowStart": "string",
"windowEnd": "string",
"executionWindow": {
"kind": "client_cadence_window",
"identityKey": "string",
"cadenceOwner": "client",
"clientId": "01HN2K7VRB9PQ3Y0000000000",
"billingCycleId": "01HN2K7VRB9PQ3Y0000000000",
"contractId": "01HN2K7VRB9PQ3Y0000000000",
"contractLineId": "01HN2K7VRB9PQ3Y0000000000",
"windowStart": "string",
"windowEnd": "string"
}
}
})
});
const data = await response.json();