Get Information About Products

payments/read-products@1.0.0
Supported by 2 providers
P
S

List Products

Lists existing products in a payment system.

Result
Product ID
Name
Description
Product type

1.Choose a provider

2.Use ListProducts with mock in your code

npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

const sdk = new SuperfaceClient();

async function run() {
  // Load the profile
  const profile = await sdk.getProfile('payments/read-products@1.0.0');

  // Use the profile
  const result = await profile
    .getUseCase('ListProducts')
    .perform({}, {
      provider: 'mock'
    });

  // Handle the result
  try {
    const data = result.unwrap();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

run();

Structure details

Result (list of objects)

productId
Unique identifier of the product the plan is for (if applicable).
name
Name of the product.
description
Description of the product.
type
Indicates whether the product is physical or intangible (e.g. a service, or digital goods). Possible values: - `physical` - `digital` - `service`

Example

[
  {
    "productId": "PROD-123908",
    "name": "Superface milk",
    "description": "Milk that gives you super-powers, delivered to your door.",
    "type": "physical"
  }
]

Implementation details

Provider
mock
Use case
ListProducts
Author
@superface
Source
Verified