Understand the Answers to my API calls
This article provides explanations and associated processes for most of Fairly Made's API answers.
Caption - Explanation of the logos :
| ⚠️ | Action required |
| ⚪ | No action required |
| 🟢 | Success |
| ❌ | Contact Fairly Made |
For Every Data Family creation
| API answer | Meaning | Action required | |
| 201 | 🟢 CREATED | Your API call has been successful, the object is created. | ❎ None. |
| 400 | ⚠️ FORMAT_ERROR | The sent data is not in the correct format. | Check the API documentation and the expected data model to revise the code. |
| 400 | ⚠️ NO_TOKEN |
No token found.
|
Please include the Bearer Token in your request. Make sure you use the token associated with the right environment. |
| 400 | ⚠️ INVALID_SESSION |
Invalid token.
|
Ensure that the token is correct. Make sure you use the token associated with the right environment. |
| 500 | ❌ SERVER_ERROR | The server is facing a problem. Your call cannot be received. | Please contact Fairly Made with your error logs. If you encounter this error, we suggest retrying in a few minutes. |
For Packaging Family creation
| API answer | Meaning | Action required | |
| 400 | ⚪ PACKAGING_EXISTS | The packagingRef you are trying to create already exists in our system. It has probably already been used in a past project. There is no need to create it. | ❎ None. Simply use the reference when creating Products. |
For Supplier Family creation
| API answer | Meaning | Action required | |
| 400 | ⚪ SUPPLIER_ALREADY_EXISTS | The supplierRef you are trying to create already exists in our system. It has probably already been used in a past project. There is no need to create it. | ❎ None. Simply use the reference when creating Product and Component data families.
|
For Product Family creation
| API answer | Meaning | Action required | |
| 400 | ⚪STUDY_ALREADY_EXISTS_IN_COLLECTION | This study - i.e. the combination of this “productRef”, this “productColorCode” and this “productCollectionRef” - already exists in the Fairly Made® database. | ❎ None. You can now add components to it. Simply use the reference when creating Components. |
| 400 | ⚠️ SUPPLIER_DOES_NOT_EXIST | The supplierRef you mentioned does not exist in our systems. It has never been created before. | The Supplier must be created before Product data can be sent. |
| 400 | ⚠️ WAREHOUSE_DOES_NOT_EXIST | The warehouseRef you mentioned does not exist in our systems. It has never been created before. | The Warehouse must be created along with the Supplier data before Product data can be sent. |
| 400 | ⚠️ PACKAGING_DOES_NOT_EXIST | The packagingRef you mentioned does not exist in our systems. It has never been created before. | The Packaging must be created before Product data can be sent. |
| 400 | ⚠️ "gtinsOrEans: each value in gtinsOrEans must match /^(?:\\d{8}|\\d{12}|\\d{13}|\\d{14})$/ regular expression" | The gtinsOrEans value.s that you are trying to send does not follow our expectations : 8, 12, 13 or 14 digits. | Please correct the invalid gtins values. |
For Component Family creation
| API answer | Meaning | Action required | |
| 400 | ⚠️ COMPONENT_ALREADY_LINKED | The componentRef is already linked to a product. If its traceability is identical for all linked products, this is not a problem. | If not, make the componentRef unique to remove this constraint. |
| 400 | ⚠️ SUPPLIER_DOES_NOT_EXIST | The supplierRef you mentioned does not exist in our systems. It has never been created before. | The Supplier must be created before Component data can be sent. |
| 400 | ⚠️ STUDIES_DOES_NOT_EXIST | This study - i.e. the combination of this “productRef”, this “productColorCode” and this “productCollectionRef” - does not exist in our systems. It has never been created before. | The study must be created before Component data can be sent. |
| 400 | ⚠️ PRODUCT_DOES_NOT_EXISTS | The Product you mentioned does not exist in our systems. It has never been created before. | The Product must be created before Component data can be sent. |
| 400 | ⚪ STUDIES_NOT_PLANNED | The study status does not permit the sending of data. Either the supplier data collection has already started, or the study has already been published. | ❎ None. If you wish to send this product for analysis, please change one of the unicity criteria ('productRef', 'productColorCode' or 'productCollectionRef'). |
| 400 | ⚠️ COMPOSITION_NOT_100 | The declared composition is not equal to 100% (more ou less than this percentage) | Please check that the total in the sent composition is 100%. |
| 400 | ⚠️ FORMAT_ERROR | Component weight must be greater than or equal to 0, we cannot accept negative weight. | Please check the component weight and modify it. |
Should you require any assistance, please do not hesitate to contact Guillaume Babule at guillaume.babule@fairlymade.com or Clotilde Bazin at clotilde.bazin@fairlymade.com.