How to add Shipping/Billing Address through API

Hi,
Im trying to create Orders through API and I need to add a Shipping and Billing Address, but there is no such fields in the Users/Order entity, it gets the fields of the profile through functions.
But since Im using a custom Storefront, I dont get to create a profile and API does not have access to one.
My question is, do I have to create a new entity myself for profiles or is there any workaround?
Im not using “User Data” because later I want my users to be able to retrieve their orders, get notifications etc.
Thanks in advance!

Hello,

Please check documentation here → Orders — CS-Cart 4.16.x documentation

"user_data": {
  "email": "email@example.com",
  "b_firstname": "John",
  "b_lastname": "Doe",
  "b_address": "44 Main street",
  "b_city": "Boston",
  "b_state": "MA",
  "b_country": "US",
  "b_zipcode": "02134",
  "b_phone": "",
  "s_firstname": "John",
  "s_lastname": "Doe",
  "s_address": "44 Main street",
  "s_city": "Boston",
  "s_state": "MA",
  "s_country": "US",
  "s_zipcode": "02134",
  "s_phone": ""
}

b_ → used for billing_
s_ → used for shipping_

If I can be of assistance, please do not hesitate to contact me.

1 Like

Hi, thanks for answering.
I already saw that, problem is that I dont think that then I can filter by the orders that a customer does with this method.
In the end, I made an Endpoint for Profiles, I dont know if this is going to be the correct way of doing this.

Best Regards.

1 Like