{
    "openapi": "3.0.3",
    "info": {
        "title": "Microdata Generated API",
        "version": "1.0.0",
        "description": "Dokumentasi dinamis command Api_post_query."
    },
    "servers": [
        {
            "url": "https://rnd.microdata.co.id/datasoft-api/app"
        }
    ],
    "tags": [
        {
            "name": "Akuntansi"
        },
        {
            "name": "Umum"
        }
    ],
    "paths": {
        "/Api_post_query": {
            "post": {
                "tags": [
                    "Generated API"
                ],
                "summary": "Execute generated API command",
                "description": "Pilih API melalui field command. Schema request tersedia sebagai oneOf untuk seluruh command yang dipublikasikan.",
                "operationId": "executeApiCommand",
                "security": [
                    {
                        "DsoApiKey": [],
                        "BasicAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "oneOf": [
                                    {
                                        "$ref": "#/components/schemas/ACC_REKENING_LISTRequest"
                                    },
                                    {
                                        "$ref": "#/components/schemas/ACC_BATASAN_LISTRequest"
                                    },
                                    {
                                        "$ref": "#/components/schemas/DOKI_AJUKAN_RETUR_ANGGOTARequest"
                                    }
                                ]
                            },
                            "examples": {
                                "acc_rekening_list": {
                                    "summary": "Daftar Rekening",
                                    "value": {
                                        "username": "{{TENANT_USERNAME}}",
                                        "password": "{{TENANT_PASSWORD}}",
                                        "command": "ACC_REKENING_LIST",
                                        "params": {
                                            "CABANG": "0001",
                                            "KEYWORD": "Kas",
                                            "NONAKTIF": 0
                                        },
                                        "request_id": "REQ-YYYYMMDDHHMMSS"
                                    }
                                },
                                "acc_batasan_list": {
                                    "summary": "LIST acc_batasan",
                                    "value": {
                                        "username": "{{TENANT_USERNAME}}",
                                        "password": "{{TENANT_PASSWORD}}",
                                        "command": "ACC_BATASAN_LIST",
                                        "params": {
                                            "KEYWORD": "Kas"
                                        }
                                    }
                                },
                                "doki_ajukan_retur_anggota": {
                                    "summary": "Doki - Pengajuan Retur Anggota",
                                    "value": {
                                        "username": "{{TENANT_USERNAME}}",
                                        "password": "{{TENANT_PASSWORD}}",
                                        "command": "DOKI_AJUKAN_RETUR_ANGGOTA",
                                        "params": {
                                            "NO_TRANS": "",
                                            "REG_COM": "",
                                            "CURRENT_STATUS": "",
                                            "NEW_STATUS": "RETUR",
                                            "KETERANGAN": "",
                                            "KODE_RETUR": "",
                                            "RINCIAN_BARANG": [],
                                            "LAMPIRAN": []
                                        },
                                        "request_id": "REQ-YYYYMMDDHHMMSS"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Command berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "method": "post",
                                    "mode": "command",
                                    "message": "success",
                                    "data": {
                                        "success": true,
                                        "command": "ACC_REKENING_LIST",
                                        "version": 2,
                                        "request_id": "REQ-YYYYMMDDHHMMSS",
                                        "database": "dsoidcom_domain_unit",
                                        "transaction": "PARTIAL",
                                        "execution_time_ms": 12,
                                        "data": {
                                            "list_rekening": {
                                                "affected_rows": 0,
                                                "insert_id": 0,
                                                "rows": [
                                                    {
                                                        "FIELD": "value"
                                                    }
                                                ]
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi atau eksekusi gagal",
                        "content": {
                            "application/json": {
                                "example": {
                                    "method": "post",
                                    "mode": "command",
                                    "message": "failed",
                                    "data": {
                                        "success": false,
                                        "command": "ACC_REKENING_LIST",
                                        "request_id": "REQ-YYYYMMDDHHMMSS",
                                        "error": {
                                            "code": "PARAMETER_INVALID",
                                            "message": "Parameter wajib belum diisi."
                                        },
                                        "errors": [
                                            "Parameter wajib belum diisi."
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "DsoApiKey": {
                "type": "apiKey",
                "in": "header",
                "name": "DSO-API-KEY"
            },
            "BasicAuth": {
                "type": "http",
                "scheme": "basic"
            }
        },
        "schemas": {
            "ACC_REKENING_LISTParams": {
                "type": "object",
                "properties": {
                    "CABANG": {
                        "type": "string",
                        "example": "0001",
                        "maxLength": 100
                    },
                    "KEYWORD": {
                        "type": "string",
                        "example": "Kas",
                        "maxLength": 40
                    },
                    "NONAKTIF": {
                        "type": "integer",
                        "example": 0
                    }
                },
                "required": [
                    "CABANG"
                ]
            },
            "ACC_REKENING_LISTRequest": {
                "type": "object",
                "required": [
                    "username",
                    "password",
                    "command",
                    "params",
                    "request_id"
                ],
                "properties": {
                    "username": {
                        "type": "string",
                        "example": "system@unit.domain"
                    },
                    "password": {
                        "type": "string",
                        "format": "password",
                        "example": "{{TENANT_PASSWORD}}"
                    },
                    "command": {
                        "type": "string",
                        "enum": [
                            "ACC_REKENING_LIST"
                        ]
                    },
                    "params": {
                        "$ref": "#/components/schemas/ACC_REKENING_LISTParams"
                    },
                    "request_id": {
                        "type": "string",
                        "example": "REQ-YYYYMMDDHHMMSS"
                    }
                }
            },
            "ACC_BATASAN_LISTParams": {
                "type": "object",
                "properties": {
                    "KEYWORD": {
                        "type": "string",
                        "example": "Kas",
                        "maxLength": 100
                    }
                }
            },
            "ACC_BATASAN_LISTRequest": {
                "type": "object",
                "required": [
                    "username",
                    "password",
                    "command",
                    "params"
                ],
                "properties": {
                    "username": {
                        "type": "string",
                        "example": "system@unit.domain"
                    },
                    "password": {
                        "type": "string",
                        "format": "password",
                        "example": "{{TENANT_PASSWORD}}"
                    },
                    "command": {
                        "type": "string",
                        "enum": [
                            "ACC_BATASAN_LIST"
                        ]
                    },
                    "params": {
                        "$ref": "#/components/schemas/ACC_BATASAN_LISTParams"
                    }
                }
            },
            "DOKI_AJUKAN_RETUR_ANGGOTAParams": {
                "type": "object",
                "properties": {
                    "NO_TRANS": {
                        "type": "string",
                        "example": ""
                    },
                    "REG_COM": {
                        "type": "string",
                        "example": ""
                    },
                    "CURRENT_STATUS": {
                        "type": "string",
                        "example": ""
                    },
                    "NEW_STATUS": {
                        "type": "string",
                        "example": "RETUR"
                    },
                    "KETERANGAN": {
                        "type": "string",
                        "example": ""
                    },
                    "KODE_RETUR": {
                        "type": "string",
                        "example": "",
                        "enum": [
                            "00",
                            "01",
                            "02",
                            "03",
                            "04",
                            "05"
                        ]
                    },
                    "RINCIAN_BARANG": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": []
                    },
                    "LAMPIRAN": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": []
                    }
                },
                "required": [
                    "NO_TRANS",
                    "REG_COM",
                    "KODE_RETUR"
                ]
            },
            "DOKI_AJUKAN_RETUR_ANGGOTARequest": {
                "type": "object",
                "required": [
                    "username",
                    "password",
                    "command",
                    "params",
                    "request_id"
                ],
                "properties": {
                    "username": {
                        "type": "string",
                        "example": "system@unit.domain"
                    },
                    "password": {
                        "type": "string",
                        "format": "password",
                        "example": "{{TENANT_PASSWORD}}"
                    },
                    "command": {
                        "type": "string",
                        "enum": [
                            "DOKI_AJUKAN_RETUR_ANGGOTA"
                        ]
                    },
                    "params": {
                        "$ref": "#/components/schemas/DOKI_AJUKAN_RETUR_ANGGOTAParams"
                    },
                    "request_id": {
                        "type": "string",
                        "example": "REQ-YYYYMMDDHHMMSS"
                    }
                }
            }
        }
    }
}