{
  "openapi": "3.0.1",
  "info": {
    "title": "Account Transfers",
    "description": "Transfer funds between your currency accounts.\n\n__Authentication header__\n  ```\n    Authorization: {your_credentials}\n  ```\nReplace `{your_credentials}` with your base64-encoded Basic Auth username and password given to you by your Implementation Manager.\n<br /> <br />\nYou **must** use the `Authorization` header for any request you send to our Account APIs.\n\n__Accept header__\n  ```\n    Accept: application/vnd.worldpay.accounts.transfer-v1+json\n  ```\nWe use the Accept header to identify which version of our API you are using. You must use the Accept header for any request you send to our Account APIs.\n<br /><br />\n\n__DNS whitelisting__  \nWhitelist the following URLs:\n* `https://try.access.worldpay.com/`\n* `https://access.worldpay.com/`\n\nPlease ensure you use DNS whitelisting, not explicit IP whitelisting.",
    "version": "v1",
    "x-metadata": {
      "category": [
        "Accounts"
      ],
      "business": [
        "Enterprise"
      ],
      "generated": false
    }
  },
  "servers": [
    {
      "url": "https://try.access.worldpay.com",
      "description": "Test (Try)"
    },
    {
      "url": "https://access.worldpay.com",
      "description": "Live"
    }
  ],
  "paths": {
    "/accounts/transfer": {
      "post": {
        "summary": "Transfer funds",
        "description": "Transfer funds between your accounts.",
        "operationId": "transferApi",
        "parameters": [
          {
            "name": "WP-CorrelationId",
            "in": "header",
            "schema": {
              "type": "string",
              "description": "Optional ID to trace requests, if not provided, it is generated."
            },
            "example": "15cd16b2-7b82-41cb-9b11-21be9dacad88"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferRequest"
              },
              "examples": {
                "/accouts/transfer": {
                  "description": "Transfer money between accounts.",
                  "value": {
                    "$ref": "./code/request.json"
                  }
                }
              }
            },
            "application/vnd.worldpay.accounts.transfer-v1+json": {
              "schema": {
                "$ref": "#/components/schemas/TransferRequest"
              },
              "examples": {
                "/accouts/transfer": {
                  "description": "Transfer money between accounts.",
                  "value": {
                    "$ref": "./code/request.json"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferResponse"
                }
              },
              "application/vnd.worldpay.accounts.transfer-v1+json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtendedAccessErrorResponse"
                },
                "examples": {
                  "Bad request": {
                    "$ref": "#/components/examples/400"
                  }
                }
              },
              "application/vnd.worldpay.accounts.transfer-v1+json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtendedAccessErrorResponse"
                },
                "examples": {
                  "Bad request": {
                    "$ref": "#/components/examples/400"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseAccessErrorResponse"
                },
                "examples": {
                  "Unauthorized": {
                    "$ref": "#/components/examples/401"
                  }
                }
              },
              "application/vnd.worldpay.accounts.transfer-v1+json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseAccessErrorResponse"
                },
                "examples": {
                  "Unauthorized": {
                    "$ref": "#/components/examples/401"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseAccessErrorResponse"
                },
                "examples": {
                  "Forbidden": {
                    "$ref": "#/components/examples/403"
                  }
                }
              },
              "application/vnd.worldpay.accounts.transfer-v1+json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseAccessErrorResponse"
                },
                "examples": {
                  "Forbidden": {
                    "$ref": "#/components/examples/403"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseAccessErrorResponse"
                },
                "examples": {
                  "Not Found": {
                    "$ref": "#/components/examples/404"
                  }
                }
              },
              "application/vnd.worldpay.accounts.transfer-v1+json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseAccessErrorResponse"
                },
                "examples": {
                  "Not Found": {
                    "$ref": "#/components/examples/404"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseAccessErrorResponse"
                },
                "examples": {
                  "Server Error": {
                    "$ref": "#/components/examples/500"
                  }
                }
              },
              "application/vnd.worldpay.accounts.transfer-v1+json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseAccessErrorResponse"
                },
                "examples": {
                  "Server Error": {
                    "$ref": "#/components/examples/500"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BaseAccessErrorResponse": {
        "type": "object",
        "properties": {
          "errorName": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ExtendedAccessErrorResponse": {
        "type": "object",
        "properties": {
          "errorName": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "validationErrors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationErrors"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TransferRequest": {
        "type": "object",
        "properties": {
          "sourceAccountNumber": {
            "type": "string",
            "nullable": false,
            "description": "The 16-digit transfer source account number."
          },
          "targetAccountNumber": {
            "type": "string",
            "nullable": false,
            "description": "A 16-digit transfer destination account number."
          },
          "amount": {
            "type": "number",
            "format": "double",
            "description": "A decimal value for the transfer. Currency is defined by the source account currency."
          },
          "narrative": {
            "type": "string",
            "nullable": false,
            "description": "A description about the transfer."
          },
          "quoteId": {
            "type": "string",
            "nullable": false,
            "description": "The ID of the quote of an exchange rate for the transfer. Not currently used - can set as empty guid value (all zeros)."
          }
        },
        "additionalProperties": false
      },
      "TransferResponse": {
        "type": "object",
        "additionalProperties": false
      },
      "ValidationErrors": {
        "type": "object",
        "properties": {
          "errorName": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "jsonPath": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    },
    "examples": {
      "400": {
        "value": {
          "errorName": "bodyDoesNotMatchSchema",
          "message": "The json body provided does not match the expected schema",
          "validationErrors": [
            {
              "errorName": "fieldHasInvalidValue",
              "message": "Source account number must be 16 characters",
              "jsonPath": "$.SourceAccountNumber"
            }
          ]
        }
      },
      "401": {
        "value": {
          "errorName": "Unauthorized",
          "message": "Unauthorized request"
        }
      },
      "403": {
        "value": {
          "errorName": "Forbidden",
          "message": "Authorisation Failed for this Domain"
        }
      },
      "404": {
        "value": {
          "errorName": "Not Found",
          "message": "Could not find details for accountNumber {accountNumber}"
        }
      },
      "500": {
        "value": {
          "httpStatusCode": "internalErrorOccurred",
          "message": "Something went wrong"
        }
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ]
}