Superface

Get Information About Products

payments/read-products@1.0.0
2 providers

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

Below instructions are for our Node.js SDK. Use OneService for other languages.
npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

// You can manage tokens here: https://superface.ai/insights
const sdk = new SuperfaceClient({ sdkAuthToken: '<< Login to get your token >>' });

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