Metadata
The metadata field stores key-value pairs from your system alongside Appmax objects, such as the order, checkout or session ID on your platform. Appmax does not use this data in any business rule and never shows it to the buyer: it only comes back to you in queries and webhooks.
{
"metadata": {
"shopify_order_id": "5123456789",
"shopify_checkout_id": "abc123"
}
}Do not send sensitive data
Do not store card numbers, CVV, documents (CPF/CNPJ), passwords, access tokens or any personal buyer data in metadata. The field is returned in queries and webhooks without any masking.
Limits
| Rule | Limit |
|---|---|
| Number of keys | up to 50 per object |
| Key length | up to 40 characters |
| Value | text only (string), up to 500 characters |
Numbers, booleans, lists and nested objects are rejected: send "10", not 10. Outside these limits the API answers 422 with the metadata field in errors.message.
Where to send it
| Object | On create | On update |
|---|---|---|
| Order | POST /v1/orders | PATCH /v1/orders/{order_id} |
| Payment | POST /v1/payments/credit-card, pix, boleto, apple-pay, google-pay | Not applicable: each new payment of the order replaces the previous payment's metadata |
| Refund | POST /v1/orders/refund-request | PATCH /v1/refunds/{refund_id} |
| Merchant | The merchant is the credential's store (created when the app is installed) | PATCH /v1/merchant |
On PATCH routes, the keys you send replace the current ones and the keys you leave out stay as they are. To remove a key, send the value "" (or null):
{
"metadata": {
"shopify_checkout_id": "",
"shopify_order_id": "5123456790"
}
}Where you get it back
| Object | Query | Webhook |
|---|---|---|
| Order | order.metadata in GET /v1/orders/{order_id} | metadata on order events; order_metadata on payment events |
| Payment | payment.metadata in GET /v1/orders/{order_id} | metadata on payment events; payment_metadata on order events |
| Refund | refund.metadata in GET /v1/refunds/{refund_id} | refund_metadata on order_refund and order_partial_refund |
| Merchant | merchant.metadata in GET /v1/merchant | There is no merchant event |
Without metadata, the field comes back as an empty object ({}). See each event's fields in Webhooks.