Custom Fields

List Metafields

GET
/{resource_type}/metafields.json

Lists the metafields and their associated details for a Site and resource type. You can filter the request to a specific metafield.

Authorization

BasicAuth
AuthorizationBasic <token>

The username is a Maxio Chargify API key. The password is x.

In: header

Path Parameters

resource_type*Resource Type

The resource type to which the metafields belong.

Value in

  • "subscriptions"
  • "customers"

Query Parameters

name?string

Filter by the name of the metafield.

page?integer

Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned. Use in query page=1.

Range1 <= value
Default1
per_page?integer

This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200. Use in query per_page=200.

Rangevalue <= 200
Default20
direction?Sorting direction

Controls the order in which results are returned. Use in query direction=asc.

Value in

  • "asc"
  • "desc"

Response Body

application/json

curl -X GET "https://example.com/subscriptions/metafields.json"
{  "total_count": 1,  "current_page": 1,  "total_pages": 0,  "per_page": 50,  "metafields": [    {      "id": 0,      "name": "string",      "scope": {        "csv": "0",        "statements": "0",        "invoices": "0",        "portal": "0",        "public_show": "0",        "public_edit": "0"      },      "data_count": 0,      "input_type": "text",      "enum": null    }  ]}