curl --request GET \
--url https://{cluster}.voucherify.io/v1/metadata-schemas/{resource} \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"id": "ms_27vMXZqBAkkqBoOuw8EYTRLn",
"related_object": "earning_rule",
"properties": {
"channel_id": {
"type": "string",
"array": true,
"optional": true,
"objectType": null,
"exactLength": 5
},
"channel_name": {
"eq": [
"instagram",
"facebook",
"google",
"twitter",
"linkedin",
"website"
],
"type": "string",
"array": false,
"optional": true,
"objectType": null
}
},
"allow_defined_only": false,
"created_at": "2022-08-25T13:09:59.970Z",
"updated_at": "2022-08-25T13:11:15.704Z",
"object": "metadata_schema"
}Get Metadata Schema
Retrieves a metadata schema per resource type.
Resource types
Standard
You can retrieve metadata schemas for the standard metadata schema definitions listed below. Add one of these types as the resource path parameter.
campaigncustomerearning_ruleloyalty_tierorderorder_itemproductpromotion_tierpublicationredemptionrewardvoucher
Custom
If you have defined a custom metadata schema, provide its name in the "resource" field to retrieve its details.
If you have Management API enabled, you can also use the Get Metadata Schemas endpoint to retrieve a metadata schema using its ID.
loyalty_tier / Loyalty Tier and earning_rule / Earning rule metadata schemas apply to legacy loyalty campaigns. Loyalty hub resources use Loyalty v2 metadata where configured.
curl --request GET \
--url https://{cluster}.voucherify.io/v1/metadata-schemas/{resource} \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"id": "ms_27vMXZqBAkkqBoOuw8EYTRLn",
"related_object": "earning_rule",
"properties": {
"channel_id": {
"type": "string",
"array": true,
"optional": true,
"objectType": null,
"exactLength": 5
},
"channel_name": {
"eq": [
"instagram",
"facebook",
"google",
"twitter",
"linkedin",
"website"
],
"type": "string",
"array": false,
"optional": true,
"objectType": null
}
},
"allow_defined_only": false,
"created_at": "2022-08-25T13:09:59.970Z",
"updated_at": "2022-08-25T13:11:15.704Z",
"object": "metadata_schema"
}Authorizations
Scopes
Path Parameters
Response
The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the Project Settings > Metadata Schema definitions. For example, an unknown metadata property can be defined in the campaign manager.
Response body schema for GET /v1/metadata-schemas/{resource}.
The resource type. You can define custom metadata schemas, which have a custom "related_object" resource type. The standard metadata schemas are: "campaign", "customer", "earning_rule", "loyalty_tier", "order", "order_item", "product", "promotion_tier", "publication", "redemption", "reward", "voucher".

