subscriptions

Subscriptions Product Management

List products

To filter the products that the call returns, you can include one or more query parameters:

  • page. A non-zero integer index of the merchant's list of products. Default is 1.
  • page_size. The number of products to retrieve, beginning with the specified page. Default is 10.
  • total_required. Returns the total number of items and pages in the response. Default is false.

This sample request lists the merchant's products:

curl -v -X GET https://api.sandbox.paypal.com/v1/catalogs/products?page_size=2&page=1&total_required=true \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer Access-Token"

A successful request returns the HTTP 200 OK status code and a JSON response body:

{
  "total_items": 20,
  "total_pages": 10,
  "products": [
    {
      "id": "72255d4849af8ed6e0df1173",
      "name": "Video Streaming Service",
      "description": "Video streaming service",
      "links": [
        {
          "href": "https://api.paypal.com/v1/catalogs/products/72255d4849af8ed6e0df1173",
          "rel": "self",
          "method": "GET"
        }
      ]
    },
    {
      "id": "PROD-XYAB12ABSB7868434",
      "name": "Video Streaming Service",
      "description": "Video streaming service",
      "links": [
        {
          "href": "https://api.paypal.com/v1/catalogs/products/125d4849af8ed6e0df18",
          "rel": "self",
          "method": "GET"
        }
      ]
    }
  ],
  "links": [
    {
      "href": "https://api.paypal.com/v1/catalogs/products?page_size=2&page=1",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.paypal.com/v1/catalogs/products?page_size=2&page=2",
      "rel": "next",
      "method": "GET"
    },
    {
      "href": "https://api.paypal.com/v1/catalogs/products?page_size=2&page=10",
      "rel": "last",
      "method": "GET"
    }
  ]
}

Show product details

This sample request shows the details for a product:

curl -v -X GET https://api.sandbox.paypal.com/v1/catalogs/products/72255d4849af8ed6e0df1173 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer Access-Token"

A successful request returns the HTTP 200 OK status code and a JSON response body:

{
  "id": "72255d4849af8ed6e0df1173",
  "name": "Video Streaming Service",
  "description": "Video streaming service",
  "type": "SERVICE",
  "category": "SOFTWARE",
  "image_url": "https://example.com/streaming.jpg",
  "home_url": "https://example.com/home",
  "create_time": "2018-12-10T21:20:49Z",
  "update_time": "2018-12-10T21:20:49Z",
  "links": [
    {
      "href": "https://api.paypal.com/v1/catalogs/products/72255d4849af8ed6e0df1173",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.paypal.com/v1/catalogs/products/72255d4849af8ed6e0df1173",
      "rel": "edit",
      "method": "PATCH"
    }
  ]
}        

Update product details

This sample request updates a product:

curl -v -X PATCH https://api.sandbox.paypal.com/v1/catalogs/products/72255d4849af8ed6e0df1173 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer Access-Token" \
-d '[
  {
    "op": "replace",
    "path": "/description",
    "value": "Premium video streaming service"
  }
]'

You can update the following fields:

  • description
  • category
  • image_url
  • home_url

A successful request returns the HTTP 204 No Content status code with no JSON response body.

A successful product update triggers the CATALOG.PRODUCT.UPDATED webhook.

Feedback