Skip to main content

Metadata Support Type

In the Pi Network, metadata support refers to an optional, arbitrary JavaScript Object passed within an API transaction. It allows third-party developers to embed custom data directly into a Pi payment flow. This data is used by the developer’s backend to track internal business logic without altering the blockchain's core structure.

Key Characteristics of Metadata Support

  • Data Type: It is formatted as a JSON Object (Object type).
  • No Blockchain Constraints: The Pi blockchain only verifies standard transaction data. Metadata is offloaded and stored by the Pi App Platform APIs rather than the ledger itself.
  • Developer Use Only: The Pi Network does not read or interpret this field. It is reserved exclusively to help developers map payments to internal records, user profiles, or specific product orders.

Implementation in Transactions

When developers build a payment system using the Pi Software Development Kit (SDK), they bundle the amount, a memo, and the metadata into a single payment argument.Here is an example of how the metadata field is structured in a payment request:

const body = {
amount: 50,
memo: "Purchase order #12345",
metadata: {
item_id: "sku-98765",
discount_applied: true
},
uid: userUid
};

Where to Use and Manage It

Developers can configure and access these payment parameters on the Pi App Platform:

  • Creating Payments: The Pi.createPayment() method accepts an object that contains the metadata payload.
  • Reading Payments: When validating transactions on the server using PaymentDTO, the metadata object is returned as part of the API response, making it easy to cross-reference.
  • Application Registration: App-specific setups and scopes are managed through the Pi Developer Portal.

Pi Node Context (For Developers)

PI System (Industrial Information Management)

Metadata support involves reading asset frameworks and meta queries. In this context, supported metadata and point types include Digital, Timestamp, Float64, Int32, and String.