-
Notifications
You must be signed in to change notification settings - Fork 58
TAX-2677: docs(tax) - Add v3 tax class batch endpoints OpenAPI spec #1301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8ed518c
doc(tax): TAX-2677 add v3 tax class batch endpoints
bc-vincent-zhao aa5f0b6
TAX-2677: docs(tax) - Remove internal-facing language from tax class …
bc-vincent-zhao f6060ad
TAX-2677: docs(tax) - Update server URL to public API gateway
bc-vincent-zhao eb9d086
TAX-2677: docs(tax) - Address PR review feedback on tax class batch spec
bc-vincent-zhao a5248fb
TAX-2677: docs(tax) - Move name uniqueness constraint to field schema
bc-vincent-zhao 750a077
TAX-2677: docs(tax) - Remove hawk and admin security schemes
bc-vincent-zhao 7d1158b
TAX-2677: docs(tax) - Add X-Auth-Token security scheme with MANAGE_TA…
bc-vincent-zhao 7a4ce1b
TAX-2677: docs(tax) - Address low-priority PR review suggestions
bc-vincent-zhao 79bf98c
TAX-2677: docs(tax) - Capitalize ID in PUT 422 response description
bc-vincent-zhao fd1d173
TAX-2677: docs(tax) - Capitalize IDs in DELETE endpoint description
bc-vincent-zhao c23ac41
doc(tax): TAX-2677 remove description for tags
bc-vincent-zhao 9f87e8d
Update reference/tax_classes.v3.yaml
bc-vincent-zhao 55a71d5
Update reference/tax_classes.v3.yaml
bc-vincent-zhao 495f974
Update reference/tax_classes.v3.yaml
bc-vincent-zhao 273bf19
Update reference/tax_classes.v3.yaml
bc-vincent-zhao f7c416d
Update reference/tax_classes.v3.yaml
bc-vincent-zhao ea835aa
Update reference/tax_classes.v3.yaml
bc-vincent-zhao 194b1d4
Update reference/tax_classes.v3.yaml
bc-vincent-zhao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,362 @@ | ||
| openapi: 3.0.3 | ||
| info: | ||
| title: Tax Classes | ||
| description: | | ||
| Manage tax classification options available on your store. Tax classes are used to apply different tax rates to products and other item types. | ||
|
|
||
| This API exposes batch operations (`POST`, `PUT`, `DELETE`) for tax classes. | ||
|
|
||
| **Responses:** Successful JSON bodies use the envelope format: | ||
| `{ "data": ..., "meta": ... }`. Batch POST/PUT return an array of tax class resources under `data`. | ||
|
|
||
| **DELETE:** Deletes are filter-based using the `id:in` query parameter. The request must specify the ids to delete — there is no single-resource delete on this endpoint. | ||
| termsOfService: 'https://www.bigcommerce.com/terms' | ||
| contact: | ||
| name: BigCommerce | ||
| url: 'https://www.bigcommerce.com' | ||
| email: support@bigcommerce.com | ||
| version: 1.0.0 | ||
|
|
||
| servers: | ||
| - url: 'https://api.bigcommerce.com/stores/{store_hash}/v3' | ||
| variables: | ||
| store_hash: | ||
| default: store_hash | ||
| description: Permanent ID of the BigCommerce store. | ||
| description: BigCommerce API Gateway | ||
|
|
||
| security: | ||
| - X-Auth-Token: [] | ||
|
|
||
| tags: | ||
| - name: Tax Classes | ||
| description: Create, update, and delete tax classes. | ||
|
|
||
| paths: | ||
| /tax/classes: | ||
| post: | ||
| tags: | ||
| - Tax Classes | ||
| summary: Create tax classes | ||
| description: | | ||
| Creates multiple tax classes in a single request. Max **50** items per request. | ||
| operationId: taxClassBatchPost | ||
|
|
||
| requestBody: | ||
| required: true | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/TaxClassCreateBatch' | ||
| example: | ||
| - name: Class One | ||
| - name: Class Two | ||
| responses: | ||
| '200': | ||
| description: Created classes returned as a collection. | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/TaxClassCollectionEnvelope' | ||
| '400': | ||
| description: Bad request (e.g. invalid input). | ||
|
bc-vincent-zhao marked this conversation as resolved.
Outdated
|
||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '409': | ||
| description: Duplicate tax class names (conflict). | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '413': | ||
| description: Batch exceeds limit (50 items). | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '422': | ||
| description: | | ||
| Unprocessable entity — empty body, non-array batch shape, or duplicate `name` or `id` within the batch. | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '403': | ||
| description: Authentication or `Manage_Tax` denied. | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '500': | ||
| description: Unexpected server error. | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
|
|
||
| put: | ||
| tags: | ||
| - Tax Classes | ||
| summary: Update tax classes | ||
| description: | | ||
| Updates multiple tax classes in a single request. Collection PUT only. | ||
|
|
||
| Request body: non-empty array, max **50** items. Each item must include: | ||
| - `id`: positive integer (**unique** across the request) | ||
| - `name`: same length and character rules as create; **unique case-insensitively** across the store. | ||
|
|
||
| Returns **400** if one or more specified classes are not found. | ||
| Duplicate names → **409**. | ||
|
bc-vincent-zhao marked this conversation as resolved.
Outdated
|
||
| operationId: taxClassBatchPut | ||
|
|
||
| requestBody: | ||
| required: true | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/TaxClassUpdateBatch' | ||
| example: | ||
| - id: 1 | ||
| name: Renamed One | ||
| - id: 2 | ||
| name: Renamed Two | ||
| responses: | ||
| '200': | ||
| description: Updated classes returned. | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/TaxClassCollectionEnvelope' | ||
| '400': | ||
| description: One or more classes not found (update). | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '409': | ||
| description: Duplicate tax class names. | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '413': | ||
| description: Batch exceeds 50 ids/items. | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '422': | ||
| description: Validation error (format, duplicate `id` in batch, invalid ID values, ID-only update payload, etc.). | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '403': | ||
| description: Authentication or permission denied. | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '500': | ||
| description: Server error. | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
|
|
||
| delete: | ||
| tags: | ||
| - Tax Classes | ||
| summary: Delete tax classes | ||
| description: | | ||
| Deletes multiple tax classes in a single request. The request must include the **`id:in`** query parameter | ||
| with a comma-separated list of positive integer IDs. | ||
|
|
||
| Max **50** IDs. Empty ID list → **404**. Invalid ID values → **422**. | ||
| Returns **400** if one or more specified classes are not found. | ||
|
|
||
| Success returns **204 No Content**. | ||
|
bc-vincent-zhao marked this conversation as resolved.
Outdated
|
||
| operationId: taxClassBatchDelete | ||
|
|
||
| parameters: | ||
| - name: id:in | ||
| in: query | ||
| required: true | ||
| description: | | ||
| Comma-separated list of tax class IDs to delete (e.g. `1,2,3`). | ||
|
bc-vincent-zhao marked this conversation as resolved.
Outdated
|
||
| Must use the `in` operator; other filter operators are rejected with **400**. | ||
|
bc-vincent-zhao marked this conversation as resolved.
Outdated
|
||
| schema: | ||
| type: string | ||
| example: '101,102,103' | ||
| responses: | ||
| '204': | ||
| description: All listed classes deleted successfully. | ||
| '400': | ||
| description: Delete failed (e.g. class not found). | ||
|
bc-vincent-zhao marked this conversation as resolved.
Outdated
|
||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '404': | ||
| description: Missing or empty `id:in` filter. | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '413': | ||
| description: More than 50 IDs. | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '422': | ||
| description: Invalid ID values in filter. | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '403': | ||
| description: Authentication or permission denied. | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
| '500': | ||
| description: Server error. | ||
| content: | ||
| application/problem+json: | ||
| schema: | ||
| $ref: '#/components/schemas/ProblemResponseEnvelope' | ||
|
|
||
| components: | ||
| securitySchemes: | ||
| X-Auth-Token: | ||
| name: X-Auth-Token | ||
| description: |- | ||
| ### OAuth scopes | ||
|
|
||
| | UI Name | Permission | Parameter | | ||
| |:--------|:-----------|:----------| | ||
| | Tax | modify | `MANAGE_TAX` | | ||
|
|
||
| ### Authentication header | ||
|
|
||
| | Header | Argument | Description | | ||
| |:-------|:---------|:------------| | ||
| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/docs/start/authentication/api-accounts). | | ||
|
|
||
| ### Further reading | ||
|
|
||
| For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/docs/start/authentication#x-auth-token-header-example-requests). | ||
|
|
||
| For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/docs/start/authentication/api-accounts#oauth-scopes). | ||
|
|
||
| For a list of API status codes, see [API Status Codes](/docs/start/about/status-codes). | ||
| type: apiKey | ||
| in: header | ||
|
|
||
| schemas: | ||
| TaxClassCreateBatch: | ||
| type: array | ||
| minItems: 1 | ||
| maxItems: 50 | ||
| items: | ||
| type: object | ||
| required: | ||
| - name | ||
| properties: | ||
| name: | ||
| type: string | ||
| minLength: 1 | ||
| maxLength: 100 | ||
| description: > | ||
| Tax class name. Must be 1–100 characters and cannot contain | ||
| < > { } ` ( ) ; |. Must be unique case-insensitively across the store | ||
| (both existing classes and the incoming batch). Conflicting names produce a 409. | ||
| additionalProperties: false | ||
|
|
||
| TaxClassUpdateBatch: | ||
| type: array | ||
| minItems: 1 | ||
| maxItems: 50 | ||
| items: | ||
| type: object | ||
| required: | ||
| - id | ||
| - name | ||
| description: | | ||
| Each item must include `id` and at least one other field. Only `name` is permitted alongside `id`. | ||
|
bc-vincent-zhao marked this conversation as resolved.
Outdated
|
||
| properties: | ||
| id: | ||
| type: integer | ||
| minimum: 1 | ||
| name: | ||
| type: string | ||
| minLength: 1 | ||
| maxLength: 100 | ||
| additionalProperties: false | ||
|
|
||
| TaxClassResource: | ||
| type: object | ||
| required: | ||
| - id | ||
| - name | ||
| - created_at | ||
| - updated_at | ||
| properties: | ||
| id: | ||
| type: integer | ||
| name: | ||
| type: string | ||
| created_at: | ||
| type: string | ||
| format: date-time | ||
| description: ISO-8601 timestamp. | ||
| updated_at: | ||
| type: string | ||
| format: date-time | ||
|
|
||
| TaxClassCollectionEnvelope: | ||
| type: object | ||
| required: | ||
| - data | ||
| - meta | ||
| properties: | ||
| data: | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/TaxClassResource' | ||
| meta: | ||
| type: object | ||
| description: Response metadata (may be an empty object). | ||
|
|
||
| Problem: | ||
| type: object | ||
| description: RFC 7807-style problem object (optional fields omitted when empty). | ||
| properties: | ||
| title: | ||
| type: string | ||
| status: | ||
| type: integer | ||
| type: | ||
| type: string | ||
| format: uri | ||
| detail: | ||
| type: string | ||
| code: | ||
| type: integer | ||
| errors: | ||
| type: object | ||
| additionalProperties: true | ||
|
|
||
| ProblemResponseEnvelope: | ||
| type: object | ||
| properties: | ||
| errors: | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/Problem' | ||
| meta: | ||
| type: object | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.