Merge Bag

Description

This API is a service is used when a user is adding items to the shopping bag gets a guest shopping bag assigned to him/her with a guestBagId and guestUserId. While shopping the user decides to login to his/her Macys.com User Account. At this point the Guest Bag needs to be merged with the Macys.com User Bag.  This happens automatically on macys.com website but when using shopping bag services, this API must be used to replicate this seemless experience in your application.

NOTE: When the Guest Bag is merged, any items that were in the Authenticated User's bag prior, are moved to a place called "your saved items", which allows the customer to checkout with just the items they added when they were signed in as a guest.   If the customer decides that they want to add the other items from thier "your saved items" section you will need to make a GET bag call to pull that list and then a PATCH call to adjust the object "mergeRequiredFlag" from "false" to "true". 

Note: You must use your Protected Services Key to get a Bearer token before making this call.  Please click on the following link for more details: OAuth Flows.

back to top

HTTP Method and Request URL

POST

 https://api.macys.com/protected/order/v1/bags/merge?userGuid={userId}&guestUserGuid={guestUserId}

back to top

Path and Query Parameters

HTTP Header Parameters

Parameter

Description

Mandatory

Sample Value

Authorization
 Bearer token  (replace your token here after "Bearer") Yes  Bearer w8umyzewv6574ak7k8y9wrt3

Accept

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

Yes

application/json

Content-Type

application/json or application/xm/

Yes application/json

 

Query Parameters

Parameter Description Mandatory Sample Value
userId 
Authenticated User ID from user auth response or from add to bag response which is stored in the cookie/cache Yes, unless using userGuid's instead of userId's
7788802192
guestUserId  Guest User ID from add/create bag response which is stored also stored in the cookie/cache Yes, unless using userGuid's instead of userId's 7443941586
userGuid Authenticated User Guid from user auth response or from add to bag response which is stored in the cookie/cache
Yes, unless using userId's instead of userGuid's d0b93f0e-7b0d-4775-8fa7-d47a15951558
guestUserGuid Guest User Guid from add/create bag response which is stored also stored in the cookie/cache Yes, unless using userId's instead of userGuid's a4f23d1w-8b1s-8562-7gs3-af2a15241856

back to top

Sample Requests and Responses

Sample Request

Request URL:

POST

https://api.macys.com/protected/order/v1/bags/merge?userGuid=d0b93f0e-7b0d-4775-8fa7-d47a15951558&guestUserGuid=92c7f0e8-fc74-4459-92d5-aa620c54dfc8

Sample Header:

Authorization: Bearer w8umyzewv6574ak7k8y9wrt3
Accept: application/json
Content-Type: application/json

Sample Response

Status: 204 No Content 

Response does not contain any data.

back to top

Error Codes

Call Specific Error Codes:

NONE

General Error Handling Documentation:

back to to

Docs Navigation