Open excid3 opened 1 month ago
I remove relationships
and links
as they don't contain any useful information really.
An example of a product:
"relationships"=>
{"store"=>
{"links"=>
{"related"=>"https://api.lemonsqueezy.com/v1/products/166741/store",
"self"=>"https://api.lemonsqueezy.com/v1/products/166741/relationships/store"}},
"variants"=>
{"links"=>
{"related"=>"https://api.lemonsqueezy.com/v1/products/166741/variants",
"self"=>"https://api.lemonsqueezy.com/v1/products/166741/relationships/variants"}}},
"links"=>{"self"=>"https://api.lemonsqueezy.com/v1/products/166741"}}}
You can use that to generate the associations and connect them to the other models.
Currently, the API responses delete the association data.
For example, it would be helpful to be able to retrieve an Order and ask for it's associated subscriptions. Same for all the other associations.
If this is implemented using the JSON API data, this can be future proofed for any other associations added.