Credit Card Validation
There are essentially three calls necessary for checkout:
http://developer.macys.com/docs/order/checkout_v1_guest_checkout/Initiate_Checkout/
http://developer.macys.com/docs/order/checkout_v1_guest_checkout/Process_Order/
http://developer.macys.com/docs/order/checkout_v1_guest_checkout/Place_Order/
In the second steps, process order, the request body has the following data in the documentation
HTTP Method and Request URL
POST
https://api.macys.com/order/v1/checkout/process
Sample Requests and Responses
Request URL:
POST
https://api.macys.com/order/v1/checkout/process
Sample Header:
Request Body(Payload)
{ "order": { "number": "663404032123", "userId": "2158067016", "orderGuid": "1d400c6c-3f03-4964-aef7-7bcdc0da22a0", "context": { "channel": "xxxx", "clientId": "xxxx", "deviceInfo": "xx", "ipAddress": "xxx", "itemOrigin": "xx", "storeAssociatedId": "xx", "storeLocationNumber": "xxx", "subClientId": "xxx" }, "shipments": [ { "shippingContact": { "address": { "addressLine1": "500 S.Karaemer Boulevard", "city": "Brea", "state": "CA", "country": "USA", "countryCode": "USA", "postalCode": "82812", "validatedFlag": "true" }, "firstName": "First", "lastName": "Last", "dayPhone": "4326365427" }, "shippingMethod": "G" } ], "payment": { "tenders": [ { "alreadyValidate": "true", "cardNumber": "1234123412341234", "cvv": "1004", "expirationMonth": "3", "expirationYear": "2099", "type": "A" }, { "balance": "10.00", "cardNumber": "667100000040408460", "type": "A" } ], "contact": { "address": { "addressLine1": "500 S.Karaemer Boulevard", "city": "Brea", "state": "CA", "country": "USA", "postalCode": "88888", "validatedFlag": "true" }, "firstName": "Firstpayment", "lastName": "Lastpayment", "dayPhone": "5556365428", "emailAddress": "testuser@macys.com" } } } }
The flag ‘alreadyValidate’, if set to true (as in the above example) will skip validation of credit card details in the process order step (2). This will eventually catch the error in the third step place order.
For our needs, to catch these validation errors earlier, we are able to set the flag ‘alreadyValidate’ to false and see validation errors in step 2 itself. We then are able to make a call to the third step once all the errors are corrected.
Docs Navigation
- Overview
- Customer Services
- Common API Characteristics
- Ad Media
- Catalog Services
- Order Services
- Mobile Utilities
- Promotion and Coupon Services
- Registry Services
- Review Services
- Store Services
- User Services
- Error Handling
- Deprecated Services
- Macy's API FAQ
- BOPS Stores
- What's New