Download OpenAPI specification:
Backend API for DNA Myykapula - Device trade-in and purchase order management system.
This API provides endpoints for:
Authentication: All endpoints require valid AWS credentials in deployed environments.
Base URL (Beta): https://{api-gateway-id}.execute-api.eu-central-1.amazonaws.com/prod
Fetches all data from Mirkku API without storing it. Used for testing API connectivity and data structure.
{- "catalog": [
- {
- "Brand": "Apple",
- "Model": "iPhone 13",
- "BaseCode": "string",
- "MinPrice": 299.99,
- "MaxPrice": 599.99
}
], - "models": [
- {
- "Brand": "string",
- "Model": "string",
- "MemorySizeList": [
- "64GB",
- "128GB",
- "256GB"
], - "ConditionList": [
- "A",
- "B",
- "C"
], - "TacCodes": [
- "string"
], - "PriceList": [
- {
- "SKU": "string",
- "MemorySize": "128GB",
- "Grade": "A",
- "PriceStandardBattery": 0.1,
- "PriceBadBattery": 0.1
}
]
}
], - "questions": [
- {
- "Title": "string",
- "Description": "string",
- "Code": "string",
- "IsBatteryQuestion": true,
- "Order": 0,
- "AnswerCodes": [
- {
- "Description": "string",
- "Code": "string",
- "Grade": "string",
- "BatteryGrade": "string",
- "NextQuestion": "string",
}
], - "QuestionStrings": [
- {
- "Language": "en",
- "Question": "string",
- "QuestionOptions": [
- {
- "AnswerCode": "string",
- "OptionLabel": "string"
}
]
}
]
}
]
}Fetches brand data from Mirkku API and stores in DynamoDB.
{- "success": true,
- "message": "Synced: brands",
- "itemsProcessed": {
- "catalog": 0,
- "brands": 25,
- "models": 0,
- "questions": 0
}, - "totalItems": 25,
- "syncedTypes": [
- "brands"
]
}Fetches catalog data from Mirkku API and stores in DynamoDB.
{- "success": true,
- "message": "Synced: brands",
- "itemsProcessed": {
- "catalog": 0,
- "brands": 25,
- "models": 0,
- "questions": 0
}, - "totalItems": 25,
- "syncedTypes": [
- "brands"
]
}Fetches model data from Mirkku API and stores in DynamoDB.
{- "success": true,
- "message": "Synced: brands",
- "itemsProcessed": {
- "catalog": 0,
- "brands": 25,
- "models": 0,
- "questions": 0
}, - "totalItems": 25,
- "syncedTypes": [
- "brands"
]
}Fetches data from Mirkku API and stores it in DynamoDB:
Usage:
?catalog=true → Syncs only catalog?brands=true → Syncs only brands?models=true → Syncs only models?questions=true → Syncs only questions?catalog=true&brands=trueRecommendation: Use specific endpoints (/sync/brands, /sync/catalog, etc.) for single-type syncs.
| all | boolean Example: all=true Sync all data types (catalog, brands, models, questions) |
| catalog | boolean Example: catalog=true Sync catalog data only |
| brands | boolean Example: brands=true Sync brands data only |
| models | boolean Example: models=true Sync models data only |
| questions | boolean Example: questions=true Sync questions data only |
{- "success": true,
- "message": "Synced: catalog, brands, models, questions",
- "itemsProcessed": {
- "catalog": 150,
- "brands": 25,
- "models": 200,
- "questions": 15
}, - "totalItems": 390,
- "syncedTypes": [
- "catalog",
- "brands",
- "models",
- "questions"
]
}Creates a new purchase order for a device trade-in.
| AnswerCodes required | Array of strings non-empty Array of answer codes from device questionnaire |
| Brand required | string non-empty |
| Model required | string non-empty |
| Memory required | string non-empty |
| IMEI | string Optional IMEI number |
required | object (Customer) |
{- "AnswerCodes": [
- "CODE1",
- "CODE2",
- "CODE3"
], - "Brand": "Apple",
- "Model": "iPhone 13",
- "Memory": "128GB",
- "IMEI": "123456789012345",
- "Customer": {
- "Name": "John",
- "Surname": "Doe",
- "Address": "Main Street 123",
- "ZipCode": "00100",
- "City": "Helsinki",
- "Email": "john.doe@example.com",
- "PhoneNumber": "+358401234567",
- "AccountNumber": 12345678
}
}{- "offer_Id": "string",
- "SKUId": "string",
- "Answers": "string",
- "price": 0.1,
- "IspectorsGrading": "string",
- "IspectorComments": "string",
- "Test_Results": "string",
- "Status": "pending",
- "TrackingCode": "string",
- "Images": "string",
- "Response_Status": {
- "success": true,
- "message": "string"
}
}Retrieves purchase order details. All three parameters are required by the Mirkku API.
| OrderUUID required | string <uuid> Order UUID (unique identifier) |
| PO_Number required | integer >= 1 Purchase order number |
| CustomerSurname required | string non-empty Customer surname |
{- "OrderUUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "PO_Number": 12345,
- "CustomerSurname": "Smith"
}{- "offer_Id": "string",
- "SKUId": "string",
- "Answers": "string",
- "price": 0.1,
- "IspectorsGrading": "string",
- "IspectorComments": "string",
- "Test_Results": "string",
- "Status": "pending",
- "TrackingCode": "string",
- "Images": "string",
- "Response_Status": {
- "success": true,
- "message": "string"
}
}Accepts a purchase order by its UUID.
| OrderUUID required | string <uuid> Purchase order UUID to accept or decline |
{- "OrderUUID": "2701ef69-d681-4629-9780-a3a6f6780853"
}{- "Response_Status": {
- "success": true,
- "message": "string"
}
}Declines a purchase order by its UUID.
| OrderUUID required | string <uuid> Purchase order UUID to accept or decline |
{- "OrderUUID": "2701ef69-d681-4629-9780-a3a6f6780853"
}{- "Response_Status": {
- "success": true,
- "message": "string"
}
}Validates an IMEI number and returns device information if valid.
| IMEI required | string [ 15 .. 17 ] characters ^\d+$ IMEI number (15-17 digits) |
{- "IMEI": "123456789012345"
}{- "Brand": "Apple",
- "Model": "iPhone 13",
- "MemorySize": "128GB",
- "TACCode": "string",
- "ValidationPass": true,
- "Response_Status": {
- "success": true,
- "message": "string"
}
}Retrieves all device questionnaire questions from DynamoDB.
{- "success": true,
- "questions": [
- {
- "Title": "string",
- "Description": "string",
- "Code": "string",
- "IsBatteryQuestion": true,
- "Order": 0,
- "AnswerCodes": [
- {
- "Description": "string",
- "Code": "string",
- "Grade": "string",
- "BatteryGrade": "string",
- "NextQuestion": "string",
}
], - "QuestionStrings": [
- {
- "Language": "en",
- "Question": "string",
- "QuestionOptions": [
- {
- "AnswerCode": "string",
- "OptionLabel": "string"
}
]
}
]
}
]
}Retrieves a specific question by its ID from DynamoDB.
| id required | string Question ID |
{- "success": true,
- "question": {
- "Title": "string",
- "Description": "string",
- "Code": "string",
- "IsBatteryQuestion": true,
- "Order": 0,
- "AnswerCodes": [
- {
- "Description": "string",
- "Code": "string",
- "Grade": "string",
- "BatteryGrade": "string",
- "NextQuestion": "string",
}
], - "QuestionStrings": [
- {
- "Language": "en",
- "Question": "string",
- "QuestionOptions": [
- {
- "AnswerCode": "string",
- "OptionLabel": "string"
}
]
}
]
}
}{- "success": true,
}{- "success": true,
- "data": [
- {
- "Brand": "Apple",
- "Model": "iPhone 13",
- "BaseCode": "string",
- "MinPrice": 299.99,
- "MaxPrice": 599.99
}
]
}Retrieves a specific catalog item by its base code from DynamoDB.
| id required | string Catalog base code |
{- "success": true,
- "data": {
- "Brand": "Apple",
- "Model": "iPhone 13",
- "BaseCode": "string",
- "MinPrice": 299.99,
- "MaxPrice": 599.99
}
}{- "success": true,
- "data": [
- {
- "Brand": "string",
- "Model": "string",
- "MemorySizeList": [
- "64GB",
- "128GB",
- "256GB"
], - "ConditionList": [
- "A",
- "B",
- "C"
], - "TacCodes": [
- "string"
], - "PriceList": [
- {
- "SKU": "string",
- "MemorySize": "128GB",
- "Grade": "A",
- "PriceStandardBattery": 0.1,
- "PriceBadBattery": 0.1
}
]
}
]
}Retrieves a specific model by its ID from DynamoDB.
| id required | string Model ID |
{- "success": true,
- "data": {
- "Brand": "string",
- "Model": "string",
- "MemorySizeList": [
- "64GB",
- "128GB",
- "256GB"
], - "ConditionList": [
- "A",
- "B",
- "C"
], - "TacCodes": [
- "string"
], - "PriceList": [
- {
- "SKU": "string",
- "MemorySize": "128GB",
- "Grade": "A",
- "PriceStandardBattery": 0.1,
- "PriceBadBattery": 0.1
}
]
}
}