When creating purchases, it's possible to store additional keys and values against each purchase. These values will be returned when querying the purchase in future, and are also visible via the Merchant Dashboard. Attaching metadata is done using the metadata key, as demonstrated below.

{
  "metadata": {
    "your_reference": "abcd1234",
    "something_else": 42
  }
}