{
  "openapi": "3.0.1",
  "info": {
    "title": "Bnpl Payment Order API 1.0",
    "description": "",
    "contact": {
      "name": "PayEx"
    },
    "version": "1.0"
  },
  "paths": {
    "/ledger/bnpl-payment-order/v1/{ownerNo}/bnpl-payment-orders": {
      "post": {
        "tags": [
          "BnplPaymentOrder"
        ],
        "summary": "Create a payment order",
        "description": "Create a payment order to begin authorization process",
        "parameters": [
          {
            "name": "ownerNo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SellerNo",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1.BnplPaymentOrders.BnplPaymentOrdersResourceRequest"
              },
              "example": "{\r\n  \"authorizationAmount\": 1000.00,\r\n  \"currency\": \"SEK\",\r\n  \"sellerAuthorizationId\": \"1234567890\",\r\n  \"customer\": {\r\n    \"nationalConsumerIdentifier\": {\r\n      \"value\": \"YYYYMMDD-XXXX\",\r\n      \"countryCode\": \"SE\"\r\n    },\r\n    \"email\": \"example@payex.com\",\r\n    \"msisdn\": \"\\u002B46701234567\"\r\n  },\r\n  \"pointOfSale\": \"My Web Shop\",\r\n  \"mcc\": \"1234\",\r\n  \"restrictToProfiles\": [\r\n    {\r\n      \"profileName\": \"BA_PartPayment\",\r\n      \"subProfiles\": [\r\n        {\r\n          \"subProfileName\": \"InstallmentAccount_3\"\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n  \"instore\": false\r\n}"
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/V1.BnplPaymentOrders.BnplPaymentOrdersResourceRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/V1.BnplPaymentOrders.BnplPaymentOrdersResourceRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1.BnplPaymentOrders.BnplPaymentOrdersResource"
                },
                "examples": {
                  "Created": {
                    "description": "Newly created payment order with restricted account profiles",
                    "value": "{\r\n  \"paymentOrderId\": 1234567890,\r\n  \"status\": \"Created\",\r\n  \"authorizationAmount\": 1000.00,\r\n  \"remainingAmount\": 0,\r\n  \"currency\": \"SEK\",\r\n  \"sellerAuthorizationId\": \"1234567890\",\r\n  \"customer\": {\r\n    \"nationalConsumerIdentifier\": {\r\n      \"value\": \"YYYYMMDD-XXXX\",\r\n      \"countryCode\": \"SE\"\r\n    },\r\n    \"email\": \"example@payex.com\",\r\n    \"msisdn\": \"\\u002B46701234567\"\r\n  },\r\n  \"pointOfSale\": \"My Web Shop\",\r\n  \"mcc\": \"1234\",\r\n  \"restrictToProfiles\": [\r\n    {\r\n      \"profileName\": \"BA_PartPayment\",\r\n      \"subProfiles\": [\r\n        {\r\n          \"subProfileName\": \"InstallmentAccount_3\"\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n  \"instore\": false,\r\n  \"operations\": [\r\n    {\r\n      \"rel\": \"add-reversal\",\r\n      \"method\": \"POST\",\r\n      \"href\": \"/ledger/bnpl-payment-order/v1/xxx/bnpl-payment-orders/1234567890/reversals\"\r\n    },\r\n    {\r\n      \"rel\": \"redirect\",\r\n      \"method\": \"POST\",\r\n      \"href\": \"/ledger/bnpl-payment-order/v1/xxx/bnpl-payment-orders/1234567890/redirect\"\r\n    },\r\n    {\r\n      \"rel\": \"cancel-authorize\",\r\n      \"method\": \"POST\",\r\n      \"href\": \"/ledger/bnpl-payment-order/v1/xxx/bnpl-payment-orders/1234567890/cancel-authorize\"\r\n    },\r\n    {\r\n      \"rel\": \"add-capture\",\r\n      \"method\": \"POST\",\r\n      \"href\": \"/ledger/bnpl-payment-order/v1/xxx/bnpl-payment-orders/1234567890/captures\"\r\n    }\r\n  ],\r\n  \"@id\": \"/ledger/bnpl-payment-order/v1/xxx/bnpl-payment-orders/1234567890\"\r\n}"
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "examples": {
                  "identifier-already-in-use": {
                    "description": "SellerAuthorizationId [xxxx] already exists. It is used for payment order with PaymentOrderId [yyyyy]",
                    "value": "{\r\n  \"type\": \"identifier-already-in-use\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 409,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  },
                  "no-available-profiles": {
                    "description": "No profiles configured.",
                    "value": "{\r\n  \"type\": \"no-available-profiles\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 409,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "examples": {
                  "validation": {
                    "description": "occurs if any of the input validation fails, it is described in the problem which parameter that failed the validation",
                    "value": "{\r\n  \"type\": \"validation\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 400,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "examples": {
                  "not-found": {
                    "description": "the targeted resource was not found, cause could be both that it's not accessible with provided information/credentials or that the resource doesn't exist",
                    "value": "{\r\n  \"type\": \"not-found\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 404,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "examples": {
                  "fatal": {
                    "description": "an unexpected error has occurred",
                    "value": "{\r\n  \"type\": \"fatal\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 500,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ledger/bnpl-payment-order/v1/{ownerNo}/bnpl-payment-orders/{paymentOrderId}/cancel-authorize": {
      "post": {
        "tags": [
          "BnplPaymentOrder"
        ],
        "summary": "Cancellation of the authorize",
        "description": "This operation is for removing any remaining amount of an already completed authorization. Already captured amount is unaffected.",
        "parameters": [
          {
            "name": "ownerNo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SellerNo",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paymentOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayEx.LF.Api.Common.RepositoryResources.Results.RepositoryNoContentResult"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "examples": {
                  "not-found": {
                    "description": "the targeted resource was not found, cause could be both that it's not accessible with provided information/credentials or that the resource doesn't exist",
                    "value": "{\r\n  \"type\": \"not-found\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 404,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "examples": {
                  "fatal": {
                    "description": "an unexpected error has occurred",
                    "value": "{\r\n  \"type\": \"fatal\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 500,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ledger/bnpl-payment-order/v1/{ownerNo}/bnpl-payment-orders/{paymentOrderId}/captures": {
      "post": {
        "tags": [
          "BnplPaymentOrder"
        ],
        "summary": "Create a capture",
        "description": "Perform a capture to solidify the purchase for this payment order. Multiple captures can be done for one payment order as long as we have RemainingAmount left on the order.",
        "parameters": [
          {
            "name": "ownerNo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SellerNo",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paymentOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1.BnplPaymentOrders.Captures.CaptureRequest"
              },
              "example": "{\r\n  \"amount\": 1000.00,\r\n  \"currency\": \"SEK\",\r\n  \"orderLines\": [\r\n    {\r\n      \"itemDescription\": \"Phone\",\r\n      \"amount\": 1000.00\r\n    }\r\n  ],\r\n  \"sellerTransactionId\": \"Example-seller-123\",\r\n  \"receiptReference\": \"Example-receipt-Phone\"\r\n}"
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/V1.BnplPaymentOrders.Captures.CaptureRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/V1.BnplPaymentOrders.Captures.CaptureRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1.BnplPaymentOrders.Captures.CaptureResource"
                },
                "examples": {
                  "Created": {
                    "description": "Capture example with one item in the order line",
                    "value": "{\r\n  \"captureId\": 1234,\r\n  \"amount\": 1000.00,\r\n  \"currency\": \"SEK\",\r\n  \"orderLines\": [\r\n    {\r\n      \"itemDescription\": \"Phone\",\r\n      \"amount\": 1000.00\r\n    }\r\n  ],\r\n  \"sellerTransactionId\": \"Example-seller-123\",\r\n  \"receiptReference\": \"Example-receipt-Phone\",\r\n  \"@id\": \"https://example.com/capture/1234\"\r\n}"
                  }
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "examples": {
                  "validation": {
                    "description": "occurs if any of the input validation fails, it is described in the problem which parameter that failed the validation",
                    "value": "{\r\n  \"type\": \"validation\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 400,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "examples": {
                  "not-found": {
                    "description": "the targeted resource was not found, cause could be both that it's not accessible with provided information/credentials or that the resource doesn't exist",
                    "value": "{\r\n  \"type\": \"not-found\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 404,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "examples": {
                  "currency-not-supported": {
                    "description": "Currency for this capture is invalid for this payment order, make sure it match with currency specified at order creation",
                    "value": "{\r\n  \"type\": \"currency-not-supported\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 409,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  },
                  "identifier-already-in-use": {
                    "description": "SellerTransactionId [xxxx] already exists. It is used in the capture transaction with CaptureId [yyyy]",
                    "value": "{\r\n  \"type\": \"identifier-already-in-use\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 409,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "422": {
            "description": "UnprocessableEntity",
            "content": {
              "application/json": {
                "examples": {
                  "corrupt-resource": {
                    "description": "Performed action may or may not have been completed but result was corrupted or incomplete. Read details for more information.",
                    "value": "{\r\n  \"type\": \"corrupt-resource\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 422,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "examples": {
                  "fatal": {
                    "description": "an unexpected error has occurred",
                    "value": "{\r\n  \"type\": \"fatal\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 500,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ledger/bnpl-payment-order/v1/{ownerNo}/bnpl-payment-orders/{paymentOrderId}/reversals": {
      "post": {
        "tags": [
          "BnplPaymentOrder"
        ],
        "summary": "Reverse a capture",
        "description": "Can only reverse captures from this payment order",
        "parameters": [
          {
            "name": "ownerNo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SellerNo",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paymentOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1.BnplPaymentOrders.Reversals.ReversalRequest"
              },
              "example": "{\r\n  \"amount\": 1000.00,\r\n  \"currency\": \"SEK\",\r\n  \"sellerTransactionId\": \"123455679\",\r\n  \"receiptReference\": \"Example-receipt-Phone\"\r\n}"
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/V1.BnplPaymentOrders.Reversals.ReversalRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/V1.BnplPaymentOrders.Reversals.ReversalRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1.BnplPaymentOrders.Reversals.ReversalResource"
                },
                "examples": {
                  "Created": {
                    "description": "Reversal of 1000SEK",
                    "value": "{\r\n  \"reversalId\": \"12345678\",\r\n  \"amount\": 1000.00,\r\n  \"currency\": \"SEK\",\r\n  \"sellerTransactionId\": \"123455679\",\r\n  \"receiptReference\": \"Example-receipt-Phone\"\r\n}"
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "examples": {
                  "identifier-already-in-use": {
                    "description": "SellerTransactionId [xxxx] already exists. It is used in the capture transaction with ReversalId [yyyy]",
                    "value": "{\r\n  \"type\": \"identifier-already-in-use\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 409,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "examples": {
                  "validation": {
                    "description": "occurs if any of the input validation fails, it is described in the problem which parameter that failed the validation",
                    "value": "{\r\n  \"type\": \"validation\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 400,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "examples": {
                  "not-found": {
                    "description": "the targeted resource was not found, cause could be both that it's not accessible with provided information/credentials or that the resource doesn't exist",
                    "value": "{\r\n  \"type\": \"not-found\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 404,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "examples": {
                  "fatal": {
                    "description": "an unexpected error has occurred",
                    "value": "{\r\n  \"type\": \"fatal\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 500,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ledger/bnpl-payment-order/v1/{ownerNo}/bnpl-payment-orders/{paymentOrderId}": {
      "get": {
        "tags": [
          "BnplPaymentOrder"
        ],
        "summary": "Get PaymentOrder",
        "description": "Get the specified payment order",
        "operationId": "PayEx.AR.BnplPaymentOrder.Api.Resources.BnplPaymentOrder.V1.BnplPaymentOrders.BnplPaymentOrdersController_Id_GetSingle",
        "parameters": [
          {
            "name": "ownerNo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SellerNo",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paymentOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1.BnplPaymentOrders.BnplPaymentOrdersResource"
                },
                "examples": {
                  "OK": {
                    "description": "Payment order that has been authorized and with full RemainingAmount left",
                    "value": "{\r\n  \"paymentOrderId\": 1234567890,\r\n  \"status\": \"Authorized\",\r\n  \"authorizationAmount\": 1000.00,\r\n  \"remainingAmount\": 1000.00,\r\n  \"currency\": \"SEK\",\r\n  \"sellerAuthorizationId\": \"1234567890\",\r\n  \"customer\": {\r\n    \"nationalConsumerIdentifier\": {\r\n      \"value\": \"YYYYMMDD-XXXX\",\r\n      \"countryCode\": \"SE\"\r\n    },\r\n    \"email\": \"example@payex.com\",\r\n    \"msisdn\": \"\\u002B46701234567\"\r\n  },\r\n  \"pointOfSale\": \"My Web Shop\",\r\n  \"mcc\": \"1234\",\r\n  \"restrictToProfiles\": [\r\n    {\r\n      \"profileName\": \"BA_PartPayment\",\r\n      \"subProfiles\": [\r\n        {\r\n          \"subProfileName\": \"InstallmentAccount_3\"\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n  \"instore\": false,\r\n  \"operations\": [\r\n    {\r\n      \"rel\": \"add-reversal\",\r\n      \"method\": \"POST\",\r\n      \"href\": \"/ledger/bnpl-payment-order/v1/xxx/bnpl-payment-orders/1234567890/reversals\"\r\n    },\r\n    {\r\n      \"rel\": \"redirect\",\r\n      \"method\": \"POST\",\r\n      \"href\": \"/ledger/bnpl-payment-order/v1/xxx/bnpl-payment-orders/1234567890/redirect\"\r\n    },\r\n    {\r\n      \"rel\": \"cancel-authorize\",\r\n      \"method\": \"POST\",\r\n      \"href\": \"/ledger/bnpl-payment-order/v1/xxx/bnpl-payment-orders/1234567890/cancel-authorize\"\r\n    },\r\n    {\r\n      \"rel\": \"add-capture\",\r\n      \"method\": \"POST\",\r\n      \"href\": \"/ledger/bnpl-payment-order/v1/xxx/bnpl-payment-orders/1234567890/captures\"\r\n    }\r\n  ]\r\n}"
                  }
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "examples": {
                  "validation": {
                    "description": "occurs if any of the input validation fails, it is described in the problem which parameter that failed the validation",
                    "value": "{\r\n  \"type\": \"validation\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 400,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "examples": {
                  "not-found": {
                    "description": "the targeted resource was not found, cause could be both that it's not accessible with provided information/credentials or that the resource doesn't exist",
                    "value": "{\r\n  \"type\": \"not-found\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 404,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "examples": {
                  "fatal": {
                    "description": "an unexpected error has occurred",
                    "value": "{\r\n  \"type\": \"fatal\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 500,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ledger/bnpl-payment-order/v1/{ownerNo}/bnpl-payment-orders/{paymentOrderId}/redirect": {
      "post": {
        "tags": [
          "BnplPaymentOrder"
        ],
        "summary": "Get the page to the bnpl payment order site for the payee to complete an authorization",
        "description": "While payee is progressing the authorization implementor should start poll the parent resource BnplPaymentOrder for updates",
        "parameters": [
          {
            "name": "ownerNo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SellerNo",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paymentOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1.BnplPaymentOrders.Operations.Redirect.RedirectRequest"
              },
              "example": "{\r\n  \"returnUrl\": \"https://www.back-to-my-web-shop.com\",\r\n  \"redirectOptions\": {\r\n    \"languageCode\": \"SV\"\r\n  }\r\n}"
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/V1.BnplPaymentOrders.Operations.Redirect.RedirectRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/V1.BnplPaymentOrders.Operations.Redirect.RedirectRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1.BnplPaymentOrders.Operations.Redirect.RedirectResponse"
                },
                "examples": {
                  "OK": {
                    "description": "Example response containing redirect info for the chosen payment method",
                    "value": "{\r\n  \"redirectUrl\": \"https://www.open-chosen-payment-method-example.com\"\r\n}"
                  }
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "examples": {
                  "fatal": {
                    "description": "an unexpected error has occurred",
                    "value": "{\r\n  \"type\": \"fatal\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 500,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "examples": {
                  "not-found": {
                    "description": "the targeted resource was not found, cause could be both that it's not accessible with provided information/credentials or that the resource doesn't exist",
                    "value": "{\r\n  \"type\": \"not-found\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 404,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "examples": {
                  "validation": {
                    "description": "occurs if any of the input validation fails, it is described in the problem which parameter that failed the validation",
                    "value": "{\r\n  \"type\": \"validation\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 400,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "examples": {
                  "invalid-state": {
                    "description": "Invalid state of payment order for redirect",
                    "value": "{\r\n  \"type\": \"invalid-state\",\r\n  \"title\": \"Problem title\",\r\n  \"status\": 409,\r\n  \"detail\": \"Problem details\",\r\n  \"instance\": \"/traceId/e7e47c48-4a22-426e-9746-0dc0ea21d73a\"\r\n}"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PayEx.AR.BnplPaymentOrder.Api.Business.Entities.Currency": {
        "enum": [
          "SEK",
          "NOK",
          "DKK",
          "EUR"
        ],
        "type": "string"
      },
      "PayEx.AR.BnplPaymentOrder.Api.Business.Entities.LanguageCode": {
        "enum": [
          "EN",
          "SV",
          "NO",
          "DA"
        ],
        "type": "string"
      },
      "PayEx.AR.BnplPaymentOrder.Api.Business.Entities.NationalConsumerIdentifier": {
        "required": [
          "countryCode",
          "value"
        ],
        "type": "object",
        "properties": {
          "value": {
            "minLength": 1,
            "type": "string",
            "description": "The identifier - SSN, Personnummer, CPR, d-nummer, temporary identification number etc. Uniquely identifies the consumer. Visit developer.payex.com for information about supported national identifier format"
          },
          "countryCode": {
            "minLength": 1,
            "pattern": "SE|NO|DK|FI",
            "type": "string",
            "description": "The country code for the identifier value property. Valid values are 'SE', 'NO', 'DK', 'FI'. [[ISO 3166-1 alpha-2>>url:https://sv.wikipedia.org/wiki/ISO_3166]]"
          }
        },
        "additionalProperties": false
      },
      "PayEx.AR.BnplPaymentOrder.Api.Business.Entities.PaymentOrderStatus": {
        "enum": [
          "Created",
          "Rejected",
          "Canceled",
          "Authorized",
          "Failed"
        ],
        "type": "string",
        "description": "Server 2 Server status"
      },
      "PayEx.LF.Api.Common.RepositoryResources.IOperation": {
        "type": "object",
        "properties": {
          "rel": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "method": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "href": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PayEx.LF.Api.Common.RepositoryResources.Results.RepositoryNoContentResult": {
        "type": "object",
        "additionalProperties": false
      },
      "V1.BnplPaymentOrders.BnplPaymentOrdersResource": {
        "required": [
          "authorizationAmount",
          "currency",
          "customer",
          "paymentOrderId",
          "pointOfSale",
          "sellerAuthorizationId",
          "status"
        ],
        "type": "object",
        "properties": {
          "authorizationAmount": {
            "maximum": 100000000,
            "minimum": 0.01,
            "type": "number",
            "description": "The authorization amount, can't have more than 2 decimal places",
            "format": "double"
          },
          "currency": {
            "$ref": "#/components/schemas/PayEx.AR.BnplPaymentOrder.Api.Business.Entities.Currency"
          },
          "sellerAuthorizationId": {
            "maxLength": 50,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9#_:@.\\-åäöÅÄÖ]{1,}$",
            "type": "string",
            "description": "The seller's unique identifier of the authorize/payment order"
          },
          "customer": {
            "$ref": "#/components/schemas/V1.BnplPaymentOrders.Customer"
          },
          "pointOfSale": {
            "maxLength": 50,
            "minLength": 0,
            "pattern": "^[\\u0020-\\u003A \\u003C-\\u007E \\u00A0-\\u00FF \\u2019]*$",
            "type": "string",
            "description": "Trade name of the point of sale. Will be displayed to end customer."
          },
          "mcc": {
            "type": "string",
            "description": "Merchant Category Code",
            "nullable": true
          },
          "restrictToProfiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1.BnplPaymentOrders.Profile"
            },
            "description": "Filter configured profiles on exposed payment options. Leave as Null to show all configured payment options",
            "nullable": true
          },
          "instore": {
            "type": "boolean",
            "description": "This request is an Instore bnpl order",
            "nullable": true
          },
          "paymentOrderId": {
            "type": "integer",
            "description": "PaymentOrderId aka ExternalReservationId",
            "format": "int64"
          },
          "status": {
            "$ref": "#/components/schemas/PayEx.AR.BnplPaymentOrder.Api.Business.Entities.PaymentOrderStatus"
          },
          "remainingAmount": {
            "maximum": 100000000,
            "minimum": 0,
            "type": "number",
            "description": "Remaining amount of the authorize. If amount is zero then the authorize has already been fully used, cancelled or the payment order has not been authorized yet",
            "format": "double"
          },
          "operations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PayEx.LF.Api.Common.RepositoryResources.IOperation"
            },
            "nullable": true
          },
          "@id": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "V1.BnplPaymentOrders.BnplPaymentOrdersResourceRequest": {
        "required": [
          "authorizationAmount",
          "currency",
          "customer",
          "pointOfSale",
          "sellerAuthorizationId"
        ],
        "type": "object",
        "properties": {
          "authorizationAmount": {
            "maximum": 100000000,
            "minimum": 0.01,
            "type": "number",
            "description": "The authorization amount, can't have more than 2 decimal places",
            "format": "double"
          },
          "currency": {
            "$ref": "#/components/schemas/PayEx.AR.BnplPaymentOrder.Api.Business.Entities.Currency"
          },
          "sellerAuthorizationId": {
            "maxLength": 50,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9#_:@.\\-åäöÅÄÖ]{1,}$",
            "type": "string",
            "description": "The seller's unique identifier of the authorize/payment order"
          },
          "customer": {
            "$ref": "#/components/schemas/V1.BnplPaymentOrders.Customer"
          },
          "pointOfSale": {
            "maxLength": 50,
            "minLength": 0,
            "pattern": "^[\\u0020-\\u003A \\u003C-\\u007E \\u00A0-\\u00FF \\u2019]*$",
            "type": "string",
            "description": "Trade name of the point of sale. Will be displayed to end customer."
          },
          "mcc": {
            "type": "string",
            "description": "Merchant Category Code",
            "nullable": true
          },
          "restrictToProfiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1.BnplPaymentOrders.Profile"
            },
            "description": "Filter configured profiles on exposed payment options. Leave as Null to show all configured payment options",
            "nullable": true
          },
          "instore": {
            "type": "boolean",
            "description": "This request is an Instore bnpl order",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "V1.BnplPaymentOrders.Captures.CaptureRequest": {
        "required": [
          "amount",
          "currency",
          "orderLines",
          "receiptReference",
          "sellerTransactionId"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "maximum": 100000000,
            "minimum": 0.01,
            "type": "number",
            "description": "The total amount",
            "format": "double"
          },
          "currency": {
            "$ref": "#/components/schemas/PayEx.AR.BnplPaymentOrder.Api.Business.Entities.Currency"
          },
          "orderLines": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1.BnplPaymentOrders.Captures.OrderLine"
            },
            "description": "Specify Item/s for the captures, sum of all OrderLines must be equals with Amount in the capture"
          },
          "sellerTransactionId": {
            "maxLength": 50,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9#_:@.\\-åäöÅÄÖ]{1,}$",
            "type": "string",
            "description": "The seller's unique identifier of the capture"
          },
          "receiptReference": {
            "maxLength": 30,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9#_:@.\\-]{1,}$",
            "type": "string",
            "description": "A receipt reference meaningful for the consumer"
          }
        },
        "additionalProperties": false
      },
      "V1.BnplPaymentOrders.Captures.CaptureResource": {
        "required": [
          "amount",
          "captureId",
          "currency",
          "orderLines",
          "receiptReference",
          "sellerTransactionId"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "maximum": 100000000,
            "minimum": 0.01,
            "type": "number",
            "description": "The total amount",
            "format": "double"
          },
          "currency": {
            "$ref": "#/components/schemas/PayEx.AR.BnplPaymentOrder.Api.Business.Entities.Currency"
          },
          "orderLines": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1.BnplPaymentOrders.Captures.OrderLine"
            },
            "description": "Specify Item/s for the captures, sum of all OrderLines must be equals with Amount in the capture"
          },
          "sellerTransactionId": {
            "maxLength": 50,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9#_:@.\\-åäöÅÄÖ]{1,}$",
            "type": "string",
            "description": "The seller's unique identifier of the capture"
          },
          "receiptReference": {
            "maxLength": 30,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9#_:@.\\-]{1,}$",
            "type": "string",
            "description": "A receipt reference meaningful for the consumer"
          },
          "captureId": {
            "maxLength": 50,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9\\-]{1,}$",
            "type": "integer",
            "description": "Identifier of the capture",
            "format": "int64"
          },
          "@id": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "V1.BnplPaymentOrders.Captures.OrderLine": {
        "required": [
          "amount",
          "itemDescription"
        ],
        "type": "object",
        "properties": {
          "itemDescription": {
            "minLength": 1,
            "pattern": "^[\\u0020-\\u003A \\u003C-\\u007E \\u00A0-\\u00FF \\u2019]*$",
            "type": "string",
            "description": "Name or description of an individual item in the capture"
          },
          "amount": {
            "maximum": 100000000,
            "minimum": 0.01,
            "type": "number",
            "description": "Price of an individual item in the capture",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "V1.BnplPaymentOrders.Customer": {
        "required": [
          "nationalConsumerIdentifier"
        ],
        "type": "object",
        "properties": {
          "nationalConsumerIdentifier": {
            "$ref": "#/components/schemas/PayEx.AR.BnplPaymentOrder.Api.Business.Entities.NationalConsumerIdentifier"
          },
          "email": {
            "maxLength": 254,
            "minLength": 5,
            "pattern": "^[^;\\xA0\\xD0\\─@<>\\p{Cc}]+@(?!\\.)(?!.*\\.\\.)(?:[^;\\xA0\\xD0\\─@<>\\p{Cc}]+\\.[^;\\xA0\\xD0\\─@<>\\p{Cc}]+|\\[[A-Fa-f\\d\\:]+\\])(?<!\\.)$",
            "type": "string",
            "description": "Email to the customer"
          },
          "msisdn": {
            "maxLength": 15,
            "minLength": 5,
            "pattern": "^[+]{1}\\d{4,14}$",
            "type": "string",
            "description": "Phone number to the customer",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "V1.BnplPaymentOrders.Operations.Redirect.RedirectOptions": {
        "required": [
          "languageCode"
        ],
        "type": "object",
        "properties": {
          "languageCode": {
            "$ref": "#/components/schemas/PayEx.AR.BnplPaymentOrder.Api.Business.Entities.LanguageCode"
          }
        },
        "additionalProperties": false
      },
      "V1.BnplPaymentOrders.Operations.Redirect.RedirectRequest": {
        "required": [
          "redirectOptions",
          "returnUrl"
        ],
        "type": "object",
        "properties": {
          "returnUrl": {
            "minLength": 1,
            "type": "string",
            "description": "Url to return the end user to after process is completed or cancelled"
          },
          "redirectOptions": {
            "$ref": "#/components/schemas/V1.BnplPaymentOrders.Operations.Redirect.RedirectOptions"
          }
        },
        "additionalProperties": false
      },
      "V1.BnplPaymentOrders.Operations.Redirect.RedirectResponse": {
        "type": "object",
        "properties": {
          "redirectUrl": {
            "type": "string",
            "description": "Url to redirect the end user to",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "V1.BnplPaymentOrders.Profile": {
        "required": [
          "profileName"
        ],
        "type": "object",
        "properties": {
          "profileName": {
            "minLength": 1,
            "type": "string",
            "description": "Profile identifier"
          },
          "subProfiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1.BnplPaymentOrders.SubProfile"
            },
            "description": "Specify possible list of sub profiles, leave as null to display all configured sub profiles",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "V1.BnplPaymentOrders.Reversals.ReversalRequest": {
        "required": [
          "amount",
          "currency",
          "receiptReference",
          "sellerTransactionId"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "maximum": 100000000,
            "minimum": 0.01,
            "type": "number",
            "description": "The total amount to reverse",
            "format": "double"
          },
          "currency": {
            "$ref": "#/components/schemas/PayEx.AR.BnplPaymentOrder.Api.Business.Entities.Currency"
          },
          "sellerTransactionId": {
            "maxLength": 50,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9#_:@.\\-åäöÅÄÖ]{1,}$",
            "type": "string",
            "description": "The sellers unique identifier of the reversal"
          },
          "receiptReference": {
            "maxLength": 30,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9#_:@.\\-]{1,}$",
            "type": "string",
            "description": "A receipt reference meaningful for the consumer"
          }
        },
        "additionalProperties": false
      },
      "V1.BnplPaymentOrders.Reversals.ReversalResource": {
        "required": [
          "amount",
          "currency",
          "receiptReference",
          "reversalId",
          "sellerTransactionId"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "maximum": 100000000,
            "minimum": 0.01,
            "type": "number",
            "description": "The total amount to reverse",
            "format": "double"
          },
          "currency": {
            "$ref": "#/components/schemas/PayEx.AR.BnplPaymentOrder.Api.Business.Entities.Currency"
          },
          "sellerTransactionId": {
            "maxLength": 50,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9#_:@.\\-åäöÅÄÖ]{1,}$",
            "type": "string",
            "description": "The sellers unique identifier of the reversal"
          },
          "receiptReference": {
            "maxLength": 30,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9#_:@.\\-]{1,}$",
            "type": "string",
            "description": "A receipt reference meaningful for the consumer"
          },
          "reversalId": {
            "minLength": 1,
            "type": "string",
            "description": "Identifier of the reversal"
          },
          "@id": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "V1.BnplPaymentOrders.SubProfile": {
        "required": [
          "subProfileName"
        ],
        "type": "object",
        "properties": {
          "subProfileName": {
            "minLength": 1,
            "type": "string",
            "description": "Sub profile identifier"
          }
        },
        "additionalProperties": false
      }
    }
  }
}