Skip to content

Conversation

@jkachel
Copy link
Contributor

@jkachel jkachel commented Dec 15, 2025

What are the relevant tickets?

mitodl/hq#9391

Description (What does it do?)

#3137 got the baskets API in place. This continues along that path and gets the discount and product APIs in place too.

These are the APIs that were already in the system - the MITx Online ones were more complete in this case (and contained a lot of baked in knowledge that we explicitly stripped out for UE). In a handful of cases, I did refactor a few things to make them work better for OpenAPI spec generation, but these should otherwise work the same as they had.

How can this be tested?

Automated tests should pass.

You should be able to use the Swagger UI to see the APIs, and do some querying against them. Some API endpoints will require you to be logged in as an administrator - especially ones that modify discount details. (These were added for the staff dashboard interface.)

As noted in the #3137 PR, there's nothing that would use these APIs quite yet so testing this in-situ isn't really possible. (But you may be able to hack up the existing frontends to hit /api/v0 and they should probably work OK.)

Additional Context

A lot of these APIs included a customized pagination class that worked specifically with Refine. These now use the base LimitOffsetPagination class for consistency with our other APIs. (We don't use Refine elsewhere.)

A lot of the admin-only APIs also included TokenAuthentication. This has been stripped out as well; we don't really need this. I also made the permission classes just IsAdminUser for these. This applies mostly to discount detail APIs - we don't need to expose information about (say) what users are attached to the discount to end users, even if they are logged in.

@github-actions
Copy link

github-actions bot commented Dec 15, 2025

OpenAPI Changes

Show/hide ## Changes for v0.yaml:
## Changes for v0.yaml:
54 changes: 6 error, 1 warning, 47 info
error	[api-path-removed-without-deprecation] at base/openapi/specs/v0.yaml	
	in API GET /api/v0/basketitems/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v0.yaml	
	in API POST /api/v0/basketitems/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v0.yaml	
	in API DELETE /api/v0/basketitems/{id}/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v0.yaml	
	in API GET /api/v0/basketitems/{id}/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v0.yaml	
	in API PATCH /api/v0/basketitems/{id}/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v0.yaml	
	in API PUT /api/v0/basketitems/{id}/
		api path removed without deprecation

warning	[request-parameter-removed] at head/openapi/specs/v0.yaml	
	in API POST /api/v0/baskets/add_discount/
		deleted the 'path' request parameter 'system_slug'
		This is a warning because some apps may return an error when receiving a parameter that they do not expect. It is recommended to deprecate the parameter first.

info	[api-schema-removed] 	
	in components/schemas
		removed the schema 'BasketItemRequest'

info	[api-schema-removed] 	
	in components/schemas
		removed the schema 'PatchedBasketItemRequest'

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/baskets/{parent_lookup_basket}/items/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API POST /api/v0/baskets/{parent_lookup_basket}/items/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API DELETE /api/v0/baskets/{parent_lookup_basket}/items/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/baskets/{parent_lookup_basket}/items/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API PATCH /api/v0/baskets/{parent_lookup_basket}/items/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API PUT /api/v0/baskets/{parent_lookup_basket}/items/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/discounts/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API POST /api/v0/discounts/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API POST /api/v0/discounts/create_batch/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API DELETE /api/v0/discounts/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/discounts/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API PATCH /api/v0/discounts/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API PUT /api/v0/discounts/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/assignees/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API POST /api/v0/discounts/{parent_lookup_discount}/assignees/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API DELETE /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API PATCH /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API PUT /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/products/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API POST /api/v0/discounts/{parent_lookup_discount}/products/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API DELETE /api/v0/discounts/{parent_lookup_discount}/products/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/products/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API PATCH /api/v0/discounts/{parent_lookup_discount}/products/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API PUT /api/v0/discounts/{parent_lookup_discount}/products/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/tiers/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API POST /api/v0/discounts/{parent_lookup_discount}/tiers/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API DELETE /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API PATCH /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API PUT /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API POST /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API DELETE /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API PATCH /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API PUT /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/products/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/products/all/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API POST /api/v0/products/all/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API DELETE /api/v0/products/all/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/products/all/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API PATCH /api/v0/products/all/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API PUT /api/v0/products/all/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v0/products/{id}/
		endpoint added



## Changes for v1.yaml:
54 changes: 6 error, 1 warning, 47 info
error	[api-path-removed-without-deprecation] at base/openapi/specs/v1.yaml	
	in API GET /api/v0/basketitems/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v1.yaml	
	in API POST /api/v0/basketitems/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v1.yaml	
	in API DELETE /api/v0/basketitems/{id}/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v1.yaml	
	in API GET /api/v0/basketitems/{id}/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v1.yaml	
	in API PATCH /api/v0/basketitems/{id}/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v1.yaml	
	in API PUT /api/v0/basketitems/{id}/
		api path removed without deprecation

warning	[request-parameter-removed] at head/openapi/specs/v1.yaml	
	in API POST /api/v0/baskets/add_discount/
		deleted the 'path' request parameter 'system_slug'
		This is a warning because some apps may return an error when receiving a parameter that they do not expect. It is recommended to deprecate the parameter first.

info	[api-schema-removed] 	
	in components/schemas
		removed the schema 'BasketItemRequest'

info	[api-schema-removed] 	
	in components/schemas
		removed the schema 'PatchedBasketItemRequest'

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/baskets/{parent_lookup_basket}/items/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API POST /api/v0/baskets/{parent_lookup_basket}/items/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API DELETE /api/v0/baskets/{parent_lookup_basket}/items/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/baskets/{parent_lookup_basket}/items/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API PATCH /api/v0/baskets/{parent_lookup_basket}/items/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API PUT /api/v0/baskets/{parent_lookup_basket}/items/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/discounts/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API POST /api/v0/discounts/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API POST /api/v0/discounts/create_batch/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API DELETE /api/v0/discounts/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/discounts/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API PATCH /api/v0/discounts/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API PUT /api/v0/discounts/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/assignees/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API POST /api/v0/discounts/{parent_lookup_discount}/assignees/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API DELETE /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API PATCH /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API PUT /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/products/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API POST /api/v0/discounts/{parent_lookup_discount}/products/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API DELETE /api/v0/discounts/{parent_lookup_discount}/products/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/products/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API PATCH /api/v0/discounts/{parent_lookup_discount}/products/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API PUT /api/v0/discounts/{parent_lookup_discount}/products/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/tiers/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API POST /api/v0/discounts/{parent_lookup_discount}/tiers/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API DELETE /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API PATCH /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API PUT /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API POST /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API DELETE /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API PATCH /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API PUT /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/products/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/products/all/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API POST /api/v0/products/all/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API DELETE /api/v0/products/all/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/products/all/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API PATCH /api/v0/products/all/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API PUT /api/v0/products/all/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v0/products/{id}/
		endpoint added



## Changes for v2.yaml:
54 changes: 6 error, 1 warning, 47 info
error	[api-path-removed-without-deprecation] at base/openapi/specs/v2.yaml	
	in API GET /api/v0/basketitems/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v2.yaml	
	in API POST /api/v0/basketitems/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v2.yaml	
	in API DELETE /api/v0/basketitems/{id}/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v2.yaml	
	in API GET /api/v0/basketitems/{id}/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v2.yaml	
	in API PATCH /api/v0/basketitems/{id}/
		api path removed without deprecation

error	[api-path-removed-without-deprecation] at base/openapi/specs/v2.yaml	
	in API PUT /api/v0/basketitems/{id}/
		api path removed without deprecation

warning	[request-parameter-removed] at head/openapi/specs/v2.yaml	
	in API POST /api/v0/baskets/add_discount/
		deleted the 'path' request parameter 'system_slug'
		This is a warning because some apps may return an error when receiving a parameter that they do not expect. It is recommended to deprecate the parameter first.

info	[api-schema-removed] 	
	in components/schemas
		removed the schema 'BasketItemRequest'

info	[api-schema-removed] 	
	in components/schemas
		removed the schema 'PatchedBasketItemRequest'

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/baskets/{parent_lookup_basket}/items/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API POST /api/v0/baskets/{parent_lookup_basket}/items/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API DELETE /api/v0/baskets/{parent_lookup_basket}/items/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/baskets/{parent_lookup_basket}/items/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API PATCH /api/v0/baskets/{parent_lookup_basket}/items/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API PUT /api/v0/baskets/{parent_lookup_basket}/items/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/discounts/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API POST /api/v0/discounts/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API POST /api/v0/discounts/create_batch/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API DELETE /api/v0/discounts/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/discounts/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API PATCH /api/v0/discounts/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API PUT /api/v0/discounts/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/assignees/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API POST /api/v0/discounts/{parent_lookup_discount}/assignees/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API DELETE /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API PATCH /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API PUT /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/products/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API POST /api/v0/discounts/{parent_lookup_discount}/products/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API DELETE /api/v0/discounts/{parent_lookup_discount}/products/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/products/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API PATCH /api/v0/discounts/{parent_lookup_discount}/products/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API PUT /api/v0/discounts/{parent_lookup_discount}/products/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/tiers/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API POST /api/v0/discounts/{parent_lookup_discount}/tiers/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API DELETE /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API PATCH /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API PUT /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API POST /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API DELETE /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API PATCH /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API PUT /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/products/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/products/all/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API POST /api/v0/products/all/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API DELETE /api/v0/products/all/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/products/all/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API PATCH /api/v0/products/all/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API PUT /api/v0/products/all/{id}/
		endpoint added

info	[endpoint-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v0/products/{id}/
		endpoint added



Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

@jkachel jkachel marked this pull request as ready for review December 18, 2025 22:24
@annagav
Copy link
Contributor

annagav commented Dec 19, 2025

@jkachel the tests are failing, I think you just need to rebase the PR.

@annagav annagav self-requested a review December 19, 2025 19:51
@jkachel jkachel force-pushed the jkachel/9391-pt-2-add-products-api branch from 24011f1 to f5b175c Compare December 19, 2025 20:26
@jkachel
Copy link
Contributor Author

jkachel commented Dec 19, 2025

@annagav rebased to get the API changes from main. The OpenAPI check will still fail but it's failing now because of the changes in this PR, not because there's other stuff missing.

This is a reworking of this branch since it was based off of another branch.
…h of discount and product view tests over, regenerated spec, adjusted URL routing somewhat

This breaks the OpenAPI spec technically - the PR that merged in the basket APIs was only done a couple days ago though. But things were kinda wonky - the basket items API was separate from the basket API, so fixed that so it's now nested under baskets; some of the names were weird so fixed those as well; and fixed some issues with tests (for some reason we were allowing username-based lookup for basket info?).

I also eliminated hard-coded paths in the v0 views tests; probably got a bit annoyed trying to figure out what the route names were for these APIs initially but now that everything is more fixed up it's more straightforward.

Some of the migrated tests are tests for the checkout APIs, which isn't migrated yet. Leaving them in though because that's probably next on the list anyway.
@jkachel jkachel force-pushed the jkachel/9391-pt-2-add-products-api branch from f5b175c to 805660b Compare January 6, 2026 18:57
@jkachel jkachel merged commit 910958c into main Jan 6, 2026
8 of 9 checks passed
@jkachel jkachel deleted the jkachel/9391-pt-2-add-products-api branch January 6, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants