{
  "openapi": "3.1.1",
  "info": {
    "title": "Marketplace API",
    "description": "Safepay Marketplace API makes it easy for you to setup secure payments on your marketplace.\n\n ",
    "termsOfService": "https://static.safepaynordic.dk/policies/Symblepay_Brugerbetingelser.pdf"
  },
  "paths": {
    "/v1/marketplace/users/business": {
      "post": {
        "tags": [
          "Business Users"
        ],
        "summary": "Create business user",
        "parameters": [
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBusinessUser.Command.BodyModel"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBusinessUser.Model"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/business/{businessId}/{businessLocationId}": {
      "post": {
        "tags": [
          "Business Users"
        ],
        "summary": "Edit business user",
        "parameters": [
          {
            "name": "businessId",
            "in": "path",
            "description": "CVR number for danish company. Only whitelisted numbers are allowed",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "businessLocationId",
            "in": "path",
            "description": "P.nr for danish company",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditBusinessUser.Command.BodyModel"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditBusinessUser.Model"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Business Users"
        ],
        "summary": "Get business user",
        "parameters": [
          {
            "name": "businessId",
            "in": "path",
            "description": "CVR number for danish company. Only whitelisted numbers are allowed",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "businessLocationId",
            "in": "path",
            "description": "P.nr for danish company",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBusinessUser.Model"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Business Users"
        ],
        "summary": "Delete business user",
        "parameters": [
          {
            "name": "businessId",
            "in": "path",
            "description": "CVR number for danish company. Only whitelisted numbers are allowed",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "businessLocationId",
            "in": "path",
            "description": "P.nr for danish company",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/trades/initiate": {
      "post": {
        "tags": [
          "Trades"
        ],
        "summary": "Initiate new trade",
        "parameters": [
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitCheckoutCommand.Command.CheckoutBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitCheckoutCommand.Model"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/trades/cancel": {
      "post": {
        "tags": [
          "Trades"
        ],
        "summary": "Cancel ongoing trade",
        "parameters": [
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelCheckoutCommand.Command.CancelBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelCheckoutCommand.Model"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}/trades": {
      "get": {
        "tags": [
          "Trades"
        ],
        "summary": "Get trades",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "The unique user id. This should be the same id, that is used when using the connection-flow.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetTrades.Model"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}/trades/{tradeId}": {
      "get": {
        "tags": [
          "Trades"
        ],
        "summary": "Get trade details",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "The unique user id. This should be the same id, that is used when using the connection-flow.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "tradeId",
            "in": "path",
            "description": "The trade id to get details for",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trade"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}/trades/{tradeId}/status": {
      "post": {
        "tags": [
          "Trades"
        ],
        "summary": "Get trade status link",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "The unique user id. This should be the same id, that is used when using the connection-flow.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "tradeId",
            "in": "path",
            "description": "The trade id to get details for",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Setup information for the status flow",
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/GetStatusLinkQuery.Query.BodyModel"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetStatusLinkQuery.Model"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{payerMarketplaceUserId}/trades/{tradeId}/reimburse-payer": {
      "post": {
        "tags": [
          "Trades"
        ],
        "summary": "Reimburse payer on trade",
        "parameters": [
          {
            "name": "payerMarketplaceUserId",
            "in": "path",
            "description": "Unique user id for payer.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "tradeId",
            "in": "path",
            "description": "Unique trade id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Setup information to change payee",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReimbursePayerCommand.Command.BodyModel"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReimbursePayerCommand.Model"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/connect": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Initiate user connect",
        "parameters": [
          {
            "name": "forceOnboarding",
            "in": "query",
            "description": "Toggle to ensure users are forced through a MitID sign-in flow when they connect with Symblepay. This can be used to overwrite potential cookies set in a users session.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthenticateCommand.Command.FromFormModel"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticateCommand.Model"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}/bankaccount/initiate": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Initiate select payout account",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "The marketplace user id",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetDefaultSetupBankAccountLinkCommand.Command.BodyModel"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDefaultSetupBankAccountLinkCommand.Model"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get user details",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "The marketplace user id",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetStatusQuery.Model"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}/trades/{tradeId}/accept-invitation": {
      "post": {
        "tags": [
          "Trade actions"
        ],
        "summary": "Accept trade invitation",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "Unique user id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "tradeId",
            "in": "path",
            "description": "Unique trade id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trade"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}/trades/{tradeId}/accept-invitation-and-pay": {
      "post": {
        "tags": [
          "Trade actions"
        ],
        "summary": "Accept trade invitation and pay",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "Unique user id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "tradeId",
            "in": "path",
            "description": "Unique trade id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "receiverShopId",
            "in": "query",
            "description": "Receiver shop.",
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}/trades/{tradeId}/reject-invitation": {
      "post": {
        "tags": [
          "Trade actions"
        ],
        "summary": "Reject trade invitation",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "Unique user id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "tradeId",
            "in": "path",
            "description": "Unique trade id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trade"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}/trades/{tradeId}/item-condition-accepted": {
      "post": {
        "tags": [
          "Trade actions"
        ],
        "summary": "Accept item condition",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "Unique user id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "tradeId",
            "in": "path",
            "description": "Unique trade id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trade"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}/trades/{tradeId}/item-condition-rejected": {
      "post": {
        "tags": [
          "Trade actions"
        ],
        "summary": "Reject item condition",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "Unique user id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "tradeId",
            "in": "path",
            "description": "Unique trade id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Rejection reason.",
          "content": {
            "application/json": {
              "schema": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trade"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}/trades/{tradeId}/abandon": {
      "post": {
        "tags": [
          "Trade actions"
        ],
        "summary": "Abandon trade",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "Unique user id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "tradeId",
            "in": "path",
            "description": "Unique trade id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trade"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}/payments/{paymentId}/link": {
      "post": {
        "tags": [
          "Trade actions"
        ],
        "summary": "Initiate payment flow",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "Unique user id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "paymentId",
            "in": "path",
            "description": "Payment Id",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetPaymentLink.Command.BodyModel"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPaymentLink.Model"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}/trades/{tradeId}/payment-to-escrow": {
      "post": {
        "tags": [
          "Trade actions"
        ],
        "summary": "Get payment to escrow.",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "Unique user id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "tradeId",
            "in": "path",
            "description": "Unique trade id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}/trades/{tradeId}/buy-shipment": {
      "post": {
        "tags": [
          "Trade actions"
        ],
        "summary": "Buy shipment for delivery",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "Unique user id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "tradeId",
            "in": "path",
            "description": "Unique trade id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Shipment data.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuyShipmentForDeliveryBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/marketplace/users/{marketplaceUserId}/trades/{tradeId}/buy-return-shipment": {
      "post": {
        "tags": [
          "Trade actions"
        ],
        "summary": "Buy shipment for return",
        "parameters": [
          {
            "name": "marketplaceUserId",
            "in": "path",
            "description": "Unique user id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "tradeId",
            "in": "path",
            "description": "Unique trade id.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "description": "Correlation ID used for logging.",
            "schema": {
              "maxLength": 64,
              "minLength": 20,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Shipment data.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuyShipmentForReturnBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceApiErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ActionModel": {
        "required": [
          "type",
          "text"
        ],
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ActionType"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "ActionType": {
        "enum": [
          "PaymentToEscrow",
          "RespondToInvitation",
          "RespondToInvitationAndPay",
          "BuyShipment",
          "BuyReturnShipment",
          "ShowShipment",
          "TrackShipment",
          "GiveItemConditionFeedbackManualDelivery",
          "GiveItemConditionFeedback",
          "Cancel"
        ]
      },
      "AuthenticateCommand.Command.FromFormModel": {
        "required": [
          "successUrl",
          "cancelUrl",
          "marketplaceUserId"
        ],
        "type": "object",
        "properties": {
          "successUrl": {
            "maxLength": 2048,
            "type": "string",
            "description": "The uri users are forwarded to after a successful flow."
          },
          "cancelUrl": {
            "maxLength": 2048,
            "type": "string",
            "description": "The uri users are forwarded to after cancelling a flow."
          },
          "appSwitch": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "For native app flows to work this needs to be filled to allow switching back to the native app.",
                "$ref": "#/components/schemas/MarketplaceConstants.AppSwitchModel"
              }
            ]
          },
          "marketplaceUserId": {
            "maxLength": 64,
            "type": "string",
            "description": "The marketplace user id to connect"
          },
          "requiredKycLevel": {
            "maximum": 2,
            "minimum": 1,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The required level of KYC for users to have, if any.",
            "format": "int32"
          }
        },
        "example": {
          "successUrl": "https://marketplace.dk/success-url",
          "cancelUrl": "https://marketplace.dk/cancel-url",
          "appSwitch": null,
          "marketplaceUserId": "b1910fdd-0889-41a5-af5f-45cc3381afe2",
          "requiredKycLevel": null
        }
      },
      "AuthenticateCommand.Model": {
        "required": [
          "redirectUrl"
        ],
        "type": "object",
        "properties": {
          "redirectUrl": {
            "maxLength": 2048,
            "type": "string",
            "description": "The uri users should be forwarded to for a user connection flow.",
            "format": "uri"
          }
        },
        "example": {
          "redirectUrl": "https://api.safepaynordic.dk/initiate-authenticate-flow"
        }
      },
      "BuyShipmentForDeliveryBody": {
        "required": [
          "price",
          "shipmentProviderId",
          "expectedMaxWeightInGrams"
        ],
        "type": "object",
        "properties": {
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Price the user should pay for the shipment.",
            "format": "double"
          },
          "shipmentProviderId": {
            "type": "string",
            "description": "Shipment provider used for the shipment.\r\nPossible options are \"Dao, PostNord\""
          },
          "expectedMaxWeightInGrams": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "What is the expected weight of the package being send",
            "format": "int32"
          }
        }
      },
      "BuyShipmentForReturnBody": {
        "required": [
          "price",
          "shipmentProviderId",
          "expectedMaxWeightInGrams"
        ],
        "type": "object",
        "properties": {
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Price the user should pay for the shipment.",
            "format": "double"
          },
          "shipmentProviderId": {
            "type": "string",
            "description": "Shipment provider used for the shipment.\r\nPossible options are \"Dao, PostNord\""
          },
          "expectedMaxWeightInGrams": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "What is the expected weight of the package being send",
            "format": "int32"
          }
        }
      },
      "CancelCheckoutCommand.Command.CancelBody": {
        "required": [
          "state"
        ],
        "type": "object",
        "properties": {
          "state": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string",
            "description": "The state id of the trade."
          }
        }
      },
      "CancelCheckoutCommand.Model": {
        "required": [
          "state"
        ],
        "type": "object",
        "properties": {
          "state": {
            "type": "string"
          }
        }
      },
      "ContractPhase": {
        "required": [
          "started",
          "paid",
          "invitationAccepted",
          "invitationRejected",
          "amount"
        ],
        "type": "object",
        "properties": {
          "started": {
            "type": "string",
            "description": "Datetime when this phase started",
            "format": "date-time"
          },
          "paid": {
            "type": [
              "null",
              "string"
            ],
            "description": "Datetime when the payment was made",
            "format": "date-time"
          },
          "invitationAccepted": {
            "type": [
              "null",
              "string"
            ],
            "description": "Datetime when the invitation was accepted",
            "format": "date-time"
          },
          "invitationRejected": {
            "type": [
              "null",
              "string"
            ],
            "description": "Datetime when the invitation was rejected",
            "format": "date-time"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Total amount paid to escrow",
            "format": "double"
          }
        }
      },
      "CreateBusinessUser.Command.BodyModel": {
        "required": [
          "businessId",
          "businessLocationId",
          "name",
          "phoneNumber",
          "address",
          "payoutsAccountNumber"
        ],
        "type": "object",
        "properties": {
          "businessId": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "businessLocationId": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "maxLength": 200,
            "minLength": 2,
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/Models.AddressModel"
          },
          "payoutsAccountNumber": {
            "maxLength": 18,
            "minLength": 14,
            "type": "string",
            "description": "Can either be a 14 digits BBAN number or a valid danish IBAN number"
          }
        }
      },
      "CreateBusinessUser.Model": {
        "required": [
          "symblepayUserId",
          "businessId",
          "businessLocationId",
          "userId"
        ],
        "type": "object",
        "properties": {
          "symblepayUserId": {
            "type": "string"
          },
          "businessId": {
            "type": "string"
          },
          "businessLocationId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "bankAccount": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The bank account that has been chosen as payout account.",
                "$ref": "#/components/schemas/Models.BankAccountModel"
              }
            ]
          },
          "address": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Models.AddressModel"
              }
            ]
          }
        }
      },
      "EditBusinessUser.Command.BodyModel": {
        "required": [
          "name",
          "phoneNumber",
          "address",
          "payoutsAccountNumber"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 200,
            "minLength": 2,
            "type": [
              "null",
              "string"
            ]
          },
          "phoneNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Models.AddressModel"
              }
            ]
          },
          "payoutsAccountNumber": {
            "maxLength": 18,
            "minLength": 14,
            "type": [
              "null",
              "string"
            ],
            "description": "Can either be a 14 digits BBAN number or a valid danish IBAN number"
          }
        }
      },
      "EditBusinessUser.Model": {
        "required": [
          "symblepayUserId",
          "businessId",
          "businessLocationId"
        ],
        "type": "object",
        "properties": {
          "symblepayUserId": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string",
            "description": "Symblepay user id that has been connected to the marketplace user id."
          },
          "businessId": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "businessLocationId": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "bankAccount": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The bank account that has been chosen as payout account.",
                "$ref": "#/components/schemas/Models.BankAccountModel"
              }
            ]
          },
          "address": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Models.AddressModel"
              }
            ]
          }
        }
      },
      "ErrorKeyValue": {
        "required": [
          "key",
          "value"
        ],
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Key identifying what part of the error has an issue"
          },
          "value": {
            "type": "string",
            "description": "Error for the key"
          }
        }
      },
      "FeesModel": {
        "type": "object",
        "properties": {
          "fixedAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Symblepay fixed fee for moving money.\r\nExample: 4.50",
            "format": "double"
          },
          "variableAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Symblepay variable fee for moving money.\r\nExample: 50.00",
            "format": "double"
          },
          "variablePercentage": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Symblepay variable fee percentage.\r\nExample: 5",
            "format": "double"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Symblepay combined amount (fixed + variable)\r\nExample: 9.5",
            "format": "double"
          }
        }
      },
      "FinishedPhase": {
        "required": [
          "succeeded",
          "cancelled"
        ],
        "type": "object",
        "properties": {
          "succeeded": {
            "type": [
              "null",
              "string"
            ],
            "description": "Datetime when this trade successfully was traded",
            "format": "date-time"
          },
          "cancelled": {
            "type": [
              "null",
              "string"
            ],
            "description": "Datetime when this trade was cancelled",
            "format": "date-time"
          },
          "returned": {
            "type": [
              "null",
              "string"
            ],
            "description": "Datetime when money was returned to payer",
            "format": "date-time"
          },
          "released": {
            "type": [
              "null",
              "string"
            ],
            "description": "Datetime when money was released to payee",
            "format": "date-time"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Amount returned or released",
            "format": "double"
          }
        }
      },
      "GetBusinessUser.Model": {
        "required": [
          "symblepayUserId",
          "businessId",
          "businessLocationId"
        ],
        "type": "object",
        "properties": {
          "symblepayUserId": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string",
            "description": "Symblepay user id that has been connected to the marketplace user id."
          },
          "businessId": {
            "type": "string"
          },
          "businessLocationId": {
            "type": "string"
          },
          "bankAccount": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The bank account that has been chosen as payout account.",
                "$ref": "#/components/schemas/Models.BankAccountModel"
              }
            ]
          },
          "address": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Models.AddressModel"
              }
            ]
          }
        }
      },
      "GetDefaultSetupBankAccountLinkCommand.Command.BodyModel": {
        "type": "object",
        "properties": {
          "returnUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "appSwitch": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "For native app flows to work this needs to be filled to allow switching back to the native app.",
                "$ref": "#/components/schemas/MarketplaceConstants.AppSwitchModel"
              }
            ]
          }
        }
      },
      "GetDefaultSetupBankAccountLinkCommand.Model": {
        "required": [
          "redirectUrl"
        ],
        "type": "object",
        "properties": {
          "redirectUrl": {
            "maxLength": 2048,
            "type": "string",
            "description": "The redirectUrl to forward a user to, to begin the flow",
            "format": "uri"
          }
        },
        "example": {
          "redirectUrl": "https://api.safepaynordic.dk/initiate-payout-bank-flow"
        }
      },
      "GetPaymentLink.Command.BodyModel": {
        "required": [
          "successUrl",
          "cancelUrl"
        ],
        "type": "object",
        "properties": {
          "successUrl": {
            "maxLength": 2048,
            "minLength": 1,
            "type": "string"
          },
          "cancelUrl": {
            "maxLength": 2048,
            "minLength": 1,
            "type": "string"
          },
          "appSwitch": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "For native app flows to work this needs to be filled to allow switching back to the native app.",
                "$ref": "#/components/schemas/MarketplaceConstants.AppSwitchModel"
              }
            ]
          }
        }
      },
      "GetPaymentLink.Model": {
        "required": [
          "redirectUrl"
        ],
        "type": "object",
        "properties": {
          "redirectUrl": {
            "type": "string",
            "description": "The url to redirect the marketplace user to",
            "format": "uri"
          }
        }
      },
      "GetStatusLinkQuery.Model": {
        "required": [
          "redirectUrl"
        ],
        "type": "object",
        "properties": {
          "redirectUrl": {
            "type": "string",
            "description": "The url to redirect the marketplace user to",
            "format": "uri"
          }
        },
        "example": {
          "redirectUrl": "https://api.safepaynordic.dk/marketplace/status"
        }
      },
      "GetStatusLinkQuery.Query.BodyModel": {
        "required": [
          "returnUrl"
        ],
        "type": "object",
        "properties": {
          "returnUrl": {
            "maxLength": 2048,
            "minLength": 1,
            "type": [
              "null",
              "string"
            ]
          },
          "appSwitch": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "For native app flows to work this needs to be filled to allow switching back to the native app.",
                "$ref": "#/components/schemas/MarketplaceConstants.AppSwitchModel"
              }
            ]
          }
        }
      },
      "GetStatusQuery.Model": {
        "required": [
          "symblepayUserId",
          "name"
        ],
        "type": "object",
        "properties": {
          "symblepayUserId": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string",
            "description": "Symblepay user id that has been connected to the marketplace user id."
          },
          "bankAccount": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The bank account that has been chosen as payout account.",
                "$ref": "#/components/schemas/Models.BankAccountModel"
              }
            ]
          },
          "name": {
            "type": "string",
            "description": "The name of the symblepay user."
          },
          "phoneNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "The phone number of the symblepay user."
          },
          "hasCompletedOnboarding": {
            "type": "boolean",
            "description": "True if the user has completed all onboarding"
          }
        },
        "example": {
          "symblepayUserId": "9a1d4a0c-9700-4e18-bc77-7bc7d4a32c66",
          "bankAccount": {
            "bank": "Danske Bank",
            "accountNumber": "DK5000400440116243",
            "name": "Salary account"
          },
          "name": "John Doe",
          "phoneNumber": "+45 12345678",
          "hasCompletedOnboarding": false
        }
      },
      "GetTrades.Command.PaginationModel": {
        "required": [
          "pageSize",
          "page"
        ],
        "type": "object",
        "properties": {
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "GetTrades.Model": {
        "required": [
          "trades",
          "pagination"
        ],
        "type": "object",
        "properties": {
          "trades": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Trade"
            },
            "description": "The trades that the user has"
          },
          "pagination": {
            "$ref": "#/components/schemas/GetTrades.Command.PaginationModel"
          }
        }
      },
      "ImageModel": {
        "required": [
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "MarketplaceApiErrorResponse": {
        "required": [
          "type",
          "title",
          "status",
          "instance",
          "traceId",
          "typeCode"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The type of error that occured",
            "format": "uri"
          },
          "title": {
            "type": "string",
            "description": "A single line describing the error"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ],
            "description": "A detailed description of the error"
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The status code of the error",
            "format": "int32"
          },
          "instance": {
            "type": "string",
            "description": "The instance of error that occured",
            "format": "uri"
          },
          "errors": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ErrorKeyValue"
            },
            "description": "A list of errors wrong with the request"
          },
          "traceId": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string",
            "description": "The correlation id passed in X-Correlation-Id header or the generated Id, if none was passed"
          },
          "typeCode": {
            "type": "string",
            "description": "The type code of the error, used for identifying the error"
          }
        },
        "example": {
          "type": "https://developer.safepaynordic.dk/errors/transaction/not-found",
          "title": "The trade id was not known",
          "detail": "The trade id need to be created and belonging to your account. Ensure that {TradeId} is belonging to your organization and it is created",
          "status": 0,
          "instance": "https://api.safepaynordic.dk/v1/marketplace/transaction",
          "errors": [
            {
              "key": "name",
              "value": "Name was not above the required 20 chars"
            }
          ],
          "traceId": "d468dfbe-323d-48a4-8399-e6104876331a",
          "typeCode": "not-found"
        }
      },
      "MarketplaceConstants.AppSwitchModel": {
        "required": [
          "appSwitchCallbackUri",
          "operatingSystem"
        ],
        "type": "object",
        "properties": {
          "appSwitchCallbackUri": {
            "maxLength": 2048,
            "type": "string",
            "description": "The uri used to navigate back to a native app after app switch to MitID or MobilePay"
          },
          "isAndroid": {
            "type": "boolean"
          },
          "isIos": {
            "type": "boolean"
          },
          "operatingSystem": {
            "description": "The Operating system the checkout takes place on",
            "$ref": "#/components/schemas/MarketplaceConstants.AppSwitchModel.OperatingSystems"
          }
        }
      },
      "MarketplaceConstants.AppSwitchModel.OperatingSystems": {
        "enum": [
          "Android",
          "IOs"
        ]
      },
      "MilestoneIcon": {
        "enum": [
          "delivery_in_progress",
          "approve",
          "delivery_time",
          "please_wait",
          "escrow_active",
          "escrow_succeded",
          "escrow_cancelled",
          "trade_succesful",
          "paid_to_escrow",
          "item_approved",
          "item_rejected",
          "insurance",
          "physical_delivery",
          "shop",
          "phone"
        ]
      },
      "Models.AddressModel": {
        "required": [
          "streetName",
          "houseNumber",
          "city",
          "postNumber",
          "municipalityName"
        ],
        "type": "object",
        "properties": {
          "streetName": {
            "type": "string"
          },
          "houseNumber": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "postNumber": {
            "type": "string"
          },
          "municipalityName": {
            "type": "string"
          },
          "floor": {
            "type": [
              "null",
              "string"
            ]
          },
          "sideDoor": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "Models.BankAccountModel": {
        "required": [
          "bank",
          "accountNumber",
          "name"
        ],
        "type": "object",
        "properties": {
          "bank": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string",
            "description": "The bank, the account originates from."
          },
          "accountNumber": {
            "maxLength": 34,
            "minLength": 1,
            "type": "string",
            "description": "The account number. This can be an iban or bban number."
          },
          "name": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string",
            "description": "The account name"
          }
        }
      },
      "Payment": {
        "required": [
          "externalId",
          "amount",
          "isPaid",
          "state"
        ],
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isPaid": {
            "type": "boolean"
          },
          "state": {
            "$ref": "#/components/schemas/Payment.PaymentStateDto"
          }
        }
      },
      "Payment.PaymentStateDto": {
        "enum": [
          "Pending",
          "Paid",
          "Failed"
        ]
      },
      "PhasesModel": {
        "type": "object",
        "properties": {
          "contract": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Details regarding the creation and payment phase",
                "$ref": "#/components/schemas/ContractPhase"
              }
            ]
          },
          "delivery": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Details regarding the delivery phase",
                "$ref": "#/components/schemas/ShipmentPhase"
              }
            ]
          },
          "return": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Details regarding the return phase",
                "$ref": "#/components/schemas/ShipmentPhase"
              }
            ]
          },
          "finished": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Details regarding the finished phase",
                "$ref": "#/components/schemas/FinishedPhase"
              }
            ]
          }
        },
        "description": "The phases for this trade\r\n\r\nPossible Phase flows\r\n- Creation -&gt; Finished\r\n- Creation -&gt; Payment -&gt; Finished\r\n- Creation -&gt; Payment -&gt; Delivery -&gt; Finished\r\n- Creation -&gt; Payment -&gt; Delivery -&gt; Return -&gt; Finished"
      },
      "PrioritizedPayeeModel": {
        "required": [
          "symblepayAccountId",
          "amount",
          "bankReferenceText"
        ],
        "type": "object",
        "properties": {
          "symblepayAccountId": {
            "type": "string",
            "description": "The Symblepay Account Id for the prioritized payee"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Amount of money this payee should receive of the total amount.",
            "format": "double"
          },
          "bankReferenceText": {
            "type": "string",
            "description": "Text to write on the bank line when payout occurs"
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Helpful text to describe the purpose of this prioritized payee"
          }
        }
      },
      "ReimbursePayerCommand.Command.BodyModel": {
        "required": [
          "amount"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "ReimbursePayerCommand.Model": {
        "type": "object"
      },
      "RejectedReasonModel": {
        "type": "object",
        "properties": {
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Reason for rejection of the shipment phase"
          },
          "images": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ImageModel"
            }
          }
        }
      },
      "ShipmentPhase": {
        "type": "object",
        "properties": {
          "started": {
            "type": [
              "null",
              "string"
            ],
            "description": "Datetime when this phase started",
            "format": "date-time"
          },
          "paid": {
            "type": [
              "null",
              "string"
            ],
            "description": "DateTime of when payment for the shipment was received",
            "format": "date-time"
          },
          "sent": {
            "type": [
              "null",
              "string"
            ],
            "description": "DateTime of when for the shipment was sent",
            "format": "date-time"
          },
          "lost": {
            "type": [
              "null",
              "string"
            ],
            "description": "DateTime of when for the shipment was lost",
            "format": "date-time"
          },
          "readyForPickup": {
            "type": [
              "null",
              "string"
            ],
            "description": "DateTime of when the shipment was delivered to shop for pickup",
            "format": "date-time"
          },
          "delivered": {
            "type": [
              "null",
              "string"
            ],
            "description": "DateTime of when the shipment was delivered to receiver",
            "format": "date-time"
          },
          "approved": {
            "type": [
              "null",
              "string"
            ],
            "description": "DateTime of approval of the shipment phase",
            "format": "date-time"
          },
          "rejected": {
            "type": [
              "null",
              "string"
            ],
            "description": "DateTime of rejection of the shipment phase",
            "format": "date-time"
          },
          "labelPricePayer": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Price for the shipment label for the Payer",
            "format": "double"
          },
          "labelPricePayee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Price for the shipment label for the Payee",
            "format": "double"
          },
          "labelCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "Labelless code for the shipment"
          },
          "labelQrCodeLink": {
            "type": [
              "null",
              "string"
            ],
            "description": "Label QR code link for the shipment"
          },
          "labelPaidBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ValueType<UserTypeExternal>"
              }
            ]
          },
          "labelId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Shipment Id for the label"
          },
          "shippingProvider": {
            "type": [
              "null",
              "string"
            ],
            "description": "The shipping provider the label was bought through"
          },
          "labelTracking": {
            "type": [
              "null",
              "string"
            ],
            "description": "Track and trace link for the shipment",
            "format": "uri"
          },
          "rejectedReason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Reason for rejection of the shipment phase",
                "$ref": "#/components/schemas/RejectedReasonModel"
              }
            ]
          },
          "shopName": {
            "type": [
              "null",
              "string"
            ],
            "description": "The name of the selected parcel shop for the shipment."
          },
          "shopAddressFull": {
            "type": [
              "null",
              "string"
            ],
            "description": "The address of the selected parcel shop for the shipment."
          }
        }
      },
      "StatusModel": {
        "required": [
          "title"
        ],
        "type": "object",
        "properties": {
          "deadline": {
            "type": [
              "null",
              "string"
            ],
            "description": "Datetime for next deadline in this trade",
            "format": "date-time"
          },
          "deadlineDescription": {
            "type": [
              "null",
              "string"
            ],
            "description": "Description for next deadline in this trade"
          },
          "title": {
            "type": "string",
            "description": "Short title for current state"
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Description for current state"
          },
          "iconId": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Icon id for current state",
                "$ref": "#/components/schemas/ValueType<MilestoneIcon>"
              }
            ]
          },
          "actions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ActionModel"
            },
            "description": "List of actions the user can take"
          },
          "hasPendingAction": {
            "type": "boolean",
            "description": "True if the user is responsible for progressing the trade to next phase"
          }
        }
      },
      "SubmitCheckoutCommand.Command.CheckoutBody": {
        "required": [
          "title",
          "description",
          "amount",
          "payerFee",
          "payerFixedFee",
          "payeeFee",
          "payeeFixedFee",
          "payerMarketplaceUserId",
          "payeeMarketplaceUserId",
          "successUrl",
          "cancelUrl"
        ],
        "type": "object",
        "properties": {
          "title": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string",
            "description": "The title users will see for this item in Symblepay"
          },
          "description": {
            "maxLength": 5000,
            "minLength": 1,
            "type": "string",
            "description": "The description users will see for this item in Symblepay"
          },
          "amount": {
            "maximum": 10000000,
            "minimum": 5,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The amount of money the item is being sold for. The amount will be rounded to 2 decimals if more than two decimals are send.",
            "format": "double"
          },
          "payerFee": {
            "maximum": 100,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The percentage used to calculate the payers fee on top of the amount. This fee is the total fee and the agreed Symblepay percentage fee will be taken from this value.",
            "format": "double"
          },
          "payerFixedFee": {
            "maximum": 2147483647,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The fixed fee used to calculate the payers fee taken before payouts. This fee is the fixed fee and the agreed Symblepay fixed fee will be taken from this value.",
            "format": "double"
          },
          "payeeFee": {
            "maximum": 100,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The percentage used to calculate the payees fee taken before payouts. This fee is the total fee and the agreed Symblepay percentage fee will be taken from this value.",
            "format": "double"
          },
          "payeeFixedFee": {
            "maximum": 2147483647,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The fixed fee used to calculate the payees fee taken before payouts. This fee is the fixed fee and the agreed Symblepay fixed fee will be taken from this value.",
            "format": "double"
          },
          "payerMarketplaceUserId": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string",
            "description": "The marketplace user id for the payer in the trade"
          },
          "payeeMarketplaceUserId": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string",
            "description": "The marketplace user id for the payee in the trade. This user should already be connected through the connect-flow"
          },
          "referenceId": {
            "maxLength": 64,
            "type": [
              "null",
              "string"
            ],
            "description": "The reference id for this trade on the Marketplace side."
          },
          "checkoutIdempotencyKey": {
            "maxLength": 64,
            "minLength": 1,
            "type": [
              "null",
              "string"
            ],
            "description": "The unique idempotency key for this trade. There will only be at most one successful payment and checkout for this key"
          },
          "checkoutUniquenessKey": {
            "maxLength": 64,
            "minLength": 1,
            "type": [
              "null",
              "string"
            ],
            "description": "The unique key for this trade. There will only be at most one successful payment and checkout for this key"
          },
          "deliveryByHandAllowed": {
            "type": "boolean",
            "description": "Specifies if the seller has agreed on By Hand Delivery"
          },
          "shipping": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Shipping information if it is included in the trade",
                "$ref": "#/components/schemas/SubmitCheckoutCommand.Command.CheckoutBody.ShippingModel"
              }
            ]
          },
          "returnShipping": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SubmitCheckoutCommand.Command.CheckoutBody.ReturnShippingModel"
              }
            ]
          },
          "successUrl": {
            "maxLength": 2048,
            "type": "string",
            "description": "The uri users are forwarded to after a successful payment."
          },
          "cancelUrl": {
            "maxLength": 2048,
            "type": "string",
            "description": "The uri users are returned to if they cancel the flow."
          },
          "imageUrls": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Optional list of image uris used to describe the item."
          },
          "appSwitch": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "For native app flows to work this needs to be filled to allow switching back to the native app.",
                "$ref": "#/components/schemas/MarketplaceConstants.AppSwitchModel"
              }
            ]
          },
          "allowedTimeForItemDeliveryInMinutes": {
            "maximum": 129600,
            "minimum": 1,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The allowed time in minutes for payee to send or deliver the package after payer has paid.",
            "format": "int32"
          },
          "prioritizedPayees": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/SubmitCheckoutCommand.Command.CheckoutBody.PrioritizedPayeeModel"
            }
          }
        },
        "example": {
          "title": "Adidas Campus 00s",
          "description": "Almost new Adidas Campus 00s. Used 3 times and still have the box and receipt.",
          "amount": 1200.5,
          "payerFee": 5,
          "payerFixedFee": 0,
          "payeeFee": 3.5,
          "payeeFixedFee": 0,
          "payerMarketplaceUserId": "003dc3d2-dc30-4b37-a573-f664a03f5154",
          "payeeMarketplaceUserId": "82f700bd-5789-4623-95e7-0d34fde4720c",
          "referenceId": "971861ba-947a-4b54-9c3d-be3eaa16b113",
          "checkoutIdempotencyKey": "e5e09423-1ebb-46ce-847c-24970479373a",
          "checkoutUniquenessKey": "e5e09423-1ebb-46ce-847c-24970479373a",
          "deliveryByHandAllowed": false,
          "shipping": {
            "expectedMaxWeight": 1000,
            "paidBy": 0,
            "returnPaidBy": 0,
            "shippingOptions": null,
            "sender": null,
            "receiver": null,
            "price": 39
          },
          "autoInformation": null,
          "returnShipping": null,
          "checkoutType": 0,
          "successUrl": "https://marketplace.dk/success",
          "cancelUrl": "https://marketplace.dk/cancel",
          "imageUrls": [
            "https://marketplace.dk/images/image-a.png",
            "https://marketplace.dk/images/image-b.svg"
          ],
          "appSwitch": null,
          "allowedTimeForItemDeliveryInMinutes": null,
          "prioritizedPayees": null
        }
      },
      "SubmitCheckoutCommand.Command.CheckoutBody.PrioritizedPayeeModel": {
        "required": [
          "symblepayAccountId",
          "amount",
          "bankReferenceText"
        ],
        "type": "object",
        "properties": {
          "symblepayAccountId": {
            "type": "string",
            "description": "The Symblepay Account Id for the prioritized payee"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Amount of money this payee should receive of the total amount.",
            "format": "double"
          },
          "bankReferenceText": {
            "type": "string",
            "description": "Text to write on the bank line when payout occurs"
          },
          "fikCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "Fælles Indbetalings Kort (FIK) code to use for payment instead of Bank Account"
          },
          "bankAccount": {
            "type": [
              "null",
              "string"
            ],
            "description": "The bank account to which the money should be transferred to. Must be a valid danish BBAN or IBAN"
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Helpful text to describe the purpose of this prioritized payee"
          }
        }
      },
      "SubmitCheckoutCommand.Command.CheckoutBody.ReturnShippingModel": {
        "type": "object",
        "properties": {
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "The price users need to pay for shipping of for this trade when returning the item.",
            "format": "double"
          }
        }
      },
      "SubmitCheckoutCommand.Command.CheckoutBody.ShippingModel": {
        "required": [
          "expectedMaxWeight",
          "paidBy"
        ],
        "type": "object",
        "properties": {
          "expectedMaxWeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The expected max weight in gram.",
            "format": "int32"
          },
          "paidBy": {
            "description": "Specifies who upholds the cost for shipping in this trade.",
            "$ref": "#/components/schemas/UserTypeExternal"
          },
          "returnPaidBy": {
            "description": "Specifies who upholds the cost for shipping in this trade when returning the item.",
            "$ref": "#/components/schemas/UserTypeExternal"
          },
          "shippingOptions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/SubmitCheckoutCommand.Command.CheckoutBody.ShippingOption"
            },
            "description": "Specifies which shipping options are allowed for this trade."
          },
          "sender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Sender information, used for the shipment, this will also be the information displayed on labels, emails etc...",
                "$ref": "#/components/schemas/SubmitCheckoutCommand.Command.CheckoutBody.ShippingUser"
              }
            ]
          },
          "receiver": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Receiver information, used for the shipment, this will also be the information displayed on labels, emails etc...",
                "$ref": "#/components/schemas/SubmitCheckoutCommand.Command.CheckoutBody.ShippingUser"
              }
            ]
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "The price users need to pay for shipping of for this trade",
            "format": "double"
          }
        }
      },
      "SubmitCheckoutCommand.Command.CheckoutBody.ShippingOption": {
        "required": [
          "method",
          "deliveryPrice",
          "returnPrice"
        ],
        "type": "object",
        "properties": {
          "method": {
            "description": "Specifies which ShippingProviders are allowed for this trade. Possible options are [Dao, PostNord]",
            "$ref": "#/components/schemas/SubmitCheckoutCommand.Command.CheckoutBody.ShippingOption.ShippingMethod"
          },
          "deliveryPrice": {
            "maximum": 100000,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The price users need to pay for shipping of for this trade",
            "format": "double"
          },
          "returnPrice": {
            "maximum": 100000,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The price users need to pay for returning for this trade",
            "format": "double"
          }
        }
      },
      "SubmitCheckoutCommand.Command.CheckoutBody.ShippingOption.ShippingMethod": {
        "enum": [
          "Dao",
          "PostNord",
          "Bring"
        ]
      },
      "SubmitCheckoutCommand.Command.CheckoutBody.ShippingUser": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Full name which will be present on label"
          },
          "email": {
            "type": [
              "null",
              "string"
            ],
            "description": "Email for the user"
          },
          "phoneNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "Phone number for the user"
          },
          "address": {
            "type": [
              "null",
              "string"
            ],
            "description": "Address for the user"
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "Postalcode for the user"
          },
          "city": {
            "type": [
              "null",
              "string"
            ],
            "description": "City for the user"
          }
        }
      },
      "SubmitCheckoutCommand.Model": {
        "required": [
          "redirectUrl",
          "tradeId"
        ],
        "type": "object",
        "properties": {
          "redirectUrl": {
            "maxLength": 2048,
            "minLength": 1,
            "type": "string",
            "description": "The uri users should be forwarded to when they want to pay for this item.",
            "format": "uri"
          },
          "tradeId": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string",
            "description": "The id for this trade. Should be saved for later references."
          }
        },
        "example": {
          "redirectUrl": "https://api.safepaynordic.dk/v1/marketplace/connect/e3e5f328-4d00-46a7-ba42-5c285add6bbf",
          "tradeId": "295a2546-ee78-4ec4-9e0f-b49af13536b8"
        }
      },
      "TimelineModel": {
        "required": [
          "id",
          "title",
          "description",
          "iconId",
          "state",
          "date",
          "detailsTitle"
        ],
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Timelines.TimelineMilestoneId"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "iconId": {
            "$ref": "#/components/schemas/MilestoneIcon"
          },
          "state": {
            "$ref": "#/components/schemas/TimelineState"
          },
          "date": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "detailsTitle": {
            "type": "string"
          },
          "detailsDeadlineDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "detailsDescription": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "Timelines.TimelineMilestoneId": {
        "enum": [
          "cancelled",
          "cancelled_by_buyer",
          "cancelled_by_seller",
          "cancelled_with_payment_to_buyer",
          "cancelled_by_buyer_with_payment_to_buyer",
          "cancelled_by_seller_with_payment_to_buyer",
          "delivery_condition_accepted",
          "delivery_condition_rejected",
          "delivery_deadline_exceeded",
          "delivery_shipment_delivered",
          "delivery_shipment_lost",
          "delivery_shipment_pickup_ready",
          "delivery_shipment_sent",
          "finished",
          "invitation_send",
          "insurance_activated",
          "paid_to_escrow",
          "return_condition_accepted",
          "return_condition_rejected",
          "return_deadline_exceeded",
          "return_delivery_shipment_delivered",
          "return_shipment_lost",
          "return_shipment_pickup_ready",
          "return_shipment_sent"
        ]
      },
      "TimelineState": {
        "enum": [
          "Past",
          "Current",
          "Future"
        ]
      },
      "Trade": {
        "required": [
          "tradeId",
          "payer",
          "payee",
          "createdBy",
          "title",
          "price",
          "phases"
        ],
        "type": "object",
        "properties": {
          "tradeId": {
            "type": "string",
            "description": "The id for the item in Symblepay"
          },
          "payer": {
            "description": "The user information for the payer in this trade",
            "$ref": "#/components/schemas/UserModel"
          },
          "payee": {
            "description": "The user information for the payee in this trade",
            "$ref": "#/components/schemas/UserModel"
          },
          "createdBy": {
            "type": "string",
            "description": "The SymblepayUserId of the creator user"
          },
          "referenceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The id for the item on the Marketplace"
          },
          "title": {
            "type": "string",
            "description": "The title for this item in Symblepay"
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "The description for this item in Symblepay"
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The amount of money the item is being sold for",
            "format": "double"
          },
          "prioritizedPayees": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PrioritizedPayeeModel"
            }
          },
          "phases": {
            "$ref": "#/components/schemas/PhasesModel"
          },
          "images": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ImageModel"
            }
          }
        },
        "example": {
          "tradeId": "a95a1320-fce8-4838-9ff2-286501b45350",
          "payer": {
            "symblepayUserId": "003dc3d2-dc30-4b37-a573-f664a03f5154",
            "phoneNumber": null,
            "name": "Lars Jensen",
            "city": "Trørød",
            "postalCode": "2950",
            "address": "Bygstubben 3",
            "fees": {
              "fixedAmount": 0,
              "variableAmount": 0,
              "variablePercentage": 0,
              "amount": 0
            },
            "status": {
              "deadline": null,
              "deadlineDescription": null,
              "title": "Venter på levering af pakken",
              "description": null,
              "iconId": null,
              "actions": null,
              "hasPendingAction": false
            },
            "timeline": [ ]
          },
          "payee": {
            "symblepayUserId": "82f700bd-5789-4623-95e7-0d34fde4720c",
            "phoneNumber": null,
            "name": "Jytte Larsen",
            "city": "Aarhus",
            "postalCode": "8000",
            "address": "Immervad 2",
            "fees": {
              "fixedAmount": 0,
              "variableAmount": 0,
              "variablePercentage": 0,
              "amount": 0
            },
            "status": {
              "deadline": null,
              "deadlineDescription": null,
              "title": "Venter på levering af pakken",
              "description": null,
              "iconId": null,
              "actions": null,
              "hasPendingAction": false
            },
            "timeline": [ ]
          },
          "createdBy": "82f700bd-5789-4623-95e7-0d34fde4720c",
          "referenceId": "3811b9da-dd5b-4834-b266-2414e76276aa",
          "title": "Adidas Campus 00s",
          "description": "Campus 00s Crystal White / Core Black / Off White",
          "price": 1050,
          "prioritizedPayees": null,
          "phases": {
            "contract": null,
            "delivery": null,
            "return": null,
            "finished": null
          },
          "images": null
        }
      },
      "UserModel": {
        "required": [
          "symblepayUserId",
          "name",
          "city",
          "postalCode",
          "address",
          "status"
        ],
        "type": "object",
        "properties": {
          "symblepayUserId": {
            "type": "string",
            "description": "The user id in Symblepay"
          },
          "phoneNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "The phone number in Symblepay"
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The full name for the user"
          },
          "city": {
            "type": [
              "null",
              "string"
            ],
            "description": "The city registered for the user"
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "The postal code registered for the user"
          },
          "address": {
            "type": [
              "null",
              "string"
            ],
            "description": "The address registered for the user"
          },
          "fees": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The amount of money the user needs to pays for this trade",
                "$ref": "#/components/schemas/FeesModel"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/StatusModel"
          },
          "timeline": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimelineModel"
            }
          }
        }
      },
      "UserTypeExternal": {
        "enum": [
          "Payer",
          "Payee"
        ]
      },
      "ValueType<MilestoneIcon>": {
        "enum": [
          "delivery_in_progress",
          "approve",
          "delivery_time",
          "please_wait",
          "escrow_active",
          "escrow_succeded",
          "escrow_cancelled",
          "trade_succesful",
          "paid_to_escrow",
          "item_approved",
          "item_rejected",
          "insurance",
          "physical_delivery",
          "shop",
          "phone",
          null
        ]
      },
      "ValueType<UserTypeExternal>": {
        "enum": [
          "Payer",
          "Payee",
          null
        ]
      }
    },
    "securitySchemes": {
      "API Key": {
        "type": "http",
        "description": "Authorization header using the Bearer scheme, e.g., ```Authorization: Bearer {API Key}```",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "API Key": [ ]
    }
  ],
  "tags": [
    {
      "name": "Business Users"
    },
    {
      "name": "Trades"
    },
    {
      "name": "Users"
    },
    {
      "name": "Trade actions"
    }
  ]
}