v1

latestOpenAPI 3.0.32026-07-131990818.5 KB
LISA Accounts

Close an existing LISA account

Close an account and report the reason and date.

Test data

<table style="font-family:Roboto, sans-serif; font-size:14px;"> <col width="25%"> <col width="35%"> <col width="40%"> <thead> <tr> <th>Scenario</th> <th>Request Payload</th> <th>Response</th> </tr> </thead> <tbody> <tr> <td><p>Request with a valid payload, LISA Manager reference number and account ID</p><p class="code--block">lisaManagerReferenceNumber: <a href="/api-documentation/docs/api/service/lisa-api/2.0#testing">Use your test user profile</a><br>accountId: 1234567890</p></td> <td> <pre class="code--block"> { "accountClosureReason": "All funds withdrawn", "closureDate": "2017-05-20" } </pre> </td> <td><p>HTTP status: <code class="code--slim">200 (OK)</code></p> <pre class="code--block"> { "status": 200, "success": true, "data": { "message": "LISA account closed", "accountId": "1234567890" } } </pre> </td> </tr> <tr> <td><p>Request with a valid payload, LISA Manager reference number and account ID</p><p class="code--block">lisaManagerReferenceNumber: <a href="/api-documentation/docs/api/service/lisa-api/2.0#testing">Use your test user profile</a><br>accountId: 1234567890</p></td> <td> <pre class="code--block"> { "accountClosureReason": "Cancellation", "closureDate": "2017-05-20" } </pre> </td> <td><p>HTTP status: <code class="code--slim">200 (OK)</code></p> <pre class="code--block"> { "status": 200, "success": true, "data": { "message": "LISA account closed", "accountId": "1234567890" } } </pre> </td> </tr> <tr> <td><p>Request with a valid payload and account ID, but an invalid LISA Manager reference number</p><p class="code--block">lisaManagerReferenceNumber: A12345<br>accountId: 1234567890</p></td> <td> <pre class="code--block"> { "accountClosureReason": "All funds withdrawn", "closureDate": "2017-05-20" } </pre> </td> <td><p>HTTP status: <code class="code--slim">400 (Bad Request)</code></p> <pre class="code--block"> { "code": "BAD_REQUEST", "message": "Enter lisaManagerReferenceNumber in the correct format, like Z1234" } </pre> </td> </tr> <tr> <td> <p>Request with a valid payload and LISA Manager reference number, but an invalid account ID</p> <p class="code--block"> lisaManagerReferenceNumber: <a href="/api-documentation/docs/api/service/lisa-api/2.0#testing">Use your test user profile</a> <br>accountId: 1234%3D5678 </p> </td> <td> <pre class="code--block"> { "accountClosureReason": "All funds withdrawn", "closureDate": "2017-05-20" } </pre> </td> <td><p>HTTP status: <code class="code--slim">400 (Bad Request)</code></p> <pre class="code--block"> { "code": "BAD_REQUEST", "message": "Enter accountId in the correct format, like ABC12345" } </pre> </td> </tr> <tr> <td><p>Request containing invalid and/or missing data</p><p class="code--block">lisaManagerReferenceNumber: <a href="/api-documentation/docs/api/service/lisa-api/2.0#testing">Use your test user profile</a><br>accountId: 1234567890</p></td> <td> <pre class="code--block"> { "closureDate": "3000" } </pre> </td> <td><p>HTTP status: <code class="code--slim">400 (Bad Request)</code></p> <pre class="code--block"> { "code": "BAD_REQUEST", "message": "Bad Request", "errors": [ { "code": "INVALID_DATE", "message": "Date is invalid", "path": "/closureDate" }, { "code": "MISSING_FIELD", "message": "This field is required", "path": "/accountClosureReason" } ] } </pre> </td> </tr> <tr> <td><p>Request containing a closure date before 6 April 2017</p><p class="code--block">lisaManagerReferenceNumber: <a href="/api-documentation/docs/api/service/lisa-api/2.0#testing">Use your test user profile</a><br>accountId: 1234567890</p></td> <td> <pre class="code--block"> { "accountClosureReason": "All funds withdrawn", "closureDate": "2017-04-05" } </pre> </td> <td><p>HTTP status: <code class="code--slim">403 (Forbidden)</code></p> <pre class="code--block"> { "code": "FORBIDDEN", "message": "There is a problem with the request data", "errors": [ { "code": "INVALID_DATE", "message": "The closureDate cannot be before 6 April 2017", "path": "/closureDate" } ] } </pre> </td> </tr> <tr> <td><p>Request for an account that has already been voided</p><p class="code--block">lisaManagerReferenceNumber: <a href="/api-documentation/docs/api/service/lisa-api/2.0#testing">Use your test user profile</a><br>accountId: A1234560</p></td> <td> <pre class="code--block"> { "accountClosureReason": "All funds withdrawn", "closureDate": "2017-05-20" } </pre> </td> <td><p>HTTP status: <code class="code--slim">403 (Forbidden)</code></p> <pre class="code--block"> { "code": "INVESTOR_ACCOUNT_ALREADY_VOID", "message": "The LISA account is already void" } </pre> </td> </tr> <tr> <td><p>Request for an account that has already been closed</p><p class="code--block">lisaManagerReferenceNumber: <a href="/api-documentation/docs/api/service/lisa-api/2.0#testing">Use your test user profile</a><br>accountId: A1234561</p></td> <td> <pre class="code--block"> { "accountClosureReason": "All funds withdrawn", "closureDate": "2017-05-20" } </pre> </td> <td><p>HTTP status: <code class="code--slim">403 (Forbidden)</code></p> <pre class="code--block"> { "code": "INVESTOR_ACCOUNT_ALREADY_CLOSED", "message": "The LISA account is already closed" } </pre> </td> </tr> <tr> <td><p>Request to close an account with cancellation as the reason when the cancellation period is over</p><p class="code--block">lisaManagerReferenceNumber: <a href="/api-documentation/docs/api/service/lisa-api/2.0#testing">Use your test user profile</a><br>accountId: A1234568</p></td> <td> <pre class="code--block"> { "accountClosureReason": "Cancellation", "closureDate": "2017-05-20" } </pre> </td> <td><p>HTTP status: <code class="code--slim">403 (Forbidden)</code></p> <pre class="code--block"> { "code": "CANCELLATION_PERIOD_EXCEEDED", "message": "You cannot close the account with cancellation as the reason because the cancellation period is over" } </pre> </td> </tr> </tr> <tr> <td><p>Request to close an account with all funds withdrawn as the reason and it is still within the cancellation period</p><p class="code--block">lisaManagerReferenceNumber: <a href="/api-documentation/docs/api/service/lisa-api/2.0#testing">Use your test user profile</a><br>accountId: A1234569</p></td> <td> <pre class="code--block"> { "accountClosureReason": "All funds withdrawn", "closureDate": "2017-05-20" } </pre> </td> <td><p>HTTP status: <code class="code--slim">403 (Forbidden)</code></p> <pre class="code--block"> { "code": "ACCOUNT_WITHIN_CANCELLATION_PERIOD", "message": "You cannot close the account with all funds withdrawn as the reason because it is within the cancellation period" } </pre> </td> </tr> <tr> <td><p>Request containing an account ID that does not exist</p><p class="code--block">lisaManagerReferenceNumber: <a href="/api-documentation/docs/api/service/lisa-api/2.0#testing">Use your test user profile</a><br>accountId: A1234562</p></td> <td> <pre class="code--block"> { "accountClosureReason": "All funds withdrawn", "closureDate": "2017-05-20" } </pre> </td> <td><p>HTTP status: <code class="code--slim">404 (Not Found)</code></p> <pre class="code--block"> { "code": "INVESTOR_ACCOUNTID_NOT_FOUND", "message": "Enter a real accountId" } </pre> </td> </tr> <tr> <td><p>Request with an invalid 'Accept' header</p><p class="code--block">lisaManagerReferenceNumber: <a href="/api-documentation/docs/api/service/lisa-api/2.0#testing">Use your test user profile</a><br>accountId: 1234567890<br><br>Accept: application/vnd.hmrc.1.0</p></td> <td> <pre class="code--block"> { "accountClosureReason": "All funds withdrawn", "closureDate": "2017-05-20" } </pre> </td> <td><p>HTTP status: <code class="code--slim">404 (Not Found)</code></p> <pre class="code--block"> { "code": "MATCHING_RESOURCE_NOT_FOUND", "message": "A resource with the name in the request can not be found in the API" } </pre> </td> </tr> </tbody> </table>
post/lifetime-isa/manager/{lisaManagerReferenceNumber}/accounts/{accountId}/close-account

Path parameters

lisaManagerReferenceNumberstring required
Example:Z1234

The reference given to the LISA provider when they applied for approval from HMRC.

accountIdstring required
Example:ABC12345

The ID for the account. This will be generated by the LISA Manager and will only be unique when used in combination with lisaManagerReferenceNumber. Any special characters should be URL encoded.

Headers

Accept'application/vnd.hmrc.2.0+json' required

Specifies the response format and the version of the API to be used.

Content-Type'application/json' required

Specifies the format of the request body, which must be JSON.

Authorizationstring required
Example:Bearer bb7fed3fe10dd235a2ccda3d50fb

An OAuth 2.0 Bearer Token with appropriate scope.

Request body

accountClosureReason'All funds withdrawn' | 'Cancellation' required

The reason the account was closed.

closureDatestring required

The date the account was closed. This cannot be in the future.

Example request

{
  "closureDate": "2017-05-20"
}

Response

OK

statusnumber required

The HTTP status of the result of the API call. Always 200.

successboolean required

Whether the API call was successful or not. Always true.