• Register

Add to Bag

Description

This service enables users to add items to shopping bag for a user. It enables the user to add an item to the shopping bag with each request.

NOTE: If no user or bag is specified when adding an item, a guest bag/user is created. If you want to merge your guest bag with a specific user account, use Merge Bag.

 

back to top

HTTP Method and Request URL

POST

https://api.macys.com/order/v1/bags

back to top

HTTP, Path and Query Parameters

HTTP Header Parameters

Parameter Description Mandatory Sample Value
x-macys-webservice-client-id Pass the apikey as a header value which is called x-macys-webservice-client-id. The api key is the 24 character alphanumeric string assigned to your application when you registered it. Click here for a list of your API keys. Yes

xmj9js4jkdpe1983fmwu98gh

Accept Specifies the output format. Can be application/json or application/xml. Yes

application/json

application/xml

Cookie The cookie macys_online_uid needs to be set with the user id of the macys.com customer. Either this or UserID (guest id) param is required  macys_online_uid=user_id (macys.com)
Content-Type Specifies the format of body sent. Can be application/json or application/xml. Yes

application/json

application/xml

Query Parameters

Parameter Description Mandatory Sample Value
userId 
User ID from user auth response or from add to bag response which is stored in the cookie/cache Yes, if bagGuid/bagId
7788802192
userGuid GUID currently does not work on the API No d0b93f0e-7b0d-4775-8fa7-d47a15951558

Query Parameters

Parameter Description Mandatory Sample Value
userId 
User ID from user auth response or from add to bag response which is stored in the cookie/cache If bagId,userGuid, or bagGuid is not provided userId must be provided. 7788802192
userGuid GUID currently does not work on the API If bagId, userId, or bagGuid is not provided userGuid must be provided.  d0b93f0e-7b0d-4775-8fa7-d47a15951558
promocode Promotion code to be applied on the item/bag should be cached in the app when entered & used when GET shoppingbag is invoked No SHADES
bagOptions A list of bag options strings to get more data about bag example: "bagOptions=INCLUDE_SAVED_BAG" 
No INCLUDE_SAVED_BAG 
INCLUDE_PRODUCTINFO 
storeLocNumber The location number of the store you would like to see product availability for. No 73
cardType Certain promotions or offers are returned depending on the Credit Card type that will be used. Click here to get the full list. No Y
registryId This is used if you are adding an item to your bag that belongs to a registry. Registry options will be provided if this ID is provided. No 73
scanStoreLocationNumber The location number of the store your scaning from.  (Typically used with an application that can scan bar codes) This parameter is used to see if the user qualifies for any store promotions or discounts. No true
channelType This is the channel of the application calling the service. Currently Mobile is the only valid channel. No Mobile

Request Body Parameters
Parameter Description Mandatory Sample Value
upcId UPC ID that identifies the item  Yes, if UPC Number not entered 
 3174
pWPIndicator PWP (Purchase with a Purchase) indicator.  When adding a PWP to your bag this must be set to "true" No true
promotionid Promotion ID.  This must be present when adding a PWP to the bag
No 19825999
Quantity Quantity of the item selected  Yes  1
promocode Promotion code to be applied on the item/bag  No  
RegistryID If an item from the registry is selected, add registry ID  No  
WIshlistID If an item from a wishlist is selected, add registry ID  No  
customprice value of the gift card & only applicable for VGC/EGC  No  
syndicationitemid Only applicable for EGC  No  
recipientemail Recipients email for VGC  No  
from Name of user to be used in gift card subject  No  
message Gift card message  No  
to Recipients name  No  

 

back to top

Sample Requests and Responses

Sample Request

Request URL:

POST

 https://api.macys.com/order/v1/bags?userGuid=dec5963d-7449-4172-a490-254b99f100ca

Sample Header:

X-Macys-Webservice-Client-Id: xmj9js4jkdpe1983fmwu98gh
Accept: application/json
Content-type: application/json

Request Body(Payload)

{
  "item": {
    "quantity": "1",
    "upcId": "185213"
  }
}

Sample Response

{
    "bag": {
        "bagId": 431351478,
        "bagGUID": "8709998e-a5ca-445f-af57-5c2c102ddbef",
        "storeLocationNumber": 0,
        "owner": {
            "userId": 9518755051,
            "userGuid": "dec5963d-7449-4172-a490-254b99f100ca",
            "bccUser": false,
            "userRegistryId": 0
        },
        "shippingSummary": {
            "discount": 0,
            "method": "G",
            "standardCharges": 0,
            "standardChargesBeforeDicsount": 0,
            "surcharges": 0,
            "total": 0
        },
        "bagSummary": {
            "estimatedTax": 42,
            "itemCount": 2,
            "grandTotal": 741.98,
            "merchandiseTotal": 699.98,
            "totalPersonalizationFee": 0,
            "totalSaved": 300,
            "yaqAmount": 0
        },
        "promotions": [],
        "items": [
            {
                "autoAddChoice": "ADD",
                "discount": 300,
                "giftCardAmount": 0,
                "giftId": 0,
                "personalizationFlag": false,
                "gwpItemFlag": false,
                "isItemFromWishList": false,
                "pwpItemFlag": false,
                "specialItemFlag": false,
                "itemTotal": 699.98,
                "mergeRequiredFlag": false,
                "originalPrice": 499.99,
                "personalizationFee": 0,
                "pickupRegistryApplicable": true,
                "pickUpFromStore": false,
                "promotionId": 0,
                "wishListId": 0,
                "quantity": 2,
                "retailPrice": 349.99,
                "sequenceNumber": 1,
                "siteAvailablilityFlag": true,
                "surcharges": 0,
                "productId": 77589,
                "upcId": 185213,
                "upcNumber": "50946872827",
                "uycTotalDiscountedPrice": 0,
                "uycDiscountedPercentage": 0,
                "uycPercentDiscount": 0
            }
        ],
        "promotionOffers": [],
        "uycApplicable": false
    }
}

back to top

Error Codes

Call Specific Error Codes:

 

General Error Handling Documentation:

Click Here

back to top

Docs Navigation