diff --git a/gen/resources copy.json b/gen/resources copy.json index d6694bb..4593b4c 100644 --- a/gen/resources copy.json +++ b/gen/resources copy.json @@ -43,6 +43,7 @@ "attributes": { "fields": { "status": { + "sortable": true, "filterable": true } }, diff --git a/gen/resources.json b/gen/resources.json index 4593b4c..6ac26f1 100644 --- a/gen/resources.json +++ b/gen/resources.json @@ -1,131 +1,2364 @@ [ { "id": "api_credential", + "type": "resources", "attributes": { + "singleton": false, + "deprecated": false, + "actions": [ + "create", + "list", + "retrieve", + "update", + "delete" + ], + "examples": {}, + "filter_scopes": [], "fields": { + "name": { + "type": "string", + "desc": "The API credential internal name.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "My app" + }, + "kind": { + "type": "string", + "desc": "The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.).", + "required": "required", + "creatable": true, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "sales_channel" + }, + "confidential": { + "type": "boolean", + "desc": "Indicates if the API credential it's confidential.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "true" + }, + "redirect_uri": { + "type": "string", + "desc": "The API credential redirect URI.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "https://bluebrand.com/img/logo.svg" + }, + "client_id": { + "type": "string", + "desc": "The API credential unique ID.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "xxxx-yyyy-zzzz" + }, + "client_secret": { + "type": "string", + "desc": "The API credential unique secret.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "xxxx-yyyy-zzzz" + }, + "scopes": { + "type": "string", + "desc": "The API credential scopes.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "market:all market:9 market:122 market:6 stock_location:6 stock_location:33" + }, + "expires_in": { + "type": "integer", + "desc": "The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "7200" + }, "mode": { + "type": "string", + "desc": "Indicates the environment the resource belongs to (one of `test` or `live`).", + "creatable": true, + "updatable": false, + "fetchable": true, + "filterable": true, "sortable": true, - "filterable": true + "example": "test" + }, + "custom": { + "type": "boolean", + "desc": "Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).", + "creatable": true, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "false" + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } } }, "relationships": { "organization": { - "filterable": true + "type": "has_one", + "desc": "The organization associated to the API credential.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::ApiCredentialResource", + "class_name": "Organization" }, "role": { - "filterable": true + "type": "has_one", + "desc": "The role associated to the API credential.", + "creatable": true, + "updatable": true, + "filterable": true, + "sortable": false, + "parent_resource": "V1::ApiCredentialResource", + "class_name": "Role" } - } + }, + "filters": [ + "id", + "name", + "kind", + "confidential", + "redirect_uri", + "client_id", + "scopes", + "expires_in", + "mode", + "custom", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "organization_id", + "role_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } }, { "id": "application_membership", + "type": "resources", "attributes": { - "fields": {}, + "singleton": false, + "deprecated": false, + "actions": [ + "create", + "list", + "retrieve", + "update", + "delete" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "filters": { + "type": "object", + "desc": "Set of key-value pairs that contains restrictions and scopes of the application membership.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "market_id_in": [ + 202, + 203 + ] + } + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, "relationships": { "api_credential": { - "filterable": true + "type": "has_one", + "desc": "The API credential associated to the application membership.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "class_name": "ApiCredential", + "parent_resource": "V1::ApplicationMembershipResource" }, "membership": { - "filterable": true + "type": "has_one", + "desc": "The membership associated to the application membership.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::ApplicationMembershipResource", + "class_name": "Membership" }, "organization": { - "filterable": true + "type": "has_one", + "desc": "The organization associated to the membership.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::ApplicationMembershipResource", + "class_name": "Organization" }, "role": { - "filterable": true + "type": "has_one", + "desc": "The role associated to the application membership.", + "required": "required", + "creatable": true, + "updatable": true, + "filterable": true, + "sortable": false, + "parent_resource": "V1::ApplicationMembershipResource", + "class_name": "Role" + } + }, + "filters": [ + "id", + "filters", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "api_credential_id", + "membership_id", + "organization_id", + "role_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] + } + }, + { + "id": "billing_profile", + "type": "resources", + "attributes": { + "singleton": false, + "deprecated": false, + "actions": [ + "retrieve" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "email": { + "type": "string", + "desc": "The billing profile email.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "commercelayer@commercelayer.io" + }, + "stripe_id": { + "type": "string", + "desc": "The Stripe identification of the billing profile.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "bp_62727272" + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } } - } + }, + "relationships": { + "subscriptions": { + "type": "has_many", + "desc": "The subscriptions associated to the billing profile.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::BillingProfileResource", + "class_name": "Subscription" + }, + "user": { + "type": "has_one", + "desc": "The user associated to the billing profile.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::BillingProfileResource", + "class_name": "User" + } + }, + "filters": [ + "id", + "email", + "stripe_id", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "subscriptions_id", + "user_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } }, { "id": "membership", + "type": "resources", "attributes": { + "singleton": false, + "deprecated": false, + "actions": [ + "create", + "list", + "retrieve", + "update", + "delete" + ], + "examples": {}, + "filter_scopes": [], "fields": { + "user_email": { + "type": "string", + "desc": "The user email.", + "required": "required", + "creatable": true, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "commercelayer@commercelayer.io" + }, + "user_first_name": { + "type": "string", + "desc": "The user first name.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "John" + }, + "user_last_name": { + "type": "string", + "desc": "The user last name.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "Doe" + }, "status": { + "type": "string", + "desc": "The memberships status. One of `pending` (default), `active`.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "pending", + "enum": [ + "pending", + "active" + ], + "aasm": true + }, + "owner": { + "type": "boolean", + "desc": "Indicates if the user it's the owner of the organization.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "true" + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, "sortable": true, - "filterable": true + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } } }, "relationships": { "organization": { - "filterable": true + "type": "has_one", + "desc": "The organization associated to the membership.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::MembershipResource", + "class_name": "Organization" }, "role": { - "filterable": true + "type": "has_one", + "desc": "The role associated to the membership.", + "required": "required", + "creatable": true, + "updatable": true, + "filterable": true, + "sortable": false, + "parent_resource": "V1::MembershipResource", + "class_name": "Role" }, "application_memberships": { - "filterable": true + "type": "has_many", + "desc": "The application memberships associated to the membership.", + "creatable": true, + "updatable": true, + "filterable": true, + "sortable": false, + "parent_resource": "V1::MembershipResource", + "class_name": "ApplicationMembership" + }, + "versions": { + "type": "has_many", + "desc": "The associated changes.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "conditions": { + "include": "CoreMixins::Concerns::Versionable" + }, + "parent_resource": "V1::MembershipResource", + "class_name": "Version" } - } + }, + "filters": [ + "id", + "user_email", + "status", + "owner", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "organization_id", + "role_id", + "application_memberships_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } }, { "id": "organization", + "type": "resources", "attributes": { - "fields": {}, + "singleton": false, + "deprecated": false, + "actions": [ + "create", + "list", + "retrieve", + "update" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "name": { + "type": "string", + "desc": "The organization's internal name.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "The Blue Brand" + }, + "slug": { + "type": "string", + "desc": "The organization's slug name.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "the-blue-brand" + }, + "domain": { + "type": "string", + "desc": "The organization's domain.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "the-blue-brand.commercelayer.io" + }, + "config": { + "type": "object", + "desc": "The organization's configuration.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": { + "mfe": { + "default": { + "links": { + "cart": "https://cart.example.com/:order_id?accessToken=:access_token", + "checkout": "https://checkout.example.com/:order_id?accessToken=:accessToken", + "identity": "https://example.com/login", + "microstore": "https://example.com/microstore/?accessToken=:access_token", + "my_account": "https://example.com/my-custom-account?accessToken=:access_token" + }, + "checkout": { + "thankyou_page": "https://example.com/thanks/:lang/:orderId", + "billing_countries": [ + { + "value": "ES", + "label": "Espana" + }, + { + "value": "IT", + "label": "Italia" + }, + { + "value": "US", + "label": "Unites States of America" + } + ], + "shipping_countries": [ + { + "value": "ES", + "label": "Espana" + }, + { + "value": "IT", + "label": "Italia" + }, + { + "value": "US", + "label": "Unites States of America" + } + ], + "billing_states": { + "FR": [ + { + "value": "PA", + "label": "Paris" + }, + { + "value": "LY", + "label": "Lyon" + }, + { + "value": "NI", + "label": "Nice" + }, + { + "value": "MA", + "label": "Marseille" + }, + { + "value": "BO", + "label": "Bordeaux" + } + ] + }, + "shipping_states": { + "FR": [ + { + "value": "PA", + "label": "Paris" + }, + { + "value": "LY", + "label": "Lyon" + }, + { + "value": "NI", + "label": "Nice" + }, + { + "value": "MA", + "label": "Marseille" + }, + { + "value": "BO", + "label": "Bordeaux" + } + ] + }, + "default_country": "US" + }, + "urls": { + "privacy": "https://example.com/privacy/:lang", + "terms": "https://example.com/terms/:lang" + } + }, + "market:id:ZKcv13rT": { + "links": { + "cart": "https://example.com/custom-cart/:order_id?accessToken=:access_token" + }, + "checkout": { + "thankyou_page": "https://example.com/thanks/:order_id" + } + } + } + } + }, + "support_phone": { + "type": "string", + "desc": "The organization's support phone.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "+01 30800857" + }, + "support_email": { + "type": "string", + "desc": "The organization's support email.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "support@bluebrand.com" + }, + "logo_url": { + "type": "string", + "desc": "The URL to the organization's logo.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "https://bluebrand.com/img/logo.svg" + }, + "favicon_url": { + "type": "string", + "desc": "The URL to the organization's favicon.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "https://bluebrand.com/img/favicon.ico" + }, + "primary_color": { + "type": "string", + "desc": "The organization's primary color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "#C8984E" + }, + "contrast_color": { + "type": "string", + "desc": "The organization's contrast color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "#FFFFCC" + }, + "gtm_id": { + "type": "string", + "desc": "The organization's Google Tag Manager ID.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "GTM-5FJXX6" + }, + "gtm_id_test": { + "type": "string", + "desc": "The organization's Google Tag Manager ID for test.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "GTM-5FJXX7" + }, + "discount_disabled": { + "type": "boolean", + "desc": "Indicates if organization has discount disabled.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "false" + }, + "account_disabled": { + "type": "boolean", + "desc": "Indicates if organization has account disabled.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "false" + }, + "acceptance_disabled": { + "type": "boolean", + "desc": "Indicates if organization has acceptance disabled.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": "tre", + "sortable": false, + "example": "false" + }, + "max_concurrent_promotions": { + "type": "integer", + "desc": "The maximum number of active concurrent promotions allowed for your organization.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "10" + }, + "max_concurrent_imports": { + "type": "integer", + "desc": "The maximum number of concurrent imports allowed for your organization.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "30" + }, + "region": { + "type": "string", + "desc": "The region where the organization it's located, default value it's `eu-west-1`.", + "creatable": true, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "eu-west-1" + }, + "can_switch_live": { + "type": "boolean", + "desc": "Indicates if the organization can switch to live mode.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "false" + }, + "subscription_info": { + "type": "object", + "desc": "Information about the current subscription such as the plan type, limits and subscription totals counter.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": { + "plan_type": "growth", + "limits": { + "markets": 5, + "skus": 10000, + "organizations": 2, + "memberships": 5 + }, + "totals": { + "organizations": 1, + "markets": 0, + "memberships": 2, + "skus": 0 + } + } + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, "relationships": { "memberships": { - "filterable": true + "type": "has_many", + "desc": "The memberships associated to the organization.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::OrganizationResource", + "class_name": "Membership" }, "roles": { - "filterable": true + "type": "has_many", + "desc": "The roles associated to the organization.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::OrganizationResource", + "class_name": "Role" }, "permissions": { - "filterable": true + "type": "has_many", + "desc": "The permissions associated to the organization.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::OrganizationResource", + "class_name": "Permission" }, "api_credentials": { - "filterable": true + "type": "has_many", + "desc": "The API credentials associated to the organization.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::OrganizationResource", + "class_name": "ApiCredential" } - } + }, + "filters": [ + "id", + "name", + "slug", + "domain", + "support_phone", + "support_email", + "logo_url", + "favicon_url", + "primary_color", + "contrast_color", + "discount_disabled", + "account_disabled", + "acceptance_disabled", + "max_concurrent_promotions", + "max_concurrent_imports", + "region", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "memberships_id", + "roles_id", + "permissions_id", + "api_credentials_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } }, { "id": "permission", + "type": "resources", "attributes": { - "fields": {}, + "singleton": false, + "deprecated": false, + "actions": [ + "create", + "list", + "retrieve", + "update" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "can_create": { + "type": "boolean", + "desc": "Determines if the permission have access to create rights.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false + }, + "can_read": { + "type": "boolean", + "desc": "Determines if the permission have access to read rights.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false + }, + "can_update": { + "type": "boolean", + "desc": "Determines if the permission have access to update rights.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false + }, + "can_destroy": { + "type": "boolean", + "desc": "Determines if the permission have access to destroy rights.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false + }, + "subject": { + "type": "string", + "desc": "The resource where this permission is applied.", + "required": "required", + "creatable": true, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false + }, + "restrictions": { + "type": "object", + "desc": "An object that contains additional restrictions.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, "relationships": { "organization": { - "filterable": true + "type": "has_one", + "desc": "The organization associated to the permission.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::PermissionResource", + "class_name": "Organization" }, "role": { - "filterable": true + "type": "has_one", + "desc": "The role associated to the permission.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::PermissionResource", + "class_name": "Role" + }, + "versions": { + "type": "has_many", + "desc": "The associated changes.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "conditions": { + "include": "CoreMixins::Concerns::Versionable" + }, + "parent_resource": "V1::PermissionResource", + "class_name": "Version" } - } + }, + "filters": [ + "id", + "can_create", + "can_read", + "can_update", + "can_destroy", + "subject", + "restrictions", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "organization_id", + "role_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] + } + }, + { + "id": "plan", + "type": "resources", + "attributes": { + "singleton": false, + "deprecated": false, + "actions": [ + "list", + "retrieve" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "enterprise": { + "type": "boolean", + "desc": "Indicates if the plan it's an enterprise one.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false + }, + "price_cents": { + "type": "integer", + "desc": "Indicates the plan price, in cents.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "5000" + }, + "currency_code": { + "type": "string", + "desc": "The currency used in the `price_cents` field.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "USD" + }, + "extra": { + "type": "object", + "desc": "An object that contains additional specifications.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": { + "foo": "bar" + } + }, + "name": { + "type": "string", + "desc": "The plan name.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "Developer" + }, + "limits": { + "type": "object", + "desc": "The limits associated to the plan.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": { + "markets": 5, + "skus": 10000, + "organizations": 2, + "memberships": 5 + } + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, + "relationships": {}, + "filters": [ + "id", + "enterprise", + "price_cents", + "currency_code", + "name", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } }, { "id": "role", + "type": "resources", "attributes": { - "fields": {}, + "singleton": false, + "deprecated": false, + "actions": [ + "create", + "list", + "retrieve", + "update" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "name": { + "type": "string", + "desc": "The role name.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "Custom role" + }, + "kind": { + "type": "string", + "desc": "The kind of role, one of: `custom`, `admin`, `read_only`", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "default": "custom", + "example": "custom" + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, "relationships": { "organization": { - "filterable": true + "type": "has_one", + "desc": "The organization associated to the role.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::RoleResource", + "class_name": "Organization" }, "permissions": { - "filterable": true + "type": "has_many", + "desc": "The permissions associated to the role.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::RoleResource", + "class_name": "Permission" }, "memberships": { - "filterable": true + "type": "has_many", + "desc": "The memberships associated to the role.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::RoleResource", + "class_name": "Membership" }, "api_credentials": { - "filterable": true + "type": "has_many", + "desc": "The API credentials associated to the role.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::RoleResource", + "class_name": "ApiCredential" + }, + "versions": { + "type": "has_many", + "desc": "The associated changes.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "conditions": { + "include": "CoreMixins::Concerns::Versionable" + }, + "parent_resource": "V1::RoleResource", + "class_name": "Version" } - } + }, + "filters": [ + "id", + "name", + "kind", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "organization_id", + "permissions_id", + "memberships_id", + "api_credentials_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] + } + }, + { + "id": "subscription", + "type": "resources", + "attributes": { + "singleton": false, + "deprecated": false, + "actions": [ + "create", + "list", + "retrieve" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "plan_type": { + "type": "string", + "desc": "The plan type associated to this subscription.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "developer" + }, + "status": { + "type": "string", + "desc": "The subscription status. One of `draft` (default), `pending`, `activated`, `expired`, `canceled` or `on_error`.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "pending", + "enum": [ + "draft", + "pending", + "activated", + "expired", + "canceled", + "on_error" + ], + "aasm": true + }, + "stripe_id": { + "type": "string", + "desc": "The Stripe identifier of the subscription.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "sub_097542425" + }, + "totals": { + "type": "object", + "desc": "The number of current organizations, markets, memberships, and SKUs associated with the subscription.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": { + "organizations": 1, + "markets": 0, + "memberships": 0, + "skus": 0 + } + }, + "cancellable": { + "type": "boolean", + "desc": "Indicates if the subscription can be cancelled.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "true" + }, + "account_type": { + "type": "string", + "desc": "Indicates the billing context associated to the subscription.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "inc" + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, + "relationships": { + "plan": { + "type": "has_one", + "desc": "The plan associated to the subscription.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::SubscriptionResource", + "class_name": "Plan" + }, + "billing_profile": { + "type": "has_one", + "desc": "The billing profile associated to the subscription.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::SubscriptionResource", + "class_name": "BillingProfile" + } + }, + "filters": [ + "id", + "plan_type", + "status", + "stripe_id", + "cancellable", + "account_type", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "plan_id", + "billing_profile_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } }, { "id": "user", + "type": "resources", "attributes": { - "fields": {}, - "relationships": {} + "singleton": true, + "deprecated": false, + "actions": [ + "retrieve", + "update" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "email": { + "type": "string", + "desc": "The user email.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "user@commercelayer.io" + }, + "first_name": { + "type": "string", + "desc": "The user first name.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "John" + }, + "last_name": { + "type": "string", + "desc": "The user last name.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "Doe" + }, + "time_zone": { + "type": "string", + "desc": "The user preferred timezone.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "UTC" + }, + "otp_required_for_login": { + "type": "boolean", + "desc": "The user 2FA setting.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": true + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, + "relationships": {}, + "filters": [ + "id", + "email", + "first_name", + "last_name", + "time_zone", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } }, { "id": "version", + "type": "resources", "attributes": { - "fields": {}, - "relationships": {} + "singleton": false, + "deprecated": false, + "actions": [ + "list", + "retrieve" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "item_type": { + "type": "string", + "creatable": false, + "updatable": false, + "fetchable": false, + "filterable": false, + "sortable": false, + "deprecated": true + }, + "resource_type": { + "type": "string", + "desc": "The type of the versioned resource.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "roles" + }, + "resource_id": { + "type": "string", + "desc": "The versioned resource ID.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "PzdJhdLdYV" + }, + "event": { + "type": "string", + "desc": "The event which generates the version.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "update" + }, + "ip_address": { + "type": "string", + "desc": "The request remote IP.", + "creatable": false, + "updatable": false, + "fetchable": false, + "filterable": false, + "sortable": false, + "example": "127.0.0.1" + }, + "user_agent": { + "type": "string", + "desc": "The request User Agent.", + "creatable": false, + "updatable": false, + "fetchable": false, + "filterable": false, + "sortable": false, + "example": "Chrome/108.0.0.0 Safari/537.36" + }, + "uuid": { + "type": "string", + "desc": "The request ID.", + "creatable": false, + "updatable": false, + "fetchable": false, + "filterable": false, + "sortable": false, + "example": "2284362d2b024dc8a8736770ab2a7050bd35487c" + }, + "changes": { + "type": "object", + "desc": "The object changes payload.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "{ \"name\": [\"previous\", \"new\"] }" + }, + "who": { + "type": "object", + "desc": "Information about who triggered the change, only showed when it's from a JWT token.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "{ \"application\": { \"id\": \"DNOPYiZYpn\", \"kind\": \"integration\", \"public\": true }}" + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, + "relationships": {}, + "filters": [ + "id", + "resource_type", + "resource_id", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } } ] \ No newline at end of file diff --git a/gen/resources.ts b/gen/resources.ts index b18fea2..182d8c0 100644 --- a/gen/resources.ts +++ b/gen/resources.ts @@ -3,7 +3,7 @@ import { resolve } from "node:path" const RESOURCES_LOCAL_PATH = resolve('./gen/resources.json') -const RESOURCES_REMOTE_URL = 'https://provisioning.commercelayer.io/api/public/resources' +const RESOURCES_REMOTE_URL = 'https://provisioning.commercelayer.co/api/public/resources' const downloadResources = async (url?: string): Promise => { diff --git a/src/resources/api_credentials.ts b/src/resources/api_credentials.ts index b90876f..86d6ccb 100644 --- a/src/resources/api_credentials.ts +++ b/src/resources/api_credentials.ts @@ -14,7 +14,7 @@ type RoleRel = ResourceRel & { type: RoleType } export type ApiCredentialSort = Pick & ResourceSort -// export type ApiCredentialFilter = Pick & ResourceFilter +// export type ApiCredentialFilter = Pick & ResourceFilter interface ApiCredential extends Resource { diff --git a/src/resources/application_memberships.ts b/src/resources/application_memberships.ts index 6202746..94682d8 100644 --- a/src/resources/application_memberships.ts +++ b/src/resources/application_memberships.ts @@ -18,7 +18,7 @@ type RoleRel = ResourceRel & { type: RoleType } export type ApplicationMembershipSort = Pick & ResourceSort -// export type ApplicationMembershipFilter = Pick & ResourceFilter +// export type ApplicationMembershipFilter = Pick & ResourceFilter interface ApplicationMembership extends Resource { diff --git a/src/resources/memberships.ts b/src/resources/memberships.ts index 72892bd..234f8b6 100644 --- a/src/resources/memberships.ts +++ b/src/resources/memberships.ts @@ -17,7 +17,7 @@ type ApplicationMembershipRel = ResourceRel & { type: ApplicationMembershipType export type MembershipSort = Pick & ResourceSort -// export type MembershipFilter = Pick & ResourceFilter +// export type MembershipFilter = Pick & ResourceFilter interface Membership extends Resource { diff --git a/src/resources/organizations.ts b/src/resources/organizations.ts index 8914b4b..c43f687 100644 --- a/src/resources/organizations.ts +++ b/src/resources/organizations.ts @@ -14,7 +14,7 @@ type OrganizationRel = ResourceRel & { type: OrganizationType } export type OrganizationSort = Pick & ResourceSort -// export type OrganizationFilter = Pick & ResourceFilter +// export type OrganizationFilter = Pick & ResourceFilter interface Organization extends Resource { diff --git a/src/resources/permissions.ts b/src/resources/permissions.ts index 6aa84d8..0561ef1 100644 --- a/src/resources/permissions.ts +++ b/src/resources/permissions.ts @@ -14,7 +14,7 @@ type RoleRel = ResourceRel & { type: RoleType } export type PermissionSort = Pick & ResourceSort -// export type PermissionFilter = Pick & ResourceFilter +// export type PermissionFilter = Pick & ResourceFilter interface Permission extends Resource { diff --git a/src/resources/roles.ts b/src/resources/roles.ts index 4345c35..e57118b 100644 --- a/src/resources/roles.ts +++ b/src/resources/roles.ts @@ -16,7 +16,7 @@ type OrganizationRel = ResourceRel & { type: OrganizationType } export type RoleSort = Pick & ResourceSort -// export type RoleFilter = Pick & ResourceFilter +// export type RoleFilter = Pick & ResourceFilter interface Role extends Resource { diff --git a/src/resources/user.ts b/src/resources/user.ts index 99f9314..c860e8c 100644 --- a/src/resources/user.ts +++ b/src/resources/user.ts @@ -9,8 +9,8 @@ type UserType = 'user' type UserRel = ResourceRel & { type: UserType } -export type UserSort = Pick & ResourceSort -// export type UserFilter = Pick & ResourceFilter +export type UserSort = Pick & ResourceSort +// export type UserFilter = Pick & ResourceFilter interface User extends Resource { diff --git a/src/resources/versions.ts b/src/resources/versions.ts index 01fa22d..259749a 100644 --- a/src/resources/versions.ts +++ b/src/resources/versions.ts @@ -10,7 +10,7 @@ type VersionRel = ResourceRel & { type: VersionType } export type VersionSort = Pick & ResourceSort -// export type VersionFilter = Pick & ResourceFilter +// export type VersionFilter = Pick & ResourceFilter interface Version extends Resource {