Custom Fields

List Metadata for Resource Type

GET
/{resource_type}/metadata.json

Lists metadata for a specified array of subscriptions or customers.

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

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
date_field?Basic Date Field

The type of filter you would like to apply to your search.

Value in

  • "updated_at"
  • "created_at"
start_date?string

The start date (format YYYY-MM-DD) with which to filter the date_field. Returns metadata with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified.

Formatdate
end_date?string

The end date (format YYYY-MM-DD) with which to filter the date_field. Returns metadata with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified.

Formatdate
start_datetime?string

The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns metadata with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date.

Formatdate-time
end_datetime?string

The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns metadata with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date.

Formatdate-time
with_deleted?boolean

Allow to fetch deleted metadata.

resource_ids?array<integer>

Allow to fetch metadata for multiple records based on provided ids. Use in query: resource_ids[]=122&resource_ids[]=123&resource_ids[]=124.

Itemsitems <= 50
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/metadata.json"
{  "total_count": 0,  "current_page": 0,  "total_pages": 0,  "per_page": 0,  "metadata": [    {      "id": 0,      "value": "string",      "resource_id": 0,      "name": "string",      "deleted_at": "2019-08-24T14:15:22Z",      "metafield_id": 0    }  ]}