diff --git a/.idea/.gitignore b/.idea/.gitignore index 13566b81b..a9d7db9c0 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -6,3 +6,5 @@ # Datasource local storage ignored files /dataSources/ /dataSources.local.xml +# GitHub Copilot persisted chat sessions +/copilot/chatSessions diff --git a/reference/carts.v3.yml b/reference/carts.v3.yml index 8c5d1bf4a..faa769674 100644 --- a/reference/carts.v3.yml +++ b/reference/carts.v3.yml @@ -1037,19 +1037,6 @@ paths: title: Input is invalid type: 'https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes' detail: Syntax error - '404': - description: | - The `Metafield` was not found. - content: - application/json: - schema: - $ref: '#/components/schemas/NotFound' - examples: - example-1: - value: - status: 404 - title: The resource at that URL was not found. - type: 'https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes' '422': description: | Response object for metafields creation with partial success. @@ -3338,12 +3325,10 @@ components: description: | Response payload for the BigCommerce API. x-internal: false - allOf: - - type: object - properties: - data: - $ref: '#/components/schemas/Metafield' - - $ref: '#/components/schemas/metaCollection_open' + type: object + properties: + data: + $ref: '#/components/schemas/Metafield' Metafield: description: | Allows app partners to write custom data to various resources in the API. diff --git a/reference/store_information.v2.yml b/reference/store_information.v2.yml index ff5a860db..63ff87f10 100644 --- a/reference/store_information.v2.yml +++ b/reference/store_information.v2.yml @@ -20,6 +20,8 @@ security: tags: - name: Store Information - name: Time Zone + - name: Metafields + - name: Batch metafields paths: '/store': get: @@ -98,9 +100,252 @@ paths: graphql_storefront_api_enabled: true shopper_consent_tracking_enabled: true multi_storefront_enabled: true - storefront_limits: + storefront_limits: active: 3 total_including_inactive: 4 + '/store/metafields': + get: + summary: Get All Store Metafields + tags: + - Batch metafields + description: Gets all store `metafields`. + operationId: getStoreMetafields + responses: + '200': + description: | + List of `Metafield` objects. + content: + application/json: + schema: + $ref: '#/components/schemas/MetaFieldCollectionResponse_Batch' + examples: + response: + value: + data: + - id: "69" + key: key2 + value: value + namespace: test2 + permission_set: write_and_sf_access + resource_type: store + resource_id: "1001197568" + description: "" + date_created: 2024-08-27T18:58:43+00:00 + date_modified: 2024-08-27T18:58:43+00:00 + owner_client_id: k8l7zz0ynkd1bfbxx02p2k7pnk3n8ov + meta: + pagination: + total: 4 + count: 4 + per_page: 50 + current_page: 1 + total_pages: 1 + links: + current: ?limit=50&page=1 + parameters: + - $ref: '#/components/parameters/PageParam' + - $ref: '#/components/parameters/LimitParam' + - $ref: '#/components/parameters/MetafieldKeyParam' + - $ref: '#/components/parameters/MetafieldKeyInParam' + - $ref: '#/components/parameters/MetafieldNamespaceParam' + - $ref: '#/components/parameters/MetafieldNamespaceInParam' + - $ref: '#/components/parameters/DirectionParam' + post: + summary: Create multiple Metafields + tags: + - Batch metafields + description: Create multiple `metafields`. + operationId: createStoresMetafields + requestBody: + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: '#/components/schemas/MetafieldBase_Post_Put' + required: true + description: A `metafield` object. + responses: + '200': + description: | + List of created `Metafield` objects. + content: + application/json: + schema: + $ref: '#/components/schemas/MetaFieldCollectionResponse_Batch_POST_PUT' + '422': + description: | + Response object for metafields creation with partial success. + content: + application/json: + schema: + $ref: '#/components/schemas/MetaFieldCollectionResponsePartialSuccess_POST_PUT' + put: + summary: Update multiple metafields + tags: + - Batch metafields + description: Update multiple metafields. + operationId: updateStoreMetafields + requestBody: + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: '#/components/schemas/MetafieldBase_Post_Put' + - type: object + properties: + id: + type: integer + example: 42 + description: | + The ID of metafield to update. + required: + - id + description: '' + responses: + '200': + description: Response payload for the BigCommerce API. + content: + application/json: + schema: + $ref: '#/components/schemas/MetaFieldCollectionResponse_Batch_POST_PUT' + '400': + description: Bad Request. Input is invalid. + content: + application/json: + schema: + description: '' + type: object + properties: + status: + type: number + title: + type: string + minLength: 1 + type: + type: string + minLength: 1 + detail: + type: string + minLength: 1 + example: + status: 400 + title: Input is invalid + type: 'https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes' + detail: Syntax error + '422': + description: | + Response object for metafields creation with partial success. + content: + application/json: + schema: + $ref: '#/components/schemas/MetaFieldCollectionResponsePartialSuccess_POST_PUT' + delete: + summary: Delete multiple metafields + tags: + - Batch metafields + description: Delete all store metafields. + operationId: deleteStoreMetafields + requestBody: + content: + application/json: + schema: + type: array + items: + type: integer + example: + [69,70] + description: Metafields ID list. + responses: + '200': + description: | + Response object for metafields deletion with success. + content: + application/json: + schema: + $ref: '#/components/schemas/MetaFieldCollectionDeleteResponseSuccess' + '/store/metafields/{metafieldId}': + get: + summary: Get a Store Metafield + tags: + - Metafields + description: Gets a store `metafield`. + operationId: getStoreMetafield + responses: + '200': + description: | + A `Metafield` object. + content: + application/json: + schema: + $ref: '#/components/schemas/MetafieldResponse' + '404': + description: | + Not found (A metafield was not found with this query). + content: + application/json: + schema: + $ref: '#/components/schemas/NotFound' + put: + summary: Update a Store Metafield + tags: + - Metafields + description: | + Update a store `Metafield`. + operationId: updateStoreMetafield + parameters: + - $ref: '#/components/parameters/ContentType' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MetafieldBase_Post_Put' + description: | + A `Metafield` object. + responses: + '200': + description: | + A metafield and metadata. + content: + application/json: + schema: + $ref: '#/components/schemas/MetaFieldCollectionResponse' + '404': + description: | + The resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/NotFound' + example: + value: + status: 404 + title: There was no metafield found with ID 1010 + type: 'https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes' + delete: + summary: Delete a Metafield + tags: + - Metafields + description: | + Deletes a store `Metafield`. + operationId: deleteStoreMetafield + responses: + '204': + description: | + An empty response. + '404': + description: | + Not found (A metafield was not found with this query). + content: + application/json: + schema: + $ref: '#/components/schemas/NotFound' + parameters: + - $ref: '#/components/parameters/Accept' + - $ref: '#/components/parameters/MetafieldIdParam' '/time': get: description: Returns the system timestamp at the time of the request. The time resource is useful for validating API authentication details and testing client connections. @@ -149,6 +394,433 @@ components: type: apiKey in: header schemas: + NotFound: + description: Error payload for the BigCommerce API. + type: object + properties: + status: + description: | + 404 HTTP status code. + type: integer + example: 404 + title: + description: The error title describing the particular error. + type: string + example: The resource at that URL is not found. + type: + type: string + example: 'https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes' + title: Not Found + x-internal: false + ErrorResponse: + type: object + properties: + status: + type: integer + title: + type: string + type: + type: string + instance: + type: string + errors: + type: object + properties: {} + x-tags: + - Models + MetafieldResponse: + description: | + Response payload for the BigCommerce API. + x-internal: false + allOf: + - type: object + properties: + data: + $ref: '#/components/schemas/Metafield' + meta: + $ref: '#/components/schemas/metaCollection_open' + Metafield: + description: | + Allows app partners to write custom data to various resources in the API. + allOf: + - $ref: '#/components/schemas/MetafieldBase' + - type: object + properties: + id: + type: string + description: The unique identifier for the metafield. + date_created: + type: string + format: date-time + description: Date and time of the metafieldʼs creation. + example: '2022-06-16T18:39:00+00:00' + date_modified: + type: string + format: date-time + description: Date and time when the metafield was last updated. + example: '2022-06-16T18:39:00+00:00' + owner_client_id: + type: string + description: Client ID for the metafieldʼs creator. + example: asdfasdfasdfasdfasdfasdfasdf + readOnly: true + x-internal: false + MetafieldBase: + type: object + description: | + Common Metafield properties. + x-internal: false + properties: + permission_set: + type: string + description: | + Determines the visibility and writeability of the field by other API consumers. + | Value | Description | + | :--- | :--- | + | `app_only` | Private to the app that owns the field. | + | `read` | Visible to other API consumers. | + | `write` | Open for reading and writing by other API consumers. | + | `read_and_sf_access` | Visible to other API consumers, including on the storefront. | + | `write_and_sf_access` | Open for reading and writing by other API consumers, including on the storefront. | + enum: + - app_only + - read + - write + - read_and_sf_access + - write_and_sf_access + namespace: + type: string + description: | + Namespace for the metafield, for organizational purposes. + example: Sales Department + minLength: 1 + maxLength: 64 + key: + type: string + description: | + The name of the field, for example: `location_id`, `color`. + minLength: 1 + maxLength: 64 + example: Staff Name + value: + type: string + description: | + The value of the field, for example: `1`, `blue`. + minLength: 1 + maxLength: 65535 + example: Ronaldo + description: + type: string + description: | + Description for the metafields. + example: order + minLength: 0 + maxLength: 255 + resource_type: + type: string + description: | + The type of resource with which the metafield is associated. + enum: + - brand + - product + - variant + - category + - cart + - store + example: store + resource_id: + type: string + description: | + The unique identifier for the resource with which the metafield is associated. + example: '0' + readOnly: true + required: + - permission_set + MetafieldBase_Post_Put: + type: object + description: | + Common Metafield properties. + x-internal: false + properties: + permission_set: + type: string + description: | + Determines the visibility and writeability of the field by other API consumers. + | Value | Description | + | :--- | :--- | + | `app_only` | Private to the app that owns the field. | + | `read` | Visible to other API consumers. | + | `write` | Open for reading and writing by other API consumers. | + | `read_and_sf_access` | Visible to other API consumers, including on the storefront. | + | `write_and_sf_access` | Open for reading and writing by other API consumers, including on the storefront. | + enum: + - app_only + - read + - write + - read_and_sf_access + - write_and_sf_access + namespace: + type: string + description: | + Namespace for the metafield, for organizational purposes. + example: Sales Department + minLength: 1 + maxLength: 64 + key: + type: string + description: | + The name of the field, for example: `location_id`, `color`. + minLength: 1 + maxLength: 64 + example: Staff Name + value: + type: string + description: | + The value of the field, for example: `1`, `blue`. + minLength: 1 + maxLength: 65535 + example: Ronaldo + description: + type: string + description: | + Description for the metafields. + minLength: 0 + maxLength: 255 + example: Name of Staff Member + required: + - permission_set + - namespace + - key + - value + MetaFieldCollectionResponse: + type: object + description: | + Response payload for the BigCommerce API. + properties: + data: + $ref: '#/components/schemas/Metafield' + meta: + $ref: '#/components/schemas/metaCollection_open' + x-internal: false + MetaFieldCollectionResponse_Batch: + type: object + description: | + Response payload for the BigCommerce API. + properties: + data: + type: array + items: + $ref: '#/components/schemas/Metafield' + meta: + $ref: '#/components/schemas/CollectionMeta' + MetaFieldCollectionResponse_Batch_POST_PUT: + type: object + description: | + Response payload for the BigCommerce API. + properties: + data: + type: array + items: + $ref: '#/components/schemas/Metafield' + errors: + type: array + items: {} + description: Empty for 200 responses. + example: [ ] + meta: + $ref: '#/components/schemas/WriteCollectionSuccessMeta' + MetaFieldCollectionDeleteResponseSuccess: + type: object + description: | + Response payload for the BigCommerce API. + properties: + data: + type: array + items: + type: integer + description: | + The unique identifier for the metafield. + example: + - 123 + - 124 + - 125 + errors: + type: array + items: {} + description: Empty for 200 responses. + example: [ ] + meta: + $ref: '#/components/schemas/WriteCollectionSuccessMeta' + x-internal: false + MetaFieldCollectionResponsePartialSuccess_POST_PUT: + type: object + description: | + Response payload for the BigCommerce API. + properties: + data: + type: array + items: + $ref: '#/components/schemas/Metafield' + description: Empty for 200 responses. + example: [] + errors: + $ref: '#/components/schemas/Error' + meta: + $ref: '#/components/schemas/WriteCollectionPartialSuccessMeta' + MetaFieldCollectionResponsePartialSuccess_DELETE: + type: object + description: | + Response payload for the BigCommerce API. + properties: + data: + type: array + items: + type: integer + description: | + The unique identifier for the metafield. + example: + - 123 + errors: + type: array + items: + $ref: '#/components/schemas/Error' + meta: + $ref: '#/components/schemas/WriteCollectionPartialSuccessMeta' + x-internal: false + Error: + type: object + description: | + Error response payload for the BigCommerce API. + properties: + status: + type: integer + description: | + The HTTP status code for the error. + example: 422 + title: + type: string + description: | + The error title. + example: Bulk operation has failed + type: + type: string + description: | + The error type. + example: https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes + errors: + $ref: '#/components/schemas/ErrorDetail' + ErrorDetail: + type: object + properties: {} + additionalProperties: true + description: | + Error detail response payload for the BigCommerce API. + example: + "0": "Entity already exists" + "1": "Unauthorized to delete" + "2": "Metafield does not exist" + WriteCollectionSuccessMeta: + type: object + description: Additional data about the response. + properties: + total: + type: integer + description: | + Total number of items in the result set. + example: 3 + success: + type: integer + description: | + Total number of items that were successfully deleted. + example: 3 + failed: + type: integer + description: | + Total number of items that failed to be deleted. + example: 0 + title: Collection Meta + x-internal: false + WriteCollectionPartialSuccessMeta: + type: object + description: Additional data about the response. + properties: + total: + type: integer + description: | + Total number of items in the result set. + example: 3 + success: + type: integer + description: | + Total number of items that were successfully deleted. + example: 1 + failed: + type: integer + description: | + Total number of items that failed to be deleted. + example: 2 + title: Collection Meta + x-internal: false + CollectionMeta: + type: object + description: Data about the response, including pagination and collection totals. + properties: + pagination: + type: object + description: Data about the response, including pagination and collection totals. + title: Pagination + properties: + total: + type: integer + description: | + Total number of items in the result set. + example: 36 + count: + type: integer + description: | + Total number of items in the collection response. + example: 36 + per_page: + type: integer + description: | + The amount of items returned in the collection per page, controlled by the limit parameter. + example: 50 + current_page: + type: integer + description: | + The page you are currently on within the collection. + example: 1 + total_pages: + type: integer + description: | + The total number of pages in the collection. + example: 1 + links: + type: object + description: | + Pagination links for the previous and next parts of the whole collection. + properties: + previous: + type: string + description: | + Link to the previous page returned in the response. + current: + type: string + description: | + Link to the current page returned in the response. + example: '?page=1&limit=50' + next: + type: string + description: | + Link to the next page returned in the response. + additionalProperties: true + title: Collection Meta + x-internal: false + metaCollection_open: + title: Response meta + type: object + properties: { } + description: Response metadata. StoreInformation: title: Store Information type: object @@ -432,11 +1104,88 @@ components: title: timeStamp_Full x-internal: false parameters: + ContentType: + name: Content-Type + in: header + schema: + type: string + default: application/json + PageParam: + name: page + description: | + Specifies the page number in a limited (paginated) list of products. + required: false + in: query + schema: + type: integer + MetafieldIdParam: + name: metafieldId + in: path + description: | + The ID of the `Metafield`. + required: true + schema: + type: integer + MetafieldKeyParam: + name: key + in: query + description: Filter based on a metafieldʼs key. + required: false + schema: + type: string + MetafieldKeyInParam: + name: key:in + in: query + description: Filter based on comma-separated metafieldʼs keys. Could be used with vanilla `key` query parameter. + required: false + style: form + explode: false + schema: + type: array + items: + type: string + MetafieldNamespaceParam: + name: namespace + in: query + description: Filter based on a metafieldʼs namespaces. + required: false + schema: + type: string + MetafieldNamespaceInParam: + name: namespace:in + in: query + description: Filter based on comma-separated metafieldʼs namespaces. Could be used with vanilla `namespace` query parameter + required: false + style: form + explode: false + schema: + type: array + items: + type: string + LimitParam: + name: limit + description: | + Controls the number of items per page in a limited (paginated) list of products. + required: false + in: query + schema: + type: integer + DirectionParam: + name: direction + description: | + Sort direction. Acceptable values are: `asc`, `desc`. + required: false + in: query + schema: + type: string + enum: + - asc + - desc Accept: name: Accept in: header - required: true - description: 'The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. The default is application/xml, but application/json is available when specified.' + required: false + description: 'The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body.' schema: type: string - default: application/xml + default: application/json