Create complaint
const url = 'https://api.shypr.app/rest/reporting/complaints/create';const options = { method: 'POST', headers: {'X-API-KEY': '<X-API-KEY>', 'Content-Type': 'application/json'}, body: '{"actionType":"draft","salesOrderId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","purchaseOrderId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","issue":"example","cause":"example","solution":"example","measures":"example","measuresEffectiveness":"example","products":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"lots":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"sendTo":{"name":"example","email":"hello@example.com","ccEmails":["example"],"message":"example","attachments":["example"]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.shypr.app/rest/reporting/complaints/create \ --header 'Content-Type: application/json' \ --header 'X-API-KEY: <X-API-KEY>' \ --data '{ "actionType": "draft", "salesOrderId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "purchaseOrderId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "issue": "example", "cause": "example", "solution": "example", "measures": "example", "measuresEffectiveness": "example", "products": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "lots": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "sendTo": { "name": "example", "email": "hello@example.com", "ccEmails": [ "example" ], "message": "example", "attachments": [ "example" ] } }'Creates a Complaint resource.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”The new Complaint resource
object
This is an array of ReservedProduct::$id. It is optional: the lots carry the product, so an order line only adds the ordered and delivered quantity.
This is an array of ProductLot::$id: the lots that carry the defect. Every line that ships or arrives holds a manufacturing lot, so a claim must name at least one. The lot number is what makes the claim findable later.
object
Signed upload tickets, see POST /rest/documents/upload-url.
object
This is an array of ReservedProduct::$id. It is optional: the lots carry the product, so an order line only adds the ordered and delivered quantity.
This is an array of ProductLot::$id: the lots that carry the defect. Every line that ships or arrives holds a manufacturing lot, so a claim must name at least one. The lot number is what makes the claim findable later.
object
Signed upload tickets, see POST /rest/documents/upload-url.
Responses
Section titled “Responses”Complaint resource created
object
The year of the counter that gave the sequence id. The sequence starts again each year.
The manufacturing lots the claim is about. A lot knows its own product, so a lot here says exactly which batch was defective, not only which order line.
When a data import made the record. Null: a user made it. An import updates only a record that an import made.
Example
{ "creditNotes": [ "https://example.com/" ], "affectedProducts": [ "https://example.com/" ], "affectedLots": [ "https://example.com/" ], "salesOrder": "https://example.com/", "purchaseOrder": "https://example.com/", "attachments": [ "https://example.com/" ], "creator": "https://example.com/", "file": "https://example.com/", "notes": [ "https://example.com/" ]}object
The year of the counter that gave the sequence id. The sequence starts again each year.
The manufacturing lots the claim is about. A lot knows its own product, so a lot here says exactly which batch was defective, not only which order line.
Example
https://example.com/Example
https://example.com/Example
https://example.com/Example
https://example.com/When a data import made the record. Null: a user made it. An import updates only a record that an import made.
Invalid input
A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "status": 400}A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "status": 400}Forbidden
A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "status": 400}A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "status": 400}An error occurred
Unprocessable entity
object
object
The property path of the violation
The message associated with the violation
The code of the violation
An extra hint to understand the violation
The serialized payload of the violation
object
Example
{ "status": 422}Unprocessable entity
object
object
The property path of the violation
The message associated with the violation
The code of the violation
An extra hint to understand the violation
The serialized payload of the violation
object
Example
{ "status": 422}