Terraswitch
  • Terraswitch - Get Started
  • Test & Live Environments
  • Onboarding as a Business
  • GUIDES
    • 🎾Authentication
    • 🧀Webhooks
    • 🫓Status & Responses
    • 🏉API Rate Limits
    • 🚀Transactions & Destinations
    • 🍊Testing Credentials
    • 🚐Crafting Metadata
  • API ENDPOINTS
    • Account
      • Get Account Details
      • Get Banks
      • Get Beneficiaries
      • Add Bank
      • Change Settlement Bank
    • Wallet
      • Get Wallet Details
      • Get Wallet Transactions
    • Collections
      • Checkout
        • Initialize Transaction
      • Transfer
        • Generate Account
      • Charge
        • Create Charge
        • Authorize Charge
        • Charge Authorization
      • Bank
        • Pay with Opay
    • Payout
      • Bank Transfer
      • Withdraw Money
    • Products
      • List Products
      • Search Products
      • Filter Products
      • Fetch Product
      • Create Product
      • Update Product
    • Subaccounts
      • List Subaccounts
      • Search Subaccounts
      • Filter Subaccounts
      • Fetch Subaccount
      • Create Subaccount
      • Update Subaccount
    • Payment Links
      • List Payment Links
      • List Payment Link Transactions
      • Search Payment Links
      • Filter Payment Links
      • Fetch Payment Link
      • Create Payment Link
      • Update Payment Link
      • Attach Payment Resource
      • Remove Subaccount
      • Enable Payment Link
      • Disable Payment Link
    • Invoices
      • List Invoices
      • Search Invoices
      • Filter Invoices
      • Fetch Invoice
      • Create Invoice
      • Update Invoice
      • Remove Invoice Item
    • Transactions
      • List Transactions
      • Search Transactions
      • Filter Transactions
      • Verify Transaction
    • Refunds
      • List Refunds
      • Fetch Refund
      • Create Refund
    • Bills Payment
      • List Mobile Networks
      • List Bill Categories
      • List Bill Sub-Categories
      • List Mobile Data Plans
      • Validate Biller
      • Validate Bill Status
      • Validate Top-Up Status
      • Buy Airtime
      • Buy Data
      • Pay Bill
    • Resources
      • List Banks
      • List Countries
      • Resolve Bank Account
Powered by GitBook
On this page
  1. GUIDES

Crafting Metadata

With metadata, you can add additional parameters that an endpoint doesn't accept naturally on Terraswitch's API. Crafting metadata will depend on your language's handling of JSON and the intelligence behind how you process the properties.

The only way to add metadata is to add an array of objects called 'metadata' with its JSON structure of objects to an endpoint that accepts metadata

Structure of metadata objects

Metadata is an array of objects with a JSON structure. This structure can be constructive ( i.e. following Terraswitch's object structure) or dynamic. Dynamic structures mean you pass in your own defined objects; this should be an array of key/value pair objects. Constructive structure means you follow Terraswitch's defined structure.

Sample Dynamic Structure

[
   {
      "schoolName": "Grace Intl",
      "MatricNo": "110441"
   },
   {
      "orderId": "123456789",
      "vendor": "vendor@gmail.com"
   }
]

Constructive Structure

Constructive structures allow you to define "custom fields" that will be displayed on your Terraswitch dashboard and as well help you build flexible systems with additional information.

property
Datatype
Description

displayName

string

Specify the name you want to be displayed. E.g. "Order ID"

variableName

string

Specify the variable name. E.g. "orderId"

value

string

Specify the value of the variable. E.g. "1234567XDT"

Please note that each object in a metadata is in a key/value pair structure and they're expected to contain data. Should in case one of the three properties in displayName, variableName and value is not present, the system will not save the metadata object.

Sample Constructive Structure

[
    {
        "displayName": "Order ID",
        "variableName": "orderId",
        "value": "1234567XDT"
    },
    {
        "displayName": "Matric No",
        "variableName": "matricNumber",
        "value": "110441"
    }
]
PreviousTesting CredentialsNextAccount

Last updated 11 months ago

🚐