Skip to content

v0.12.0 — commerce, read-only

Choose a tag to compare

@kurtseifried kurtseifried released this 28 Aug 22:58
· 16 commits to main since this release
3bd596b

Commerce — promo codes, pools, offers, training credits and purchases. All over Skilljar's v1 API, because v2 has no commerce surface at all.

  • list_promo_codes · list_promo_code_pools · list_offers · list_training_credit_codes · get_purchase

Read-only, by decision

Nothing here creates, changes or revokes anything. A promo code is money, a mistake is visible to customers, and the useful question is almost always "what exists and is it still valid" rather than "make more". A test asserts the module never grows a write tool.

These need the reporting or full capability profile — deliberately not parity, which mirrors Skilljar's official server, and that server has no commerce tools at all.

Built for scale, because this is where it bites

v1 defaults to 250 rows per page and will honour page_size=1000. The reference organization has 13,708 promo codes across 4,290 pools, so a tool that inherited that default would put thousands of rows into a conversation just to answer "are there any".

Instead: pages default to 25, anything above 250 is refused with a message pointing at total, and every listing reports v1's own count. "How many" and "does this code exist" are both answerable from one small page.

Two things worth knowing

The pool carries the discount, not the code. A promo-code row has only its own usage — use_count against max_uses, where a null max_uses means unlimited rather than none left. "How much is this code worth" is a question about the pool.

Purchases cannot be searched. v1 offers only get_purchase by id — no listing, no filter. The id has to come from a fulfillment webhook or an order reference held elsewhere.

94 tools, 1142 tests. Python 3.10–3.14, Apache-2.0.