Skip to content

Create complaint

POST
/rest/reporting/complaints/create
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.

The new Complaint resource

object
actionType
required
string
Allowed values: draft create rfq
salesOrderId
string | null format: uuid
purchaseOrderId
string | null format: uuid
issue
string | null
cause
string | null
solution
string | null
measures
required
string
>= 1 characters <= 4096 characters
measuresEffectiveness
string | null
<= 4096 characters
products

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.

Array<string>
lots

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.

Array<string>
>= 1 items
sendTo
Any of:
object
name
required
string
email
required

More information

string format: email
ccEmails
Array
message
string | null
<= 1024 characters
attachments

Signed upload tickets, see POST /rest/documents/upload-url.

Array<string>
0 <= 10 items

Complaint resource created

object
sequenceYear

The year of the counter that gave the sequence id. The sequence starts again each year.

integer
displaySequenceId
string
resolvedAt
string | null format: date-time
creditNotes
Array<string>
affectedProducts
Array<string>
affectedLots

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.

Array<string>
issue
string | null
cause
string | null
solution
string | null
measures
string | null
measuresEffectiveness
string | null
salesOrder
string | null format: iri-reference
purchaseOrder
string | null format: iri-reference
attachments
Array<string>
creator
string format: iri-reference
createdAt
string format: date-time
updatedAt
string | null format: date-time
file
string | null format: iri-reference
id

More information

string format: uuid
uid
string
legacyNumber
string | null
importedAt

When a data import made the record. Null: a user made it. An import updates only a record that an import made.

string | null format: date-time
notes
Array<string>
sequenceId
integer
resolved
boolean
imported
boolean

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/"
]
}

Invalid input

A representation of common errors.

object
title

A short, human-readable summary of the problem.

string | null
detail

A human-readable explanation specific to this occurrence of the problem.

string | null
status
integer | null
default: 400
instance

A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.

string | null
type

A URI reference that identifies the problem type

string

Example

{
"status": 400
}

Forbidden

A representation of common errors.

object
title

A short, human-readable summary of the problem.

string | null
detail

A human-readable explanation specific to this occurrence of the problem.

string | null
status
integer | null
default: 400
instance

A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.

string | null
type

A URI reference that identifies the problem type

string

Example

{
"status": 400
}

An error occurred

Unprocessable entity

object
status
integer
default: 422
violations
Array<object>
object
propertyPath
required

The property path of the violation

string
message
required

The message associated with the violation

string
code

The code of the violation

string
hint

An extra hint to understand the violation

string
payload

The serialized payload of the violation

object
key
additional properties
any
detail
string
type
string
title
string | null
instance
string | null

Example

{
"status": 422
}