/
product-variants_catalog.v3.yml
3126 lines (3075 loc) · 125 KB
/
product-variants_catalog.v3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: '3.0.3'
info:
title: Catalog - Product variants
description: |-
> The Catalog API manages products, categories, brands, bulk pricing rules, and more. To learn more about catalog resources, see the [Catalog Overview](/docs/store-operations/catalog).
A product variant is a version of a product that has its own SKU. For example, a catalog might model a particular style of high-top sneakers that come in both red and blue as one product - high-tops - with two variants - red and blue. From a storefront point of view, product variants are often what shoppers seek. They are also the object that maps to SKUs and tracks inventory. A product with one only variant is a _base variant_.
Our Catalog product variants endpoints let you work in two ways.
On a per-product basis, you can [create and manage product variants](/docs/rest-catalog/product-variants), their [images](/docs/rest-catalog/product-variants/images), and their [metafields](/docs/rest-catalog/product-variants/metafields), which are arbitrary key-value attributes.
By design, product variants consist of a combination of [product variant option values](/docs/rest-catalog/product-variant-options/values).
This API family also provides endpoints that can make [batch updates](/docs/rest-catalog/product-variants/variants-batch#update-variants-batch) to product variants from different products across the Catalog, as well as [getting all variants](/docs/rest-catalog/product-variants/variants-batch#get-all-variants).
The terms "product variant" and "variant" are used interchangeably throughout the documentation.
> To learn more about authenticating Catalog endpoints, locate the **Authentication** section at the top of each endpoint, then click **Show Details**.
## Resources
### Webhooks
Learn more about [Product webhook events](/docs/integrations/webhooks/events#products).
### Additional Catalog endpoints
* [Brands](/docs/rest-catalog/brands)
* [Categories](/docs/rest-catalog/categories)
* [Category trees](/docs/rest-catalog/category-trees)
* [Products](/docs/rest-catalog/products)
* [Product modifiers](/docs/rest-catalog/product-modifiers)
* [Product variant options](/docs/rest-catalog/product-variant-options)
termsOfService: 'https://www.bigcommerce.com/terms'
contact:
name: BigCommerce
url: 'https://www.bigcommerce.com'
email: support@bigcommerce.com
version: ''
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: Batch metafields
- name: Product variants
- name: Variants (Batch)
- name: Metafields
- name: Images
paths:
'/catalog/products/{product_id}/variants':
get:
tags:
- Product variants
summary: Get all product variants
description: Returns a list of product variants. Optional parameters can be passed in.
operationId: getProductVariants
parameters:
- $ref: '#/components/parameters/IncludeFieldsParam'
- $ref: '#/components/parameters/ExcludeFieldsParam'
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/LimitParam'
responses:
'200':
description: ''
content:
application/json:
schema:
title: Variant Collection Response
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/productVariant_Full'
meta:
$ref: '#/components/schemas/metaCollection_Full'
example:
data:
- id: 382
product_id: 192
sku: SMIT
sku_id: 348
price: 10
calculated_price: 10
sale_price: 8
retail_price: 10
map_price: {}
weight: 4
calculated_weight: 2
width: 5
height: 5
depth: 5
is_free_shipping: false
fixed_cost_shipping_price: 10
purchasing_disabled: false
purchasing_disabled_message: ''
image_url: ''
cost_price: 0
upc: ''
mpn: ''
gtin: ''
inventory_level: 0
inventory_warning_level: 0
bin_picking_number: ''
option_values:
- id: 174
label: Beige
option_id: 220
option_display_name: Color
- id: 383
product_id: 192
sku: SMIT-1
sku_id: 349
price: 25
calculated_price: 25
sale_price: 20
retail_price: 25
map_price: {}
weight: 2
calculated_weight: 1
width: 5
height: 5
depth: 5
is_free_shipping: false
fixed_cost_shipping_price: 10
purchasing_disabled: false
purchasing_disabled_message: ''
image_url: ''
cost_price: 25
upc: ''
mpn: ''
gtin: ''
inventory_level: 0
inventory_warning_level: 0
bin_picking_number: ''
option_values:
- id: 175
label: Grey
option_id: 220
option_display_name: Color
- id: 384
product_id: 192
sku: SMIT-2
sku_id: 350
price: 25
calculated_price: 25
sale_price: 20
retail_price: 25
map_price: {}
weight: 2
calculated_weight: 1
width: 5
height: 5
depth: 5
is_free_shipping: false
fixed_cost_shipping_price: 10
purchasing_disabled: false
purchasing_disabled_message: ''
image_url: ''
cost_price: 25
upc: ''
mpn: ''
gtin: ''
inventory_level: 0
inventory_warning_level: 0
bin_picking_number: ''
option_values:
- id: 176
label: Black
option_id: 220
option_display_name: Color
meta:
pagination:
total: 3
count: 3
per_page: 50
current_page: 1
total_pages: 1
links:
current: '?page=1&limit=50'
'404':
description: |
The resource was not found.
content:
application/json:
schema:
title: Not Found
type: object
properties:
status:
type: integer
description: |
404 HTTP status code.
title:
type: string
description: The error title describing the particular error.
type:
type: string
instance:
type: string
description: Error payload for the BigCommerce API.
post:
tags:
- Product variants
summary: Create a product variant
description: |-
Creates a product variant.
**Required Fields**
* sku
* option_values
**Read-Only Fields**
* id
**Limits**
* 600 SKUs per product limit.
* 255 characters SKU length limit.
Variants need to be created one at a time using this endpoint. To use a variant array, create products, and variants in the same call use the [Create Products](/docs/rest-catalog/products#create-a-product) endpoint during the initial product creation.
operationId: createProductVariant
parameters:
- $ref: '#/components/parameters/ContentType'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/productVariant_Post'
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
title: Variant Response
type: object
properties:
data:
$ref: '#/components/schemas/productVariant_Full'
meta:
$ref: '#/components/schemas/metaEmpty_Full'
examples:
example-1:
value:
data:
cost_price: 0
price: 0
sale_price: 0
retail_price: 0
weight: 0
width: 0
height: 0
depth: 0
is_free_shipping: true
fixed_cost_shipping_price: 0
purchasing_disabled: true
purchasing_disabled_message: string
image_url: string
upc: string
inventory_level: 0
inventory_warning_level: 0
bin_picking_number: string
mpn: string
gtin: '012345678905'
id: 0
product_id: 0
sku: string
sku_id: 0
option_values:
- option_display_name: Color
label: Beige
id: 146
option_id: 151
calculated_price: 0
calculated_weight: 0
meta: {}
example-2:
value:
data:
id: 384
product_id: 192
sku: SMIT-2
sku_id: 350
price: 25
calculated_price: 25
sale_price: 20
retail_price: 25
map_price: {}
weight: 2
calculated_weight: 1
width: 5
height: 5
depth: 5
is_free_shipping: false
fixed_cost_shipping_price: 10
purchasing_disabled: false
purchasing_disabled_message: ''
image_url: ''
cost_price: 25
upc: ''
mpn: ''
gtin: ''
inventory_level: 0
inventory_warning_level: 0
bin_picking_number: ''
option_values:
- id: 176
label: Black
option_id: 220
option_display_name: Color
meta: {}
'207':
description: |-
Multi-status. The product information was updated successfully, but the inventory data failed to update.
Verify that the inventory-related updates are well-formed and correct; for example, that they donʼt result in negative stock levels. Then consider updating the inventory data again.
content:
application/json:
schema:
$ref: '#/components/schemas/MultiStatus'
'404':
description: |
The resource was not found.
content:
application/json:
schema:
title: Not Found
type: object
properties:
status:
type: integer
description: |
404 HTTP status code.
title:
type: string
description: The error title describing the particular error.
type:
type: string
instance:
type: string
description: Error payload for the BigCommerce API.
x-codegen-request-body-name: Variant
parameters:
- $ref: '#/components/parameters/Accept'
- $ref: '#/components/parameters/ProductIdPathParam'
'/catalog/products/{product_id}/variants/{variant_id}':
get:
tags:
- Product variants
summary: Get a product variant
description: Returns a single product variant. Optional parameters can be passed in.
operationId: getProductVariant
parameters:
- $ref: '#/components/parameters/IncludeFieldsParam'
- $ref: '#/components/parameters/ExcludeFieldsParam'
responses:
'200':
description: ''
content:
application/json:
schema:
title: Variant Response
type: object
properties:
data:
$ref: '#/components/schemas/productVariant_Full'
meta:
$ref: '#/components/schemas/metaEmpty_Full'
example:
data:
id: 384
product_id: 192
sku: SMIT-2
sku_id: 350
price: 25
calculated_price: 25
sale_price: 20
retail_price: 25
map_price: {}
weight: 2
calculated_weight: 1
width: 5
height: 5
depth: 5
is_free_shipping: false
fixed_cost_shipping_price: 10
purchasing_disabled: false
purchasing_disabled_message: ''
image_url: ''
cost_price: 25
upc: ''
mpn: ''
gtin: ''
inventory_level: 0
inventory_warning_level: 0
bin_picking_number: ''
option_values:
- id: 176
label: Black
option_id: 220
option_display_name: Color
meta: {}
'404':
description: |
The resource was not found.
content:
application/json:
schema:
title: Not Found
type: object
properties:
status:
type: integer
description: |
404 HTTP status code.
title:
type: string
description: The error title describing the particular error.
type:
type: string
instance:
type: string
description: Error payload for the BigCommerce API.
put:
tags:
- Product variants
summary: Update a product variant
description: Updates a product variant.
operationId: updateProductVariant
parameters:
- $ref: '#/components/parameters/ContentType'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/productVariant_Put'
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
title: Variant Response
type: object
properties:
data:
$ref: '#/components/schemas/productVariant_Full'
meta:
$ref: '#/components/schemas/metaEmpty_Full'
example:
data:
bin_picking_number: '0'
calculated_price: 85
calculated_weight: 1
cost_price: 0
depth: 22
fixed_cost_shipping_price: 0
gtin: ''
height: 14.6
id: 65
inventory_level: 0
inventory_warning_level: 0
is_free_shipping: false
map_price: 0
mpn: TR-SML02
option_values: []
price: 89
product_id: 81
purchasing_disabled: true
purchasing_disabled_message: This item is not available.
retail_price: 89
sale_price: 85
sku: OTS
sku_id: 10
upc: ''
weight: 1
width: 2
meta: {}
'207':
description: |-
Multi-status. The product information was updated successfully, but the inventory data failed to update.
Verify that the inventory-related updates are well-formed and correct; for example, that they donʼt result in negative stock levels. Then consider updating the inventory data again.
content:
application/json:
schema:
$ref: '#/components/schemas/MultiStatus'
'404':
description: |
The resource was not found.
content:
application/json:
schema:
title: Not Found
type: object
properties:
status:
type: integer
description: |
404 HTTP status code.
title:
type: string
description: The error title describing the particular error.
type:
type: string
instance:
type: string
description: Error payload for the BigCommerce API.
x-codegen-request-body-name: Variant
delete:
tags:
- Product variants
summary: Delete a product variant
description: Deletes a product variant.
operationId: deleteProductVariant
responses:
'204':
description: ''
content: {}
parameters:
- $ref: '#/components/parameters/Accept'
- $ref: '#/components/parameters/ProductIdPathParam'
- $ref: '#/components/parameters/VariantIdParam'
'/catalog/products/{product_id}/variants/{variant_id}/metafields':
get:
tags:
- Metafields
summary: Get Product Variant Metafields
description: Returns a list of product variant *Metafields*. Optional parameters can be passed in.
operationId: getProductVariantMetafields
parameters:
- $ref: '#/components/parameters/IncludeFieldsParam'
- $ref: '#/components/parameters/ExcludeFieldsParam'
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/LimitParam'
- $ref: '#/components/parameters/MetafieldKeyParam'
- $ref: '#/components/parameters/MetafieldNamespaceParam'
responses:
'200':
description: ''
content:
application/json:
schema:
title: Meta Field Collection Response
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/metafield_Full'
meta:
$ref: '#/components/schemas/categoriesTree_Resp'
post:
tags:
- Metafields
summary: Create a Product Variant Metafield
description: |-
Creates a product variant *Metafield*.
**Required Fields:**
* permission_set
* namespace
* key
* value
**Read-Only Fields**
* id
**Note:** The maxiumum number of metafields allowed on each order, product, category, variant, or brand is 250 per client ID. For more information, see [Platform Limits](https://support.bigcommerce.com/s/article/Platform-Limits) in the Help Center.
operationId: createProductVariantMetafield
parameters:
- $ref: '#/components/parameters/ContentType'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/metafield_Base'
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
title: Metafield Response
type: object
properties:
data:
$ref: '#/components/schemas/metafield_Full'
meta:
$ref: '#/components/schemas/metaEmpty_Full'
example:
data:
id: 4
key: location_id
value: 'Shelf 3, Bin 5'
namespace: App Namespace
permission_set: app_only
resource_type: variant
resource_id: 137
description: Where products are located
date_created: '2021-08-06T19:15:35+00:00'
date_modified: '2021-08-06T19:15:35+00:00'
meta: {}
'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
'409':
description: |
The `Metafield` was in conflict with another `Metafield`. This can be the result of duplicate unique-key combinations of the appʼs client id, namespace, key, resource_type, and resource_id.
content:
application/json:
schema:
title: Error Response
type: object
properties:
errors:
title: Detailed Errors
type: object
properties: {}
additionalProperties: true
instance:
type: string
status:
type: integer
description: |
The HTTP status code.
title:
type: string
description: |
The error title describing the particular error.
type:
type: string
'422':
description: |
The `Metafield` was not valid. This is the result of missing required fields, or of invalid data. See the response for more details.
content:
application/json:
schema:
title: Error Response
type: object
properties:
errors:
title: Detailed Errors
type: object
properties: {}
additionalProperties: true
instance:
type: string
status:
type: integer
description: |
The HTTP status code.
title:
type: string
description: |
The error title describing the particular error.
type:
type: string
x-codegen-request-body-name: Metafield
parameters:
- $ref: '#/components/parameters/Accept'
- $ref: '#/components/parameters/ProductIdPathParam'
- $ref: '#/components/parameters/VariantIdParam'
'/catalog/products/{product_id}/variants/{variant_id}/metafields/{metafield_id}':
get:
tags:
- Metafields
summary: Get a Product Variant Metafields
description: Returns a single product variant *Metafield*. Optional parameters can be passed in.
operationId: getProductVariantMetafield
parameters:
- $ref: '#/components/parameters/IncludeFieldsParam'
- $ref: '#/components/parameters/ExcludeFieldsParam'
responses:
'200':
description: ''
content:
application/json:
schema:
title: Metafield Response
type: object
properties:
data:
$ref: '#/components/schemas/metafield_Full'
meta:
$ref: '#/components/schemas/metaEmpty_Full'
example:
data:
id: 8
key: location_id
value: 'Shelf 3, Bin 5'
namespace: Inventory Namespace
permission_set: read
resource_type: variant
resource_id: 158
description: Where products are located
date_created: '2018-09-13T16:42:37+00:00'
date_modified: '2018-09-13T16:42:37+00:00'
meta: {}
'404':
description: |
The resource was not found.
content:
application/json:
schema:
title: Not Found
type: object
properties:
status:
type: integer
description: |
404 HTTP status code.
title:
type: string
description: The error title describing the particular error.
type:
type: string
instance:
type: string
description: Error payload for the BigCommerce API.
put:
tags:
- Metafields
summary: Update Product Variant Metafields
description: "Updates a product variant *Metafield*.\n\n**Required Fields:**\n* none\n\n**Read-Only Fields**\n* id\n* These fields can only be modified by the app (API credentials) that created the metafield:\n\t* namespace\n\t* key\n\t* permission_set\n\n**Usage Notes**\n* Attempting to modify `namespace`, `key`, and `permission_set` fields using a client ID different from the one used to create those metafields will result in a 403 error message. "
operationId: updateProductVariantMetafield
parameters:
- $ref: '#/components/parameters/ContentType'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/metafield_Base'
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
title: Metafield Response
type: object
properties:
data:
$ref: '#/components/schemas/metafield_Full'
meta:
$ref: '#/components/schemas/metaEmpty_Full'
example:
data:
id: 8
key: location_id
value: 'Shelf 3, Bin 5'
namespace: Inventory Namespace
permission_set: read
resource_type: variant
resource_id: 158
description: Where products are located
date_created: '2018-09-13T16:42:37+00:00'
date_modified: '2018-09-13T16:42:37+00:00'
meta: {}
'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
'404':
description: |
The resource was not found.
content:
application/json:
schema:
title: Not Found
type: object
properties:
status:
type: integer
description: |
404 HTTP status code.
title:
type: string
description: The error title describing the particular error.
type:
type: string
instance:
type: string
description: Error payload for the BigCommerce API.
x-codegen-request-body-name: Metafield
delete:
tags:
- Metafields
summary: Delete a Product Variant Metafield
description: Deletes a product variant *Metafield*.
operationId: deleteProductVariantMetafield
responses:
'204':
description: ''
content: {}
'404':
description: |
The resource was not found.
content:
application/json:
schema:
title: Not Found
type: object
properties:
status:
type: integer
description: |
404 HTTP status code.
title:
type: string
description: The error title describing the particular error.
type:
type: string
instance:
type: string
description: Error payload for the BigCommerce API.
parameters:
- $ref: '#/components/parameters/Accept'
- $ref: '#/components/parameters/ProductIdPathParam'
- $ref: '#/components/parameters/VariantIdParam'
- $ref: '#/components/parameters/MetafieldIdParam'
'/catalog/products/{product_id}/variants/{variant_id}/image':
post:
tags:
- Images
summary: Create a Product Variant Image
description: |-
Creates a *Variant Image*.
Only one image can be explicitly associated with a Variant. If the Variant already has an associated image, overwrites the existing Variant Image.
The image displays on the storefront when the Variant is selected.
**Required Fields**
- image_file: Form posts. Files larger than 1 MB are not accepted
- image_url: Any publicly available URL
operationId: createProductVariantImage
parameters:
- $ref: '#/components/parameters/ContentType'
requestBody:
content:
application/json:
schema:
type: object
properties:
image_url:
type: string
description: |
A public URL for a GIF, JPEG, or PNG image. Limit of 8MB per file.
description: 'An object containing a publicly accessible image URL, or a form post that contains an image file.'
multipart/form-data:
schema:
type: object
properties:
image_url:
type: string
description: |
A public URL for a GIF, JPEG, or PNG image. Limit of 8MB per file.
description: 'An object containing a publicly accessible image URL, or a form post that contains an image file.'
required: false
responses:
'200':
description: '`image_url` is returned for both `image_file` and `image_url`.'
content:
application/json:
schema:
title: Image Response
type: object
properties:
data:
title: Resource Image
type: object
properties:
image_url:
type: string
description: |
A public URL for a GIF, JPEG, or PNG image. Limit of 8MB per file.
description: 'An object containing a publicly accessible image URL, or a form post that contains an image file.'
meta:
$ref: '#/components/schemas/metaEmpty_Full'
description: |-
Image Response returns for:
* Create Variant Image
* Create Modifier Image
* Create Category Image
* Create Brand Image
example:
data:
image_url: 'https://cdn8.bigcommerce.com/s-id30h7ohwf/product_images/attribute_rule_images/85_source_1536863430.png'
meta: {}
'400':
description: Bad Request. The requested resource could not be downloaded and may be invalid. Possible reasons include malformed request syntax or the file host blocking requests.
content:
application/json:
schema:
type: object
properties: {}
'404':
description: |
The resource was not found.
content:
application/json:
schema:
title: Not Found
type: object
properties:
status:
type: integer
description: |
404 HTTP status code.
title:
type: string
description: The error title describing the particular error.
type:
type: string
instance:
type: string
description: Error payload for the BigCommerce API.
'422':
description: |
Image was not valid. This is the result of a missing `image_file` field or of an incorrect file type. See the response for more details.
content:
application/json:
schema:
title: Error Response
type: object
properties:
errors:
title: Detailed Errors
type: object
properties: {}
additionalProperties: true
instance:
type: string
status:
type: integer
description: |
The HTTP status code.
title:
type: string
description: |
The error title describing the particular error.
type:
type: string
'500':
description: Returns for an `image_file` larger than 1 MB.
content:
application/json:
schema: