Closed dmke closed 4 years ago
You are right. Addon products are now included in product listings for consistency. The endpoint /products/{id}/addons
is also a good idea. It returns a list of products which will be added automatically for domains not included in the base product.
If you want to calculate the final price for a number of domains you should not try to add the base price of the product and the prices of all addons. In some cases it's a little more complex than that. I created a new /quotes
endpoint which returns the final price for the given certificate request. Use this endpoint to preview what an order would cost.
Thank you!
Problem
In order to sell multi-domain certificates for more than 3 domains, we need to know the prices for additional domains before we can even offer them to our customers.
Only when ordering a multi-domain certificate with 5 domains, we can inspect the following OrderItems:
Order items request/response (truncated)
(The BS20000191 order identifier might help you lookup the full order details in your test database. I'm omitting most of the details here.) ```http GET /v1/orders/BS20000191/items Host: test-api.psw-group.de ``` ```json5 { "@context": "/v1/contexts/Order", "@id": "/v1/orders", "@type": "hydra:Collection", "hydra:member": [{ "productName": "Lite Multidomain, 1 Jahr", "productNumber": "A000346", "description": "Domain: $commonname\nenthalten: $san1, $san2", "quantity": 1, // accounting values ommitted "certificate": { "@id": "/v1/certificates/C000198", "@type": "Certificate", "number": "C000198" // rest ommitted } }, { "productName": "Lite Multidomain, 1 Jahr, zusätzliche Domain/Subdomain/UC", "productNumber": "A000347", "description": "$san3, $san4", "quantity": 2, // accounting values ommitted "certificate": null }], "hydra:totalItems": 2, "hydra:search": { /* omitted */ } } ```Here, product A000346 is a Sectigo Lite multi-domain certificate, and A000347 is for an additional domain. The
/v1/products
endpoint only includes A000346 products, and/v1/products/A000347
yields a 404 Not Found error.I'm aware that these products cannot be ordered by themselves, but so is A001299 (which is included in the product listing).
Proposed solution
Include products like A000347 in the product listing.
This might necessitate a new endpoint like
/v1/products/{id}/addons
or similar.