Creates metafields on a Site for either the Subscriptions or Customers resource.
Metafields and their metadata are created in the Custom Fields configuration page on your Site. Metafields can be populated with metadata when you create them or later with the Update Metafield, Create Metadata, or Update Metadata endpoints. The Create Metadata and Update Metadata endpoints allow you to add metafields and metadata values to a specific subscription or customer.
Each site is limited to 100 unique metafields per resource. This means you can have 100 metafields for Subscriptions and another 100 for Customers.
Note: After creating a metafield, the resource type cannot be modified.
In the UI and product documentation, metafields and metadata are called Custom Fields.
See Custom Fields Reference and Custom Fields Tab for information on using Custom Fields in the Advanced Billing UI.
The username is a Maxio Chargify API key and the password is x. Basic authentication works only with the US and EU environments, which connect to chargify.com directly. The Maxio API Gateway environment does not accept Basic authentication.
In: header
The resource type to which the metafields belong.
Value in
application/json
TypeScript Definitions
Use the request body type in TypeScript.
application/json
application/json
curl -X POST \ --url 'https://subdomain.chargify.com/subscriptions/metafields.json' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ --data-raw '{ "metafields": { "name": "Dropdown field", "scope": { "csv": "0", "invoices": "0", "statements": "0", "portal": "1" }, "input_type": "dropdown", "enum": [ "option 1", "option 2" ] }}'