Page 1 of 1

How JSON format for calling Checking out REST Api looks like

Posted: Tue Apr 09, 2013 12:38 pm
by xlives
I have followed setting up Broadleaf to make it running by following its documentation (http://docs.broadleafcommerce.org/current/REST-Tutorials.html). I wanted to do checking out the cart using REST Api; that's, /cart/checkout. Therefore, I looked inside the code in order to understand how the JSON format being sent will look alike. By looking through the code, I found that it is required to pass the JSON data as shown following:

Code: Select all

{
   "paymentInfo": {
      "id": ,
      "orderId": ,
      "type": ,
      "address": {
         "id":
         "firstname":
         "lastname":
         "addressLine1":
         "addressLine2":
         "city":
         "state":
         "country":
         "postalCode":
         
      },
      "phone": "",
      "additionalFields": "",
      "amount": "",
      "amountItems": "",
      "customerIpAddress": "",
      "referenceNumber": ""
   },
   "referenced": {
      "id": "",
      "referenceNumber": "",
      "type": "",
      "pan": "",
      "cvvCode:" "",
      "expirationMonth": "",
      "expirationYear": "",
      "accountNumber": "",
      "routingNumber": "",
      "pin": ""
   }
}


However, I have no idea such the JSON data looks like. Therefore, if anyone who has ever used the api, please help me by showing an example of data in order to make the request. Looking forward to the answers.

Thanks in advance.

Re: How JSON format for calling Checking out REST Api looks like

Posted: Thu Jun 20, 2013 7:09 pm
by ktisdell
We are working on making the documentation better. But please understand that this is totally customizable by you. Broadleaf Commerce is a framework to allow you to build an eCommerce site the way that you want it to behave. That said, you may wish to completely override the REST endpoints that we provide. This is quite possible. So, we will try to provide better documentation around the default REST APIs. But ultimately, the behavior REST APIs will be defined by you.

Re: How JSON format for calling Checking out REST Api looks like

Posted: Wed Sep 04, 2013 1:38 pm
by edwardbc2481
The REST Tutorials link appears to be failing is there any way to get access to this documentation?

I was attempting to implement basic functionality using methods found in the CartEndpoint.java but run into errors around orderService, offerService, customerService not being instantiated when it calls the methods in CartEndpoint.class.

Hoping the tutorials will provide more insight.

Re: How JSON format for calling Checking out REST Api looks like

Posted: Sat Aug 09, 2014 10:50 pm
by ryanhulse
xlives, if you ever want to see how the json is structured, you can always paste it into json-csv.com and it will give you a better idea.

Re: How JSON format for calling Checking out REST Api looks like

Posted: Thu Aug 14, 2014 10:14 pm
by phillipuniverse