DNA Myykapula Backend API (1.0.0)

Download OpenAPI specification:

License: Proprietary

Backend API for DNA Myykapula - Device trade-in and purchase order management system.

This API provides endpoints for:

  • Syncing device catalog data from Mirkku
  • Managing purchase orders
  • IMEI validation
  • Device questions retrieval

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

Sync

Data synchronization operations

Dry-run data sync

Fetches all data from Mirkku API without storing it. Used for testing API connectivity and data structure.

Authorizations:
awsSigv4

Responses

Response samples

Content type
application/json
{
  • "brands": [],
  • "catalog": [
    ],
  • "models": [
    ],
  • "questions": [
    ]
}

Sync brands only

Fetches brand data from Mirkku API and stores in DynamoDB.

Authorizations:
awsSigv4

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Synced: brands",
  • "itemsProcessed": {
    },
  • "totalItems": 25,
  • "syncedTypes": [
    ]
}

Sync catalog only

Fetches catalog data from Mirkku API and stores in DynamoDB.

Authorizations:
awsSigv4

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Synced: brands",
  • "itemsProcessed": {
    },
  • "totalItems": 25,
  • "syncedTypes": [
    ]
}

Sync models only

Fetches model data from Mirkku API and stores in DynamoDB.

Authorizations:
awsSigv4

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Synced: brands",
  • "itemsProcessed": {
    },
  • "totalItems": 25,
  • "syncedTypes": [
    ]
}

Sync all data or selective sync

Fetches data from Mirkku API and stores it in DynamoDB:

  • Catalog → DynamoDB
  • Brands → DynamoDB
  • Models → DynamoDB
  • Questions → DynamoDB

Usage:

  • No parameters → Syncs everything
  • Query parameters for selective sync:
    • ?catalog=true → Syncs only catalog
    • ?brands=true → Syncs only brands
    • ?models=true → Syncs only models
    • ?questions=true → Syncs only questions
  • Multiple parameters can be combined: ?catalog=true&brands=true

Recommendation: Use specific endpoints (/sync/brands, /sync/catalog, etc.) for single-type syncs.

Authorizations:
awsSigv4
query Parameters
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

Responses

Response samples

Content type
application/json
Example
{
  • "success": true,
  • "message": "Synced: catalog, brands, models, questions",
  • "itemsProcessed": {
    },
  • "totalItems": 390,
  • "syncedTypes": [
    ]
}

Sync questions only

Fetches questions from Mirkku API and stores them in DynamoDB.

Authorizations:
awsSigv4

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "count": 0
}

Purchase Orders

Purchase order management

Create purchase order

Creates a new purchase order for a device trade-in.

Authorizations:
awsSigv4
Request Body schema: application/json
required
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)

Responses

Request samples

Content type
application/json
{
  • "AnswerCodes": [
    ],
  • "Brand": "Apple",
  • "Model": "iPhone 13",
  • "Memory": "128GB",
  • "IMEI": "123456789012345",
  • "Customer": {
    }
}

Response samples

Content type
application/json
{
  • "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": {
    }
}

Get purchase order

Retrieves purchase order details. All three parameters are required by the Mirkku API.

Authorizations:
awsSigv4
Request Body schema: application/json
required
OrderUUID
required
string <uuid>

Order UUID (unique identifier)

PO_Number
required
integer >= 1

Purchase order number

CustomerSurname
required
string non-empty

Customer surname

Responses

Request samples

Content type
application/json
{
  • "OrderUUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "PO_Number": 12345,
  • "CustomerSurname": "Smith"
}

Response samples

Content type
application/json
{
  • "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": {
    }
}

Accept purchase order

Accepts a purchase order by its UUID.

Authorizations:
awsSigv4
Request Body schema: application/json
required
OrderUUID
required
string <uuid>

Purchase order UUID to accept or decline

Responses

Request samples

Content type
application/json
{
  • "OrderUUID": "2701ef69-d681-4629-9780-a3a6f6780853"
}

Response samples

Content type
application/json
{
  • "Response_Status": {
    }
}

Decline purchase order

Declines a purchase order by its UUID.

Authorizations:
awsSigv4
Request Body schema: application/json
required
OrderUUID
required
string <uuid>

Purchase order UUID to accept or decline

Responses

Request samples

Content type
application/json
{
  • "OrderUUID": "2701ef69-d681-4629-9780-a3a6f6780853"
}

Response samples

Content type
application/json
{
  • "Response_Status": {
    }
}

IMEI

IMEI validation

Check IMEI validity

Validates an IMEI number and returns device information if valid.

Authorizations:
awsSigv4
Request Body schema: application/json
required
IMEI
required
string [ 15 .. 17 ] characters ^\d+$

IMEI number (15-17 digits)

Responses

Request samples

Content type
application/json
{
  • "IMEI": "123456789012345"
}

Response samples

Content type
application/json
{
  • "Brand": "Apple",
  • "Model": "iPhone 13",
  • "MemorySize": "128GB",
  • "TACCode": "string",
  • "ValidationPass": true,
  • "Response_Status": {
    }
}

Questions

Device questionnaire retrieval

Get all questions

Retrieves all device questionnaire questions from DynamoDB.

Authorizations:
awsSigv4

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "questions": [
    ]
}

Get question by ID

Retrieves a specific question by its ID from DynamoDB.

Authorizations:
awsSigv4
path Parameters
id
required
string

Question ID

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "question": {
    }
}

Brands

Device brands retrieval

Get all brands

Retrieves all device brands from DynamoDB.

Authorizations:
awsSigv4

Responses

Response samples

Content type
application/json
{}

Get brand by ID

Retrieves a specific brand by its ID from DynamoDB.

Authorizations:
awsSigv4
path Parameters
id
required
string

Brand ID

Responses

Response samples

Content type
application/json
{}

Catalog

Device catalog retrieval

Get all catalog items

Retrieves all catalog items from DynamoDB.

Authorizations:
awsSigv4

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": [
    ]
}

Get catalog item by base code

Retrieves a specific catalog item by its base code from DynamoDB.

Authorizations:
awsSigv4
path Parameters
id
required
string

Catalog base code

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Models

Device models retrieval

Get all models

Retrieves all device models from DynamoDB.

Authorizations:
awsSigv4

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": [
    ]
}

Get model by ID

Retrieves a specific model by its ID from DynamoDB.

Authorizations:
awsSigv4
path Parameters
id
required
string

Model ID

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}