{
  "info": {
    "title": "FlexPay Purchase documentation",
    "version": "4"
  },
  "openapi": "3.1.0",
  "paths": {
    "/status-page-request/status/order": {
      "get": {
        "operationId": "status-page-request",
        "parameters": [
          {
            "description": "`4`",
            "in": "query",
            "name": "version",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "numerical ID of the website in the Verotel system",
            "in": "query",
            "name": "shopID",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Merchant’s reference identifier if provided (referenceID OR saleID must be posted - NOT BOTH)",
            "in": "query",
            "name": "referenceID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Verotel saleID identifier (referenceID OR saleID must be posted - NOT BOTH)",
            "in": "query",
            "name": "saleID",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Signature calculation",
            "in": "query",
            "name": "signature",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/x-www-form-urlencoded": {
                "schema": {
                  "properties": {
                    "country": {
                      "description": "selected or detected country ISO code (ISO 3166-1-alpha-2 code)",
                      "type": "string"
                    },
                    "createdOn": {
                      "description": "Timestamp of purchase creation",
                      "type": "string"
                    },
                    "description": {
                      "description": "Product description text - max 100 printable characters",
                      "type": "string"
                    },
                    "email": {
                      "description": "email address of the buyer",
                      "type": "string"
                    },
                    "error": {
                      "description": "message (for response=`ERROR`)",
                      "type": "string"
                    },
                    "name": {
                      "description": "name of the buyer",
                      "type": "string"
                    },
                    "paymentMethod": {
                      "description": "an identifier of payment method that was used for the transaction.",
                      "type": "string"
                    },
                    "priceAmount": {
                      "description": "amount processed. in nnn.nn formatt",
                      "type": "string"
                    },
                    "priceCurrency": {
                      "description": "3 char ISO code of the Sale currency",
                      "type": "string"
                    },
                    "referenceID": {
                      "description": "Merchant reference identifier - max 100 printable characters",
                      "type": "string"
                    },
                    "response": {
                      "description": "`FOUND` - purchase record found and returned\n`NOTFOUND` - purchase not found\n`ERROR` - error (see ‘error’ key)",
                      "type": "string"
                    },
                    "saleID": {
                      "description": "identifier of the transaction in Verotel System",
                      "type": "string"
                    },
                    "saleResult": {
                      "description": "purchase processing result (APPROVED)",
                      "type": "string"
                    },
                    "shopID": {
                      "description": "ID of website in Verotel system",
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "x-order": [
                    "response",
                    "error",
                    "saleID",
                    "shopID",
                    "paymentMethod",
                    "priceAmount",
                    "priceCurrency",
                    "description",
                    "referenceID",
                    "name",
                    "email",
                    "country",
                    "createdOn",
                    "saleResult"
                  ]
                }
              }
            },
            "description": "response: `FOUND` - purchase record found and returned\n`NOTFOUND` - purchase not found\n`ERROR` - error (see ‘error’ key)\nerror: message (for response=`ERROR`)\nsaleID: identifier of the transaction in Verotel System\nshopID: ID of website in Verotel system\npaymentMethod: an identifier of payment method that was used for the transaction.\npriceAmount: amount processed. in nnn.nn formatt\npriceCurrency: 3 char ISO code of the Sale currency\ndescription: Product description text - max 100 printable characters\nreferenceID: Merchant reference identifier - max 100 printable characters\nname: name of the buyer\nemail: email address of the buyer\ncountry: selected or detected country ISO code (ISO 3166-1-alpha-2 code)\ncreatedOn: Timestamp of purchase creation\nsaleResult: purchase processing result (APPROVED)"
          }
        },
        "servers": [
          {
            "url": "https://secure.yoursafedirect.com"
          }
        ],
        "summary": "Status page request",
        "x-upstream-path": "/status/order"
      }
    },
    "/status/order": {
      "get": {
        "operationId": "yoursafedirect-purchase",
        "parameters": [
          {
            "description": "version of the FlexPay call, `4` for this version",
            "in": "query",
            "name": "version",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "numerical ID of the website in the Verotel system",
            "in": "query",
            "name": "shopID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "`purchase` must be set",
            "in": "query",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "amount to be processed in nnn.nn format",
            "in": "query",
            "name": "priceAmount",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "3-char ISO code, must be one of the Sale currencies (`USD` `EUR` `GBP` `AUD` `CAD` `CHF` `DKK` `NOK` `SEK`), depending on your account setup",
            "in": "query",
            "name": "priceCurrency",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "description of the product. Text is displayed on the iDEAL payment page - max 100 printable characters",
            "in": "query",
            "name": "description",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`IDEAL` must be set.",
            "in": "query",
            "name": "paymentMethod",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "merchant’s reference identifier. It must be unique if provided",
            "in": "query",
            "name": "referenceID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "pass-through variable - max 255 printable characters. Is returned in postbacks",
            "in": "query",
            "name": "custom1",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "pass-through variable - max 255 printable characters. Is returned in postbacks",
            "in": "query",
            "name": "custom2",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "pass-through variable - max 255 printable characters. Is returned in postbacks",
            "in": "query",
            "name": "custom3",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "URL for redirect after successful transaction - max 255 characters. Can be omitted if default success landing URL is set on the website.",
            "in": "query",
            "name": "successURL",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "URL for redirect after declined transaction - max 255 characters. Can be omitted if default decline landing URL is set on the website.",
            "in": "query",
            "name": "declineURL",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "4-digit Merchant category code according to ISO 18245. Mandatory for CPSP transactions",
            "in": "query",
            "name": "mcc",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1-35 char CPSP sub-merchant name. Mandatory for CPSP transactions",
            "in": "query",
            "name": "subCreditorName",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1-6 digit CPSP sub-merchant ID. Mandatory for CPSP transactions",
            "in": "query",
            "name": "subCreditorId",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "2-char CPSP sub-merchant country code according to ISO 3166. Mandatory for CPSP transactions",
            "in": "query",
            "name": "subCreditorCountry",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "email of the buyer. NOTE: email is excluded from signature calculations (max 100 chars else it will be ignored)",
            "in": "query",
            "name": "email",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Signature calculation",
            "in": "query",
            "name": "signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "servers": [
          {
            "url": "https://secure.yoursafedirect.com"
          }
        ],
        "summary": "YoursafeDirect purchase"
      }
    }
  },
  "webhooks": {
    "success-postback": {
      "get": {
        "operationId": "success-postback",
        "parameters": [
          {
            "description": "numerical ID of the website in the Verotel system",
            "in": "query",
            "name": "shopID",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "`purchase`",
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "merchant reference identifier. It must be unique if provided",
            "in": "query",
            "name": "referenceID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "identifier of the sale in the Verotel system",
            "in": "query",
            "name": "saleID",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "identifier of the transaction in the Verotel system",
            "in": "query",
            "name": "transactionID",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "amount to be processed in nnn.nn format",
            "in": "query",
            "name": "priceAmount",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "3 char ISO code of the Sale currency",
            "in": "query",
            "name": "priceCurrency",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "pass-through variable - max 255 printable characters",
            "in": "query",
            "name": "custom1",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "pass-through variable - max 255 printable characters",
            "in": "query",
            "name": "custom2",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "pass-through variable - max 255 printable characters",
            "in": "query",
            "name": "custom3",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "payment method, `IDEAL`",
            "in": "query",
            "name": "paymentMethod",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Signature calculation",
            "in": "query",
            "name": "signature",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "summary": "Success postback"
      }
    }
  }
}
