From 5a2ad271a15edb325cf3ddb12d7daff3f61848be Mon Sep 17 00:00:00 2001 From: "shawn.wang" Date: Mon, 11 Dec 2023 10:44:46 +1100 Subject: [PATCH] feat(checkout): CHECKOUT-7918 Update docs around CRUD of gift wrapping for storefront apis --- reference/carts.sf.yml | 80 ++++++++++++++++++++++++++++++++++++++ reference/checkouts.sf.yml | 35 +++++++++++++++++ 2 files changed, 115 insertions(+) diff --git a/reference/carts.sf.yml b/reference/carts.sf.yml index 88adfc22f..d04e8e3ed 100644 --- a/reference/carts.sf.yml +++ b/reference/carts.sf.yml @@ -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': @@ -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: @@ -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': @@ -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: @@ -920,6 +996,8 @@ components: quantity: type: number description: Quantity of this item. + giftWrapping: + $ref: '#/components/schemas/requestPostOrPutGiftWrapping' required: - productId - quantity @@ -934,6 +1012,8 @@ components: variantId: type: number description: ID of the variant. + giftWrapping: + $ref: '#/components/schemas/requestPostOrPutGiftWrapping' required: - productId - quantity diff --git a/reference/checkouts.sf.yml b/reference/checkouts.sf.yml index 703274778..2d72c25b2 100644 --- a/reference/checkouts.sf.yml +++ b/reference/checkouts.sf.yml @@ -3429,6 +3429,8 @@ components: type: number description: '' format: double + giftWrapping: + $ref: '#/components/schemas/cartLineItemGiftWrapping_Put' x-internal: false cartLineItemGiftCertificate_Put: title: cartLineItemGiftCertificate_Put @@ -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