Skip to main content
POST
/
quality_controls
Add a new quality control
curl --request POST \
  --url https://api.rechain.co/public/v1/quality_controls \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "milestoneId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "userId": "123e4567-e89b-12d3-a456-426614174000",
  "status": 1,
  "inspectorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "acknowledgedDefectsIdentified": true,
  "willReplaceDefects": true,
  "cooperationLevel": "<string>",
  "inspectionLevel": "AQL 1.5",
  "approved": true,
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "productId": "123e4567-e89b-12d3-a456-426614174000",
  "orderNumber": "4655-2027781",
  "supplierId": 120,
  "fixedCount": 0,
  "inspectionDate": "2024-09-04T10:15:30Z",
  "finalResult": 1,
  "formVersion": "<string>"
}
'
{
  "milestoneId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "userId": "123e4567-e89b-12d3-a456-426614174000",
  "status": 1,
  "inspectorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "acknowledgedDefectsIdentified": true,
  "willReplaceDefects": true,
  "cooperationLevel": "<string>",
  "inspectionLevel": "AQL 1.5",
  "approved": true,
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "productId": "123e4567-e89b-12d3-a456-426614174000",
  "orderNumber": "4655-2027781",
  "supplierId": 120,
  "fixedCount": 0,
  "inspectionDate": "2024-09-04T10:15:30Z",
  "finalResult": 1,
  "formVersion": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "token": "<string>",
  "result": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "orderUuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "milestoneName": "<string>",
  "orderReference": "<string>",
  "dueDate": "2023-11-07T05:31:56Z",
  "productName": "<string>",
  "sizes": [
    "LG"
  ],
  "reportFileUrl": "<string>",
  "viewHistory": {},
  "actualInspectionDate": "2023-11-07T05:31:56Z",
  "quantityToControl": 123,
  "enableQcCheckin": true,
  "product": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "reference": "<string>",
    "dimensionsUnit": "<string>"
  },
  "orderProducts": [
    {
      "controlVariantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "quantity": 123,
      "sizesQuantity": {},
      "quantityToControl": 123
    }
  ],
  "company": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "logoUrl": "<string>"
  },
  "supplier": {
    "id": 123,
    "name": "<string>",
    "address": "<string>",
    "country": "<string>",
    "contact": "<string>"
  },
  "controlChecks": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "names": {},
      "icon": "<string>",
      "createdByRechain": true,
      "formFields": {},
      "statuses": {},
      "description": "<string>",
      "descriptions": {},
      "position": 123,
      "qualityCheckId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "settings": {},
      "results": {},
      "status": "<string>",
      "approval": {},
      "controlCheckPhotos": [
        {
          "id": "<string>",
          "createdAt": "2023-11-07T05:31:56Z",
          "fileUrl": "<string>",
          "comment": "<string>",
          "rotationAngle": 123
        }
      ]
    }
  ],
  "inspector": {
    "fullName": "<string>"
  },
  "controlCheckin": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "createdAt": "2023-11-07T05:31:56Z",
    "latitude": 123,
    "longitude": 123,
    "inspectorPhotoUrl": "<string>"
  },
  "qualityControlValues": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "content": "Sample content",
      "qualityControlFieldId": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "orders": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "exFactoryDate": "2024-09-04T10:15:30Z",
      "shippingMethod": "Air",
      "createdAt": "2024-09-04T10:15:30Z",
      "origin": "China"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Create a new quality control

milestoneId
string<uuid>
userId
string<uuid>
Example:

"123e4567-e89b-12d3-a456-426614174000"

status
enum<integer>

Quality control status, can be any of { draft: 0, requested: 1, started: 2, completed: 3 }

Available options:
0,
1,
2,
3
Example:

1

inspectorId
string<uuid>
acknowledgedDefectsIdentified
boolean
Example:

true

willReplaceDefects
boolean
Example:

true

cooperationLevel
string
inspectionLevel
string
Example:

"AQL 1.5"

approved
boolean
Example:

true

companyId
string<uuid>
Example:

"123e4567-e89b-12d3-a456-426614174000"

productId
string<uuid>
Example:

"123e4567-e89b-12d3-a456-426614174000"

orderNumber
string
Example:

"4655-2027781"

supplierId
integer
Example:

120

fixedCount
integer
Example:

0

inspectionDate
string<date-time>
Example:

"2024-09-04T10:15:30Z"

finalResult
enum<integer>

Quality control final result, can be any of { pending: 0, passed: 1, failed: 2 }

Available options:
0,
1,
2
Example:

1

formVersion
string

Response

Successful operation

id
string<uuid>
uuid
string<uuid>
token
string
result
string
createdAt
string<date-time>
orderId
string<uuid>
orderUuid
string<uuid>
milestoneName
string
orderReference
string
dueDate
string<date-time>
productName
string
sizes
string[]
reportFileUrl
string<uri>
viewHistory
object
actualInspectionDate
string<date-time>
quantityToControl
integer
enableQcCheckin
boolean
product
object
orderProducts
object[]
company
object
supplier
object
controlChecks
object[]
inspector
object
controlCheckin
object
qualityControlValues
object[]
orders
object[]