{
    "schemes": [
        "https",
        "http"
    ],
    "swagger": "2.0",
    "info": {
        "description": "Master Data Management API Documentation",
        "title": "Master Data Management API Documentation",
        "contact": {},
        "version": "1.0"
    },
    "paths": {
        "/": {
            "get": {
                "description": "Get the info of server.",
                "consumes": [
                    "*/*"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "HeathCheck"
                ],
                "summary": "Show the info of server.",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/buyer-addresses": {
            "get": {
                "security": [
                    {
                        "BearerToken": []
                    }
                ],
                "description": "Get buyer addresses",
                "consumes": [
                    "*/*"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Address"
                ],
                "summary": "Get buyer addresses",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.BuyerAddressResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerToken": []
                    }
                ],
                "description": "Create a new buyer address",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Address"
                ],
                "summary": "CreateBuyerAddress",
                "parameters": [
                    {
                        "description": "request",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.CreateBuyerAddressRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.BuyerAddressResponse"
                        }
                    }
                }
            }
        },
        "/buyer-addresses/{id}": {
            "get": {
                "security": [
                    {
                        "BearerToken": []
                    }
                ],
                "description": "Get buyer address by ID",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Address"
                ],
                "summary": "Get buyer address by ID",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Buyer address ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.BuyerAddressResponse"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerToken": []
                    }
                ],
                "description": "Update a buyer address",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Address"
                ],
                "summary": "UpdateBuyerAddress",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Buyer address ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Update buyer address",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.UpdateBuyerAddressRequest"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": ""
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerToken": []
                    }
                ],
                "description": "Delete a buyer address",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Address"
                ],
                "summary": "DeleteBuyerAddress",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Buyer address ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": ""
                    }
                }
            }
        },
        "/countries": {
            "get": {
                "description": "Get list of all countries.",
                "consumes": [
                    "*/*"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Location"
                ],
                "summary": "Get list of all countries.",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.GetCountriesResponse"
                        }
                    }
                }
            }
        },
        "/countries/{id}/locations": {
            "get": {
                "description": "Get list of children locations.",
                "consumes": [
                    "*/*"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Location"
                ],
                "summary": "Get list of children locations.",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Country ID / Country Code",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Parent ID",
                        "name": "parentId",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.GetLocationsResponse"
                        }
                    }
                }
            }
        },
        "/draft-checkout-info": {
            "post": {
                "security": [
                    {
                        "BearerToken": []
                    }
                ],
                "description": "Save draft checkout info",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Address"
                ],
                "summary": "Save draft checkout info",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.DraftCheckoutInfoResponse"
                        }
                    }
                }
            }
        },
        "/draft-checkout-info/{cartId}": {
            "get": {
                "security": [
                    {
                        "BearerToken": []
                    }
                ],
                "description": "Get draft checkout info by buyer",
                "consumes": [
                    "*/*"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Address"
                ],
                "summary": "Get draft checkout info by buyer",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cart ID",
                        "name": "cartId",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.DraftCheckoutInfoResponse"
                        }
                    }
                }
            }
        },
        "/draft-checkout-info/{cartId}/by-seller": {
            "get": {
                "security": [
                    {
                        "BearerToken": []
                    }
                ],
                "description": "Get draft checkout info by seller",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Address"
                ],
                "summary": "Get draft checkout info by seller",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cart ID",
                        "name": "cartId",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.DraftCheckoutInfoResponse"
                        }
                    }
                }
            }
        },
        "/health-check": {
            "get": {
                "description": "Get the status of server.",
                "consumes": [
                    "*/*"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "HeathCheck"
                ],
                "summary": "Show the status of server.",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "dto.Address": {
            "type": "object",
            "properties": {
                "address1": {
                    "type": "string"
                },
                "address2": {
                    "type": "string"
                },
                "countryId": {
                    "type": "integer"
                },
                "deactivate": {
                    "type": "boolean"
                },
                "id": {
                    "type": "integer"
                },
                "postalCode": {
                    "type": "string"
                },
                "subLevelLocations": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/dto.SubLevelLocation"
                    }
                },
                "unitNumber": {
                    "type": "string"
                }
            }
        },
        "dto.BuyerAddressResponse": {
            "type": "object",
            "properties": {
                "address": {
                    "$ref": "#/definitions/dto.Address"
                },
                "id": {
                    "type": "integer"
                },
                "isDefault": {
                    "type": "boolean"
                },
                "label": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "recipientName": {
                    "type": "string"
                }
            }
        },
        "dto.Country": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "internationalName": {
                    "type": "string"
                },
                "localizedName": {
                    "type": "string"
                }
            }
        },
        "dto.CreateBuyerAddressRequest": {
            "type": "object",
            "required": [
                "address1",
                "countryCode"
            ],
            "properties": {
                "address1": {
                    "type": "string"
                },
                "address2": {
                    "type": "string"
                },
                "countryCode": {
                    "description": "Address",
                    "type": "string"
                },
                "isDefault": {
                    "type": "boolean"
                },
                "label": {
                    "description": "Buyer address",
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "postalCode": {
                    "type": "string"
                },
                "recipientName": {
                    "type": "string"
                },
                "subLevelLocationIds": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "unitNumber": {
                    "type": "string"
                }
            }
        },
        "dto.DraftCheckoutInfoResponse": {
            "type": "object",
            "properties": {
                "address": {
                    "$ref": "#/definitions/dto.Address"
                },
                "cartId": {
                    "type": "string"
                },
                "deliveryInstructions": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "phoneNumber": {
                    "type": "string"
                },
                "recipientName": {
                    "type": "string"
                }
            }
        },
        "dto.GetCountriesResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/dto.Country"
                    }
                }
            }
        },
        "dto.GetLocationsResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/dto.Location"
                    }
                }
            }
        },
        "dto.Location": {
            "type": "object",
            "properties": {
                "countryId": {
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "internationalName": {
                    "type": "string"
                },
                "localizedName": {
                    "type": "string"
                },
                "parentId": {
                    "type": "integer"
                }
            }
        },
        "dto.SubLevelLocation": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "internationalName": {
                    "type": "string"
                },
                "localizedName": {
                    "type": "string"
                },
                "parentId": {
                    "type": "integer"
                }
            }
        },
        "dto.UpdateBuyerAddressRequest": {
            "type": "object",
            "required": [
                "address1"
            ],
            "properties": {
                "address1": {
                    "description": "Address",
                    "type": "string"
                },
                "address2": {
                    "type": "string"
                },
                "deactivate": {
                    "type": "boolean"
                },
                "id": {
                    "description": "Buyer address",
                    "type": "integer"
                },
                "isDefault": {
                    "type": "boolean"
                },
                "label": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "postalCode": {
                    "type": "string"
                },
                "recipientName": {
                    "type": "string"
                },
                "subLevelLocationIds": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "unitNumber": {
                    "type": "string"
                }
            }
        }
    },
    "securityDefinitions": {
        "BearerToken": {
            "type": "apiKey",
            "name": "Authorization",
            "in": "header"
        }
    }
}