1 mins read

Store your data on Omise with the Metadata API

Omise

One of our long-standing feature requests has been an ability to attach customer-specific metadata such as order ID or tracking number to a Charge object. This surprisingly small feature has a number of uses, for example:

  • Attach an Order ID to each payment for cross-referencing later.
  • Add shipment or product variation information directly into the Charge object and use our dashboard as an ad-hoc order tracking system.
  • Provide more information to your financial team so they don't have to wait for your fulfillment team.

Previously we have been advising our merchants to put custom JSON into the description field as a work around. And we have noticed a large number of merchants utilizing this approach.

Today you no longer have to resort to that workaround anymore as we are updating our Charge and Customer API with a new metadata key which you can add any free-form JSON to. The only restriction is that the top-level object be a JSON hash.

Example for PHP:

<?php

$charge = OmiseCharge::create(array(
    'description' => 'Payment for Order #3947',
    'currency' => 'thb',
    'amount' => 10000,
    'card' => 'tokn_test_58307zpezucfvb6u1ty',
    'metadata' => array(
        'order_id' => '3947'
    )
));

Example JSON response:

{
  "object": "charge",
  "description": "Payment for Order #3947",
  "metadata": {
    "order_id": "3947"
  },
  "...": "..."
}

If this has helped simplify your application or you came up with a use case that we have not thought about, or even for bug reports please forward them to support@omise.co and let us know!

More from us

7 mins read

How PayNow improves payment experiences

3 mins read

Why PayNow matters

Subscribe to receive the latest updates from Omise
Thank you!

You are subscribed.

Omise uses cookies to improve your overall site experience and collect information on your visits and browsing behavior. By continuing to browse our website, you agree to our Privacy Policy. Learn more