{
  "openapi": "3.0.1",
  "info": {
    "title": "Account Transfers",
    "description": "Transfer funds from source account to target account. \r\n  \r\n    __Authentication header__\r\n\r\n      ```\r\n        Authorization: {your_credentials}\r\n      ```\r\n      Replace `{your_credentials}` with your base64-encoded Basic Auth username and password given to you by your Worldpay Implementation Manager.\r\n      <br /> <br />\r\n      You **must** use the `Authorization` header for any request you send to our Account Transfers API.\r\n      <br /><br />\r\n      __WP-Api-Version header__\r\n      ```\r\n        WP-Api-Version: 2025-01-01\r\n      ```\r\n\r\n    We use the WP-Api-Version header to identify which version of our API you are using. You must use the WP-Api-Version header for any request you send.\r\n    <br /><br />\r\n    __DNS whitelisting__\r\n\r\n    Whitelist the following URLs:\r\n    * `https://try.access.worldpay.com/`\r\n    * `https://access.worldpay.com/`\r\n\r\n    Please ensure you use DNS whitelisting, not explicit IP whitelisting. When you make a request within Access Worldpay, you should always cache the response returned.",
    "version": "2025-01-01",
    "x-metadata": {
      "business": [
        "Enterprise",
        "Marketplaces"
      ],
      "catalog-list": true,
      "category": [
        "Accounts"
      ],
      "generated": true
    }
  },
  "servers": [
    {
      "url": "https://try.access.worldpay.com",
      "description": "Test (Try)"
    },
    {
      "url": "https://access.worldpay.com",
      "description": "Live"
    }
  ],
  "paths": {
    "/accounts/transfer": {
      "post": {
        "summary": "Transfer funds between your accounts",
        "description": "Transfer funds between your accounts.",
        "operationId": "ReceiveTransferRequest",
        "parameters": [
          {
            "name": "WP-Api-Version",
            "in": "header",
            "description": "Represents the version of the API.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2025-01-01"
          },
          {
            "name": "WP-CorrelationId",
            "in": "header",
            "description": "Optional ID to trace requests, if not provided, it is generated.",
            "schema": {
              "type": "string"
            },
            "example": "15cd16b2-7b82-41cb-9b11-21be9dacad88"
          },
          {
            "name": "WP-CallerId",
            "in": "header",
            "description": "An ID used for logging purposes.",
            "schema": {
              "type": "string",
              "default": "swagger"
            }
          },
          {
            "name": "Accept",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "example": "application/json"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtendedAccessErrorResponse"
                },
                "examples": {
                  "InvalidUser": {
                    "summary": "This example shows an invalid format error.",
                    "value": {
                      "errorName": "BodyIsEmpty",
                      "message": "The json body provided does not match the expected schema.",
                      "validationErrors": [
                        {
                          "errorName": "fieldHasInvalidValue",
                          "message": "Target AccountNumber is mandatory",
                          "jsonPath": "$.targetAccountNumber"
                        }
                      ]
                    }
                  },
                  "FieldHasInvalidValue": {
                    "summary": "FieldHasInvalidValue",
                    "value": {
                      "errorName": "BodyIsEmpty",
                      "message": "The json body provided does not match the expected schema.",
                      "validationErrors": [
                        {
                          "errorName": "numberIsTooLarge",
                          "message": "Amount should have a maximum of 7 digits before the decimal place",
                          "jsonPath": "$.amount"
                        }
                      ]
                    }
                  },
                  "NotHaveMinimumLimit": {
                    "summary": "NotHaveMinimumLimit",
                    "value": {
                      "errorName": "BodyIsEmpty",
                      "message": "The json body provided does not match the expected schema.",
                      "validationErrors": [
                        {
                          "errorName": "stringIsTooShort",
                          "message": "Narrative must be at least 6 characters",
                          "jsonPath": "$.narrative"
                        }
                      ]
                    }
                  },
                  "ExceededMaxLimit": {
                    "summary": "ExceededMaxLimit",
                    "value": {
                      "errorName": "BodyIsEmpty",
                      "message": "The json body provided does not match the expected schema.",
                      "validationErrors": [
                        {
                          "errorName": "stringIsTooLong",
                          "message": "Narrative limit exceeded in the request. Narrative must be no more than 34 characters",
                          "jsonPath": "$.narrative"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseAccessErrorResponse"
                },
                "example": {
                  "errorName": "Access to the requested resource has been denied",
                  "message": "AccessDenied"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseAccessErrorResponse"
                },
                "example": {
                  "errorName": "AccessWorldpayId value not available in context",
                  "message": "Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseAccessErrorResponse"
                },
                "example": {
                  "errorName": "The requested page was not found. The page number requested is outside the value of the total number of pages.",
                  "message": "NotFound"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseAccessErrorResponse"
                },
                "example": {
                  "errorName": "An internal server error occurred",
                  "message": "InternalServerError"
                }
              }
            }
          }
        }
      }
    }
  },
  "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": {
        "required": [
          "amount",
          "narrative",
          "sourceAccountNumber",
          "targetAccountNumber"
        ],
        "type": "object",
        "properties": {
          "sourceAccountNumber": {
            "maxLength": 16,
            "minLength": 16,
            "type": "string",
            "description": "The source account number.",
            "example": "1111550000000001"
          },
          "targetAccountNumber": {
            "maxLength": 16,
            "minLength": 16,
            "type": "string",
            "description": "The target account number.",
            "example": "1111550000000002"
          },
          "amount": {
            "type": "number",
            "description": "The amount. A maximum of seven digits before the decimal place. A maximum of two decimal places.",
            "format": "double",
            "example": "77.22"
          },
          "narrative": {
            "maxLength": 34,
            "minLength": 6,
            "pattern": "^[a-zA-Z0-9\\s-]",
            "type": "string",
            "description": "You can use this to describe what the transfer is for.",
            "example": "A narrative"
          },
          "quoteId": {
            "type": "string",
            "description": "The `quoteId` returned by the [FX API](/products/fx/create-fxquote).",
            "nullable": true,
            "example": "QuoteId"
          }
        },
        "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"
      }
    }
  },
  "security": [
    {
      "BasicAuth": []
    }
  ]
}