{"service":"HALOWERK finopswerk","endpoint":"/v1/credit-grant-finalization-ledger","method":"POST","content_type":"application/json","inputSchema":{"type":"object","properties":{"grants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,15}$","minLength":1,"maxLength":16},"amount_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"currency":{"enum":["USD","EUR"]},"created":{"type":"integer","minimum":0,"maximum":1000000000},"effective_at":{"type":"integer","minimum":0,"maximum":1000000000},"expires_at":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"priority":{"type":"integer","minimum":0,"maximum":99},"promotional":{"type":"boolean"},"prices":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,15}$","minLength":1,"maxLength":16},"minItems":0,"maxItems":3}},"required":["id","amount_minor","currency","created","effective_at","expires_at","priority","promotional","prices"],"additionalProperties":false},"minItems":1,"maxItems":4},"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,15}$","minLength":1,"maxLength":16},"currency":{"enum":["USD","EUR"]},"period_end":{"type":"integer","minimum":0,"maximum":1000000000},"subscription":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"price":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,15}$","minLength":1,"maxLength":16},"kind":{"enum":["metered","licensed","legacy","one_off"]},"amount_minor":{"type":"integer","minimum":0,"maximum":1000}},"required":["price","kind","amount_minor"],"additionalProperties":false},"minItems":1,"maxItems":3}},"required":["id","currency","period_end","subscription","lines"],"additionalProperties":false},"minItems":1,"maxItems":3},"events":{"type":"array","items":{"type":"object","properties":{"type":{"enum":["preview","finalize","void","credit_note"]},"invoice":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,15}$","minLength":1,"maxLength":16},"at":{"type":"integer","minimum":0,"maximum":1000000000}},"required":["type","invoice","at"],"additionalProperties":false},"minItems":1,"maxItems":6},"report":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"credited_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"uncovered_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"restored_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]}},"required":["credited_minor","uncovered_minor","restored_minor"],"additionalProperties":false},"minItems":1,"maxItems":6},"remaining_minor":{"type":"array","items":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"minItems":1,"maxItems":4}},"required":["events","remaining_minor"],"additionalProperties":false}},"required":["grants","invoices","events","report"],"additionalProperties":false},"requestExample":{"grants":[{"id":"promo","amount_minor":50,"currency":"USD","created":0,"effective_at":0,"expires_at":80,"priority":1,"promotional":true,"prices":["api"]},{"id":"paid","amount_minor":40,"currency":"USD","created":0,"effective_at":0,"expires_at":null,"priority":0,"promotional":false,"prices":[]}],"invoices":[{"id":"a","currency":"USD","period_end":20,"subscription":true,"lines":[{"price":"api","kind":"metered","amount_minor":30},{"price":"setup","kind":"licensed","amount_minor":20}]},{"id":"b","currency":"USD","period_end":25,"subscription":true,"lines":[{"price":"api","kind":"metered","amount_minor":45},{"price":"setup","kind":"licensed","amount_minor":20}]},{"id":"c","currency":"USD","period_end":50,"subscription":true,"lines":[{"price":"api","kind":"metered","amount_minor":60},{"price":"setup","kind":"licensed","amount_minor":20}]}],"events":[{"type":"finalize","invoice":"a","at":30},{"type":"preview","invoice":"b","at":35},{"type":"finalize","invoice":"b","at":40},{"type":"credit_note","invoice":"a","at":45},{"type":"void","invoice":"a","at":60},{"type":"finalize","invoice":"c","at":70}],"report":{"events":[{"credited_minor":30,"uncovered_minor":20,"restored_minor":0},{"credited_minor":45,"uncovered_minor":20,"restored_minor":0},{"credited_minor":45,"uncovered_minor":20,"restored_minor":0},{"credited_minor":0,"uncovered_minor":0,"restored_minor":0},{"credited_minor":0,"uncovered_minor":0,"restored_minor":30},{"credited_minor":45,"uncovered_minor":35,"restored_minor":0}],"remaining_minor":[0,0]}},"operations":[{"method":"POST","inputSchema":{"type":"object","properties":{"grants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,15}$","minLength":1,"maxLength":16},"amount_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"currency":{"enum":["USD","EUR"]},"created":{"type":"integer","minimum":0,"maximum":1000000000},"effective_at":{"type":"integer","minimum":0,"maximum":1000000000},"expires_at":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"priority":{"type":"integer","minimum":0,"maximum":99},"promotional":{"type":"boolean"},"prices":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,15}$","minLength":1,"maxLength":16},"minItems":0,"maxItems":3}},"required":["id","amount_minor","currency","created","effective_at","expires_at","priority","promotional","prices"],"additionalProperties":false},"minItems":1,"maxItems":4},"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,15}$","minLength":1,"maxLength":16},"currency":{"enum":["USD","EUR"]},"period_end":{"type":"integer","minimum":0,"maximum":1000000000},"subscription":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"price":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,15}$","minLength":1,"maxLength":16},"kind":{"enum":["metered","licensed","legacy","one_off"]},"amount_minor":{"type":"integer","minimum":0,"maximum":1000}},"required":["price","kind","amount_minor"],"additionalProperties":false},"minItems":1,"maxItems":3}},"required":["id","currency","period_end","subscription","lines"],"additionalProperties":false},"minItems":1,"maxItems":3},"events":{"type":"array","items":{"type":"object","properties":{"type":{"enum":["preview","finalize","void","credit_note"]},"invoice":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,15}$","minLength":1,"maxLength":16},"at":{"type":"integer","minimum":0,"maximum":1000000000}},"required":["type","invoice","at"],"additionalProperties":false},"minItems":1,"maxItems":6},"report":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"credited_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"uncovered_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"restored_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]}},"required":["credited_minor","uncovered_minor","restored_minor"],"additionalProperties":false},"minItems":1,"maxItems":6},"remaining_minor":{"type":"array","items":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"minItems":1,"maxItems":4}},"required":["events","remaining_minor"],"additionalProperties":false}},"required":["grants","invoices","events","report"],"additionalProperties":false},"requestExample":{"grants":[{"id":"promo","amount_minor":50,"currency":"USD","created":0,"effective_at":0,"expires_at":80,"priority":1,"promotional":true,"prices":["api"]},{"id":"paid","amount_minor":40,"currency":"USD","created":0,"effective_at":0,"expires_at":null,"priority":0,"promotional":false,"prices":[]}],"invoices":[{"id":"a","currency":"USD","period_end":20,"subscription":true,"lines":[{"price":"api","kind":"metered","amount_minor":30},{"price":"setup","kind":"licensed","amount_minor":20}]},{"id":"b","currency":"USD","period_end":25,"subscription":true,"lines":[{"price":"api","kind":"metered","amount_minor":45},{"price":"setup","kind":"licensed","amount_minor":20}]},{"id":"c","currency":"USD","period_end":50,"subscription":true,"lines":[{"price":"api","kind":"metered","amount_minor":60},{"price":"setup","kind":"licensed","amount_minor":20}]}],"events":[{"type":"finalize","invoice":"a","at":30},{"type":"preview","invoice":"b","at":35},{"type":"finalize","invoice":"b","at":40},{"type":"credit_note","invoice":"a","at":45},{"type":"void","invoice":"a","at":60},{"type":"finalize","invoice":"c","at":70}],"report":{"events":[{"credited_minor":30,"uncovered_minor":20,"restored_minor":0},{"credited_minor":45,"uncovered_minor":20,"restored_minor":0},{"credited_minor":45,"uncovered_minor":20,"restored_minor":0},{"credited_minor":0,"uncovered_minor":0,"restored_minor":0},{"credited_minor":0,"uncovered_minor":0,"restored_minor":30},{"credited_minor":45,"uncovered_minor":35,"restored_minor":0}],"remaining_minor":[0,0]}}}]}