How To Get Name Of The Order Custom Fields From Api

Hello! I have a problem with a field from getorders method by id. from api!

In response of that method, i have a field called "fields" where it is custom fields that are set in my account. But in this array, i have the id of the field and it's value.

How can i get the name of the field with that id?

Thanks!

Have a nice day!

Hello Daniel

The profile fields are fixed, you set them at the beginning and are unlikely to change. In your script where you use the API, you should, for example, assign the profile field names to the id in the table and use it in this way.
Alternatively, write an addon that will extend the standard API Multi-Vendor/CS-Cart and will allow you to get a profile field.
Best regards
Robert

Hello Daniel

The profile fields are fixed, you set them at the beginning and are unlikely to change. In your script where you use the API, you should, for example, assign the profile field names to the id in the table and use it in this way.
Alternatively, write an addon that will extend the standard API Multi-Vendor/CS-Cart and will allow you to get a profile field.
Best regards
Robert

Thanks for response, but, which table are you reffering to -- "assign the profile field names to the id in the table and use it in this way" ?

Thanks for response Robert, but i didn't understand it, totally. So, there is no way to "decode" the id's of the profile fields from api? I mean to get the names of the profile fields, in response?

My second question is how can i know if an order was made by a legal person or by a individual person? What fields are different?

This is why i ask abut profile fields, because the the solution for that problem, in my mind, was to create new custom profile fields, to get the company details of client, if it is a legal person.

Thanks!

Thanks for response Robert, but i didn't understand it, totally. So, there is no way to "decode" the id's of the profile fields from api? I mean to get the names of the profile fields, in response?

My second question is how can i know if an order was made by a legal person or by a individual person? What fields are different?

This is why i ask abut profile fields, because the the solution for that problem, in my mind, was to create new custom profile fields, to get the company details of client, if it is a legal person.

Thanks!

Hello,

By default, it's not possible. The orders endpoint returns only IDs of profile fields, and there's no way to pull profile field names instead.

There are two ways to change that, both requiring a custom development:

1. I assume that you have some kind of script that pulls orders from CS-Cart through API. You can create a side table containing information about profile fields (ex. profile field 38 contains information about Tax ID) and use it after pulling orders.

2. You can create a new endpoint in CS-Cart API which will return basically the same order structure, but with profile field names replacing the profile field IDs.

Best regards,

Robert

Hello,

By default, it's not possible. The orders endpoint returns only IDs of profile fields, and there's no way to pull profile field names instead.

There are two ways to change that, both requiring a custom development:

1. I assume that you have some kind of script that pulls orders from CS-Cart through API. You can create a side table containing information about profile fields (ex. profile field 38 contains information about Tax ID) and use it after pulling orders.

2. You can create a new endpoint in CS-Cart API which will return basically the same order structure, but with profile field names replacing the profile field IDs.

Best regards,

Robert

Okeey, thanks a lot!

Hello

You are welcome :)

Best regards

Robert