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

1

8

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?

Ferretti answered 10/1, 2020 at 11:49 Comment(0)
T
9

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.

Threaten answered 10/1, 2020 at 20:25 Comment(1)
Agreed to some extent -- but when you've literally just created a product in error, it would be useful to be able to delete it straight afterwards. The web interface is clunky and I accidentally created a billing plan as a product, and now I can't remove or even rename it.Metalline

© 2022 - 2024 — McMap. All rights reserved.