Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove a PayPal product from v1/catalogs API?

I would like to remove a product from the catalogs, but I can't find any API method that do this, here is the documentation.

I know how to get all the products:

https://api.sandbox.paypal.com/v1/catalogs/products?page_size=10&page=1&total_required=true

This returns something like:

{
"products": [
    {
        "id": "PROD-8DN39312TB525331M",
        "name": "Video Streaming Service",
        "description": "Video streaming service",
        "create_time": "2020-01-07T18:50:01Z",
        "links": [
            {
                "href": "https://api.sandbox.paypal.com/v1/catalogs/products/PROD-8DN39312TB525331M",
                "rel": "self",
                "method": "GET"
            }
        ]
    },
   ...

Is there an actual way to remove a product?

like image 738
sfarzoso Avatar asked Jan 10 '20 11:01

sfarzoso


1 Answers

Funnily enough, no -- I found several past discussions (for example) and it seems this was never implemented.

Edit: Thinking of why it wasn't implemented, consider that products are just used for subscription plans, which can persist for a long period of time, and there needs to be some record of those even after subscriptions are over. So the functionality of "deleting" a product is less useful than it would seem, since PayPal needs to persist a unique record of them in its database anyway. You wouldn't really be deleting one, you'd be marking it as inactive or "don't return me this record on the list of available products anymore". And well that's not exactly useful enough to create an API operation for.


If you need a new name, the best you can do is edit/patch the Product with a description that says it's obsolete/deprecated/not-to-be-used, so you know to use whichever other replacement you create.

like image 184
Preston PHX Avatar answered Nov 15 '22 08:11

Preston PHX