{
    "openapi": "3.0.0",
    "info": {
        "title": "Integration documentation",
        "version": "1.0"
    },
    "paths": {
        "/api/v1/escrow/partner/transactions": {
            "get": {
                "tags": [
                    "Transactions"
                ],
                "summary": "Get list of transactions",
                "operationId": "f22867dcded2b26d0c3a738230915d42",
                "responses": {
                    "200": {
                        "description": "successful operation"
                    },
                    "401": {
                        "description": "Unauthorized user"
                    }
                }
            },
            "post": {
                "tags": [
                    "Transactions"
                ],
                "summary": "Adds a new transaction",
                "operationId": "994b54153e9e42258d4d293dfb069922",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "initiator_id": {
                                        "type": "integer"
                                    },
                                    "participant_email": {
                                        "type": "string"
                                    },
                                    "initiator_role": {
                                        "type": "string"
                                    },
                                    "fee_pay_strategy": {
                                        "type": "string"
                                    },
                                    "type": {
                                        "type": "string"
                                    },
                                    "price": {
                                        "type": "number"
                                    },
                                    "currency": {
                                        "type": "string"
                                    },
                                    "title": {
                                        "type": "string"
                                    },
                                    "inspection_period": {
                                        "type": "integer"
                                    },
                                    "registration_expiry_date": {
                                        "type": "string"
                                    },
                                    "notes": {
                                        "type": "string"
                                    },
                                    "payload": {
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {},
                                "examples": {
                                    "result": {
                                        "summary": "An result object.",
                                        "value": {
                                            "success": true
                                        }
                                    },
                                    "bool": {
                                        "summary": "A boolean value.",
                                        "value": false
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/escrow/partner/transactions/{id}": {
            "get": {
                "tags": [
                    "Transactions"
                ],
                "summary": "Get a transaction by ID",
                "operationId": "2b06f29bf0e9b513170e3f5547bfc5da",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation"
                    },
                    "401": {
                        "description": "Unauthorized user"
                    }
                }
            }
        },
        "/api/v1/escrow/partner/transactions/{transaction_id}/invoices": {
            "get": {
                "tags": [
                    "Transactions"
                ],
                "summary": "Get invoices list of escrow transaction",
                "operationId": "c5fac31dc8ee0b5c49ab6267756e16cc",
                "parameters": [
                    {
                        "name": "transaction_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation"
                    },
                    "401": {
                        "description": "Unauthorized user"
                    }
                }
            }
        },
        "/api/v1/escrow/partner/transactions/{transaction_id}/invoices/{id}": {
            "get": {
                "tags": [
                    "Transactions"
                ],
                "summary": "Get a escrow invoice by ID",
                "operationId": "a5cbf5bc09d19f57d235ae2dbb15e757",
                "parameters": [
                    {
                        "name": "transaction_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation"
                    },
                    "401": {
                        "description": "Unauthorized user"
                    }
                }
            }
        },
        "/api/v1/escrow/partner/customers": {
            "get": {
                "tags": [
                    "Customers"
                ],
                "summary": "Get list of partner customers",
                "operationId": "fb214a109cb6eafef191f1f0e4782ad6",
                "responses": {
                    "200": {
                        "description": "successful operation"
                    },
                    "401": {
                        "description": "Unauthorized user"
                    }
                }
            },
            "post": {
                "tags": [
                    "Customers"
                ],
                "summary": "Adds a new customer",
                "operationId": "f039c5656d6d42804d40f32732b59f4f",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "first_name": {
                                        "type": "string"
                                    },
                                    "last_name": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {},
                                "examples": {
                                    "result": {
                                        "summary": "An result object.",
                                        "value": {
                                            "success": true
                                        }
                                    },
                                    "bool": {
                                        "summary": "A boolean value.",
                                        "value": false
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/escrow/partner/customers/{id}": {
            "get": {
                "tags": [
                    "Customers"
                ],
                "summary": "Get a customer by ID",
                "operationId": "8963b113d2b1ebfe9367b9f49bdf140a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Parameter with mutliple examples",
                        "required": true,
                        "schema": {
                            "type": "int"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation"
                    },
                    "401": {
                        "description": "Unauthorized user"
                    }
                }
            },
            "put": {
                "tags": [
                    "Customers"
                ],
                "summary": "Updates a customer",
                "operationId": "e8f6b585763f585834f2665677f3f334",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "int"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "first_name": {
                                        "type": "string"
                                    },
                                    "middle_name": {
                                        "type": "string"
                                    },
                                    "last_name": {
                                        "type": "string"
                                    },
                                    "country": {
                                        "type": "string"
                                    },
                                    "state": {
                                        "type": "string"
                                    },
                                    "city": {
                                        "type": "string"
                                    },
                                    "postcode": {
                                        "type": "string"
                                    },
                                    "address1": {
                                        "type": "string"
                                    },
                                    "address2": {
                                        "type": "string"
                                    },
                                    "date_of_birth": {
                                        "type": "string"
                                    },
                                    "company_name": {
                                        "type": "string"
                                    },
                                    "phone": {
                                        "type": "string"
                                    },
                                    "username": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Customers"
                ],
                "summary": "Mark a customer as deleted",
                "operationId": "6fdf279e0d95be7fbe4f9f7eb362872e",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "int"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/api/v1/escrow/partner/customers/{id}/upload_document": {
            "post": {
                "tags": [
                    "Customers"
                ],
                "summary": "Upload documents for customer verification",
                "operationId": "7b6d3e70565f951544784c4aab4008ff",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "identity_type": {
                                        "type": "string"
                                    },
                                    "identity_file": {
                                        "type": "file"
                                    },
                                    "address_type": {
                                        "type": "string"
                                    },
                                    "address_file": {
                                        "type": "file"
                                    },
                                    "identity_is_verified": {
                                        "type": "boolean"
                                    },
                                    "address_is_verified": {
                                        "type": "boolean"
                                    },
                                    "identity_has_address": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {},
                                "examples": {
                                    "result": {
                                        "summary": "An result object.",
                                        "value": {
                                            "success": true
                                        }
                                    },
                                    "bool": {
                                        "summary": "A boolean value.",
                                        "value": false
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/escrow/partner/customers/{id}/verification": {
            "get": {
                "tags": [
                    "Customers"
                ],
                "summary": "Get a customer verification",
                "operationId": "59bf12b01d82153c5c5f40cf474ec8c1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Customer ID",
                        "required": true,
                        "schema": {
                            "type": "int"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation"
                    },
                    "401": {
                        "description": "Unauthorized user"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Transaction": {
                "properties": {
                    "id": {
                        "type": "uuid"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "Domain",
                            "Others",
                            "Motor Vehicle",
                            "NFT"
                        ]
                    },
                    "payload": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "buyerId": {
                        "type": "integer"
                    },
                    "sellerId": {
                        "type": "integer"
                    },
                    "initiator": {
                        "type": "string",
                        "enum": [
                            "buyer",
                            "seller"
                        ]
                    },
                    "refNumber": {
                        "type": "string"
                    },
                    "initiatorEmail": {
                        "type": "string"
                    },
                    "participantEmail": {
                        "type": "string"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "price": {
                        "type": "numeric"
                    },
                    "commission": {
                        "type": "numeric"
                    },
                    "commissionDescription": {
                        "type": "string"
                    },
                    "processingCommission": {
                        "type": "numeric"
                    },
                    "feePayStrategy": {
                        "type": "string",
                        "enum": [
                            "buyer",
                            "seller",
                            "split"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "new",
                            "approved",
                            "rejected",
                            "only_seller_verified",
                            "only_buyer_verified",
                            "all_participants_verified",
                            "waiting_money",
                            "money_on_escrow",
                            "product_sent",
                            "product_received",
                            "product_accepted",
                            "seller_waiting_money",
                            "money_sent_to_seller",
                            "product_rejected",
                            "seller_waiting_product_back",
                            "seller_received_product_back",
                            "buyer_waiting_money_back",
                            "money_sent_back_to_buyer",
                            "seller_reject_returned_product"
                        ]
                    },
                    "createdAt": {
                        "type": "string"
                    },
                    "inspectionPeriod": {
                        "type": "integer"
                    },
                    "registrationExpiryDate": {
                        "type": "string"
                    },
                    "inspectionPeriodExpiredAt": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "notes": {
                        "type": "string"
                    },
                    "buyerAddress": {
                        "type": "string"
                    },
                    "sellerAddress": {
                        "type": "string"
                    },
                    "escrowAgentComment": {
                        "type": "string"
                    },
                    "commodityReturnExpiredAt": {
                        "type": "string"
                    },
                    "commodityReturnInspectionPeriodExpiredAt": {
                        "type": "string"
                    },
                    "partner_id": {
                        "type": "integer"
                    },
                    "type_description": {
                        "type": "string"
                    }
                },
                "type": "object"
            }
        }
    }
}