Manage metadata via API
On this section, you will learn how to view and manage the metadata of your PayRex resources using our API.
If you want to learn about some of our merchants' metadata use cases, you can read more on this page.
Metadata can be managed via our API through our SDKs or your custom code. It is more natural and efficient to manage metadata via our API over our Dashboard. Metadata are arbitrary values that can be programmatically attached to resources via our API.
A metadata is a JSON attribute with key-value pairs, where:
- key: the identifier or label of the metadata.
- value: the content of the metadata.
{
"id": "pay_bJdGt2XC3XNRjps3WdzjKixWfs7Zb4sa",
"resource": "payment",
"amount": 4569600,
"amount_refunded": 0,
"billing": null,
"currency": "PHP",
"description": null,
"fee": 2500,
"livemode": false,
"metadata": {
"Order ID": "12345",
"Sales Channel": "online"
},
"net_amount": 4549257,
"payment_intent_id": "pi_nzxCsMb2FQ4WitBZAaQgw3CSTJBnW8id",
"payment_method": {
"type": "card",
"card": {
"first6": "511111",
"last4": "1111",
"brand": "visa"
}
},
"status": "paid",
"customer": null,
"payment_method": {
"type": "qrph"
},
"refunded": false,
"created_at": 1747235098,
"updated_at": 1747263620
}
Some of our existing resources support metadata. Here are the current resources that support metadata:
To add metadata when creating a resource, you can specify the metadata attribute on resource creation. You can refer to our API reference for more information.