Set the gift message for a specified item in a specified shopping cart

POST /V1/carts/mine/gift-message/{itemId}

Set the gift message for a specified item in a specified shopping cart.

Path parameters

  • itemId integer Required

    The item ID.

Body

  • giftMessage object Required

    Interface MessageInterface

    Hide giftMessage attributes Show giftMessage attributes object
    • gift_message_id integer

      Gift message ID. Otherwise, null.

    • customer_id integer

      Customer ID. Otherwise, null.

    • sender string Required

      Sender name.

    • recipient string Required

      Recipient name.

    • message string Required

      Message text.

    • extension_attributes object

      ExtensionInterface class for @see \Magento\GiftMessage\Api\Data\MessageInterface

      Hide extension_attributes attributes Show extension_attributes attributes object
      • entity_id string
      • entity_type string
      • wrapping_id integer
      • wrapping_allow_gift_receipt boolean
      • wrapping_add_printed_card boolean

Responses

  • 200

    200 Success.

  • 401

    401 Unauthorized

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

  • 400

    400 Bad Request

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

  • default

    Unexpected error

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

POST /V1/carts/mine/gift-message/{itemId}
curl \
 --request POST 'https://magento2.winkelstraat.mac/rest/all/V1/carts/mine/gift-message/{itemId}' \
 --data '{"giftMessage":{"gift_message_id":42,"customer_id":42,"sender":"string","recipient":"string","message":"string","extension_attributes":{"entity_id":"string","entity_type":"string","wrapping_id":42,"wrapping_allow_gift_receipt":true,"wrapping_add_printed_card":true}}}'
Request examples
{
  "giftMessage": {
    "gift_message_id": 42,
    "customer_id": 42,
    "sender": "string",
    "recipient": "string",
    "message": "string",
    "extension_attributes": {
      "entity_id": "string",
      "entity_type": "string",
      "wrapping_id": 42,
      "wrapping_allow_gift_receipt": true,
      "wrapping_add_printed_card": true
    }
  }
}
Response examples (200)
true
Response examples (401)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}
Response examples (400)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}
Response examples (default)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}