# PAN Block
source: https://developer.mastercard.com/user-account-management-service/documentation/use-cases/pan-block/index.md

This use case blocks a primary account number (PAN) from being automatically enrolled in a specific program within a specified time frame. It also provides the capability of unblocking PAN enrollment. BAN, which stands for bank account number, is interchangeable with PAN, which stands for primary account number. Both are used interchangeably. This use case uses payload encryption.
Tip: The PAN block function restricts enrollment of an existing account but does not alter the account status or stop the processing of its data. To effectively pause or delete an account, use the PAN block function along with the [PUT /accounts](https://developer.mastercard.com/user-account-management-service/documentation/api-reference/index.md) endpoint to update the account status to a non-active state (that is, something other than Good Standing, Redeem-Only, or New), depending on the intended action.

### Pre-requisites {#pre-requisites}

Following are the pre-requisites for the customer to use this endpoint:

Refer to payload encryption in [Use Cases](https://developer.mastercard.com/user-account-management-service/documentation/use-cases/index.md)

## Sequence Diagram {#sequence-diagram}

Diagram pan-block

##### Following are the execution steps: {#following-are-the-execution-steps}

1. The cardholder signs into the customer application.
2. The customer authenticates the cardholder.
3. The customer sends an encrypted request to the User Account Management to block/unblock the PAN enrollment.
   * The request for pan-block requires the following mandatory input parameters:
     * accountId - The unique identifier for the given account.
     * accountIdType - Identifier type for the given account.
     * programs - Program identifier for the program in which the cardholder is enrolled.
4. The Mastercard API Gateway validates the customer's information and routes the request to the User Account Management in the case of a valid customer.
5. The User Account Management Service validates the encrypted request received through the `/accounts/pan-blocks` endpoint.
6. The User Account Management Service blocks or unblocks the PAN enrollment.
7. The User Account Management Service sends a response with successfully blocked PAN auto enrollment (201) when the request is sent and successfully unblocked PAN auto enrollment (200) when the same request is sent again.
8. The User Account Management Service sends a response with a status code of 4xx/5xx in case of an invalid request.

You will receive an error response for an invalid request or any missing request parameter. In that case, you need to update the input and perform step 3 again.

### Endpoint {#endpoint}


API Reference: `POST /accounts/pan-blocks`

Note: For more information about the error codes, refer to the [Code and Formats](https://developer.mastercard.com/user-account-management-service/documentation/code-and-formats/index.md) section.
