Module: PaypalAPI::CatalogProducts::APIs

Included in:
PaypalAPI::CatalogProducts, PaypalAPI::CatalogProducts
Defined in:
lib/paypal-api/api_collections/catalog_products.rb

Overview

Common methods for PaypalAPI::CatalogProducts class and client.catalog_products instance

Instance Method Summary collapse

Instance Method Details

#create(query: nil, body: nil, headers: nil) ⇒ Response

Create product

Parameters:

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



27
28
29
# File 'lib/paypal-api/api_collections/catalog_products.rb', line 27

def create(query: nil, body: nil, headers: nil)
  client.post("/v1/catalogs/products", query: query, body: body, headers: headers)
end

#list(query: nil, body: nil, headers: nil) ⇒ Response

List products

Parameters:

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



38
39
40
# File 'lib/paypal-api/api_collections/catalog_products.rb', line 38

def list(query: nil, body: nil, headers: nil)
  client.get("/v1/catalogs/products", query: query, body: body, headers: headers)
end

#show(product_id, query: nil, body: nil, headers: nil) ⇒ Response

Show product details

Parameters:

  • product_id (String)

    Product ID

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



50
51
52
# File 'lib/paypal-api/api_collections/catalog_products.rb', line 50

def show(product_id, query: nil, body: nil, headers: nil)
  client.get("/v1/catalogs/products/#{encode(product_id)}", query: query, body: body, headers: headers)
end

#update(product_id, query: nil, body: nil, headers: nil) ⇒ Response

Update product

Parameters:

  • product_id (String)

    Product ID

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



62
63
64
# File 'lib/paypal-api/api_collections/catalog_products.rb', line 62

def update(product_id, query: nil, body: nil, headers: nil)
  client.patch("/v1/catalogs/products/#{encode(product_id)}", query: query, body: body, headers: headers)
end