Created with Sketch.
Created with Sketch.
Checkout 2.0

Attaching Custom Data

It is possible to attach custom data to any purchase. The data attached to a purchase gets persisted. It can also be updated and read back.

How Does It Work

  1. When initializing a new purchase (see InitializePayment), you can append any string that gets paired with the purchase and persisted.
  2. Any time you call UpdateItems, the last version the attachment call gets overwritten by the new one. If you do not define any attachment, the last one (if it exists) gets removed.
  3. Any time you ask for the purchase status (see GetPurchaseStatus), the returned data will contain a property called Attachment with the latest version of the attached string (or null).

Data Format

The custom data is passed along as a string. Since we do not process such a data in any way (expect for storing it, updating and allowing you to read it back), the string format is completely up to you. It can be e.g. a JSON or an XML.

Currently, there is no limit for the string length, but we will probably introduce some in the future.