Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
feat(checkout): CHECKOUT-7918 Update docs around CRUD of gift wrappin…
Browse files Browse the repository at this point in the history
…g for storefront apis
  • Loading branch information
bc-shawnwang committed Dec 10, 2023
1 parent f1fae90 commit 5a2ad27
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 0 deletions.
80 changes: 80 additions & 0 deletions reference/carts.sf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@ paths:
- optionId: 10
optionValue: Some Text Value
locale: en
With Gift Wrapping:
value:
lineItems:
- quantity: 2
productId: 230
optionSelections:
- optionId: 10
optionValue: Some Text Value
giftWrapping:
wrapTogether: true
wrapDetails:
- id: 1
message: "Happy Birthday"
locale: en
required: true
responses:
'200':
Expand Down Expand Up @@ -155,6 +169,17 @@ paths:
optionValue: 117
- optionId: 11
optionValue: 125
With Gift Wrapping:
value:
lineItems:
- quantity: 2
productId: 230
variantId: 124
giftWrapping:
wrapTogether: true
wrapDetails:
- id: 1
message: "Happy Birthday"
description: ''
'/carts/{cartId}/items/{itemId}':
put:
Expand Down Expand Up @@ -228,6 +253,24 @@ paths:
- optionId: 125
optionValue: 127
locale: en
With Gift Wrapping:
value:
lineItem:
quantity: 2
productId: 230
variantId: 124
giftWrapping:
wrapTogether: true
wrapDetails:
- id: 1
message: "Happy Birthday"
With null Gift Wrapping (will delete current gift wrapping):
value:
lineItem:
quantity: 2
productId: 230
variantId: 124
giftWrapping: null
required: true
responses:
'200':
Expand Down Expand Up @@ -505,6 +548,39 @@ components:
type: string
description: 'Currently supports `Birthday`, `Boy`, `Celebration`, `Christmas`, `General`, and `Girl`.'
x-internal: false
requestPostOrPutGiftWrapping:
title: Gift Wrapping Request Data
required:
- wrapTogether
- wrapDetails
type: object
nullable: true
description: if passing null, it will remove the current gift wrapping for the item
properties:
wrapTogether:
type: boolean
description: Boolean value that specifies whether items whether items should be wrapped together or wrapped individually.
example: true
wrapDetails:
type: array
description: |-
Details for the gift wrapping option selected. This can be specified for each line item or together based on wrapTogether value.
If wrapTogether is false, each element in the wrapDetails array determines each item's specific wrapping.
(e.g if this line item has 6 quantity, you can pass at maximum 6 elements for the array to spefified each one's wrapping)
If wrapTogether is true, we will only use 1st element in the wrapDetails array to determine what to be wrapped
items:
type: object
required:
- id
properties:
id:
type: integer
description: Identifier of the gift wrapping option selected.
example: 0
message:
type: string
description: Custom gift message.
example: Happy Birthday
LineItemsRequest:
title: requestLineItems
oneOf:
Expand Down Expand Up @@ -920,6 +996,8 @@ components:
quantity:
type: number
description: Quantity of this item.
giftWrapping:
$ref: '#/components/schemas/requestPostOrPutGiftWrapping'
required:
- productId
- quantity
Expand All @@ -934,6 +1012,8 @@ components:
variantId:
type: number
description: ID of the variant.
giftWrapping:
$ref: '#/components/schemas/requestPostOrPutGiftWrapping'
required:
- productId
- quantity
Expand Down
35 changes: 35 additions & 0 deletions reference/checkouts.sf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3429,6 +3429,8 @@ components:
type: number
description: ''
format: double
giftWrapping:
$ref: '#/components/schemas/cartLineItemGiftWrapping_Put'
x-internal: false
cartLineItemGiftCertificate_Put:
title: cartLineItemGiftCertificate_Put
Expand Down Expand Up @@ -3461,6 +3463,39 @@ components:
description: ''
format: double
x-internal: false
cartLineItemGiftWrapping_Put:
title: Gift Wrapping Request Data
required:
- wrapTogether
- wrapDetails
type: object
nullable: true
description: if passing null, it will remove the current gift wrapping for the item
properties:
wrapTogether:
type: boolean
description: Boolean value that specifies whether items whether items should be wrapped together or wrapped individually.
example: true
wrapDetails:
type: array
description: |-
Details for the gift wrapping option selected. This can be specified for each line item or together based on wrapTogether value.
If wrapTogether is false, each element in the wrapDetails array determines each item's specific wrapping.
(e.g if this line item has 6 quantity, you can pass at maximum 6 elements for the array to spefified each one's wrapping)
If wrapTogether is true, we will only use 1st element in the wrapDetails array to determine what to be wrapped
items:
type: object
required:
- id
properties:
id:
type: integer
description: Identifier of the gift wrapping option selected.
example: 0
message:
type: string
description: Custom gift message.
example: Happy Birthday
CreateConsignmentRequest:
title: Create Consignment Request
type: object
Expand Down

0 comments on commit 5a2ad27

Please sign in to comment.