# B2B Virtual Account Payment Method
Flexible and secure payment method for B2B market segments using virtual accounts.

## Version: 1

### Servers

| URL | Description |
| --- | ----------- |
| https://sandbox.api.visa.com | Sandbox server |

---
## Account Management service
The Account Management web services are used to manage payment controls for existing card accounts and to request virtual accounts while setting controls. The endpoints allow the user to retrieve the status of new account requests, view authorization rules, submit virtual card requisitions for an employee , and retrieve security code (CVV2) details of an existing account.

### [POST] /vpa/v1/accountManagement/fundingAccount/update
**Update Funding Account**

#### Request Body

| Required | Schema |
| -------- | ------ |
|  Yes | **application/json**: { **"action"**: string, **"buyerId"**: string, **"clientId"**: string, **"messageId"**: string, **"creditLimit"**: integer, **"accountNumber"**: integer, **"blockPurchases"**: boolean, **"defaultAccount"**: boolean, **"expirationDate"**: string }<br> |

#### Responses

| Code | Description | Schema |
| ---- | ----------- | ------ |
| 201 | Created | **application/json**: { **"UpdateFundingAccountResponse"**: { **"errors"**: [ { **"Error"**: { **"code"**: string, **"statusDesc"**: string } } ], **"messageId"**: string, **"statusCode"**: string, **"statusDesc"**: string, **"accountNumber"**: integer, **"blockPurchases"**: boolean, **"expirationDate"**: string } }<br> |

---
### Schemas

#### AccountResult Schema

Per-account result indicating the outcome of the requested action on a single virtual account.

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| errorCode | string | Per-account error code when this account could not be actioned. Only present on per-account failure. | No |
| updatedAt | string | Timestamp of the last status update on this account. Only present when the account was successfully processed. | No |
| lockStatus | string, <br>**Available values:** "L", "U" | Current lock status of the account after the operation. "L" = Locked; "U" = Unlocked. Only present when the account was successfully processed.<br>*Enum:* `"L"`, `"U"` | No |
| updateReason | string | The reason recorded for the last Lock or Unlock action. Only present when a reason was provided and the account was successfully processed. | No |
| accountNumber | string | The virtual account number that was processed. | No |
| errorDescription | string | Human-readable description of the per-account error. Only present on per-account failure. | No |

#### AccountStatusResponse Schema

Top-level response for the Account Status Management API.

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| messageId | string | Echo of the messageId sent in the request. | No |
| responses | [ { **"responseCode"**: string, **"responseDescription"**: string } ] | Collection of overall status codes and descriptions for the request. Contains a single entry indicating overall success, partial success, or failure. | No |
| accountResults | [ { **"errorCode"**: string, **"updatedAt"**: string, **"lockStatus"**: string, <br>**Available values:** "L", "U", **"updateReason"**: string, **"accountNumber"**: string, **"errorDescription"**: string } ] | Per-account processing results. Only present when one or more accounts were successfully actioned or encountered a per-account error. Omitted when the response array alone describes the failure (e.g. schema validation failure). | No |

#### BatchRequisitionsResponse Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| nextPage | integer | Next page number (null if no more pages)<br>*Example:* `2` | No |
| messageId | string | Message identifier echoed from the request<br>*Example:* `"MSG-2024-001"` | No |
| responses | [ { **"responseCode"**: string, **"responseDescription"**: string } ] | Array of response codes and descriptions | No |
| totalPages | integer | Total number of pages available for pagination<br>*Example:* `5` | No |
| currentPage | integer | Current page number<br>*Example:* `1` | No |
| accountNumbers | [ { **"accountNumber"**: string, **"expirationDate"**: string } ] | Array of account numbers with expiration dates | No |
| bulkReferenceID | string | Bulk reference ID for tracking the batch<br>*Example:* `"BRK-20241124-001"` | No |
| totalAccountsCount | integer | Total number of accounts requested in the bulk requisition<br>*Example:* `100` | No |
| totalAccountsCreated | integer | Total number of accounts successfully created<br>*Example:* `98` | No |

#### GetBulkRequisitionResponse Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| batchRequisitionsResponse | { **"nextPage"**: integer, **"messageId"**: string, **"responses"**: [ { **"responseCode"**: string, **"responseDescription"**: string } ], **"totalPages"**: integer, **"currentPage"**: integer, **"accountNumbers"**: [ { **"accountNumber"**: string, **"expirationDate"**: string } ], **"bulkReferenceID"**: string, **"totalAccountsCount"**: integer, **"totalAccountsCreated"**: integer } |  | No |

#### BatchRequisitionRequest Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| action | string, <br>**Available values:** "A" | Action type - 'A' for Add/Create bulk requisition<br>*Enum:* `"A"`<br>*Example:* `"A"` | Yes |
| buyerID | string | Unique identifier for the buyer<br>*Example:* `"67890"` | Yes |
| clientID | string | Unique identifier for the client<br>*Example:* `"12345"` | Yes |
| messageID | string | Unique message identifier for tracking<br>*Example:* `"MSG-2024-001"` | Yes |
| proxyPoolID | string | Proxy pool identifier (optional)<br>*Example:* `"POOL-001"` | No |
| optionalInfo | [ { **"optionalFieldName"**: string, **"optionalFieldValue"**: string } ] | Array of optional field name-value pairs | No |
| numberOfCards | string | Number of virtual accounts to create<br>*Example:* `"100"` | Yes |
| requisitionDetails | { **"rules"**: [ { **"ruleCode"**: string, **"overrides"**: [ { **"sequence"**: string, **"overrideCode"**: string, **"overrideValue"**: string } ] } ], **"endDate"**: string, **"timeZone"**: string, **"startDate"**: string, **"mcgRuleAction"**: string } |  | No |

#### Rules Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| ruleCode | string | Code identifying the rule type<br>*Example:* `"MERCHANT_CATEGORY"` | No |
| overrides | [ { **"sequence"**: string, **"overrideCode"**: string, **"overrideValue"**: string } ] | Array of override values for this rule | No |

#### OptionalInfo Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| optionalFieldName | string | Name of the optional field<br>*Example:* `"invoiceNumber"` | No |
| optionalFieldValue | string | Value of the optional field<br>*Example:* `"INV-2024-001"` | No |

#### AccountNumber Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| accountNumber | string | The generated virtual account number<br>*Example:* `"4111111111111111"` | No |
| expirationDate | string | Expiration date of the virtual account in MMYY format<br>*Example:* `"1225"` | No |

#### Response Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| responseCode | string | Response code indicating the result of the operation<br>*Example:* `"BGST0000"` | No |
| responseDescription | string | Human-readable description of the response<br>*Example:* `"Success"` | No |

#### GetBulkRequisitionRequest Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| action | string, <br>**Available values:** "G" | Action type - 'G' for Get/Read bulk requisition status<br>*Enum:* `"G"`<br>*Example:* `"G"` | Yes |
| buyerId | string | Unique identifier for the buyer<br>*Example:* `"67890"` | Yes |
| clientId | string | Unique identifier for the client<br>*Example:* `"12345"` | Yes |
| messageId | string | Unique message identifier for tracking<br>*Example:* `"MSG-2024-001"` | Yes |
| pageNumber | integer | Page number for pagination of results (required, minimum value is 1)<br>*Example:* `1` | Yes |
| bulkReferenceID | integer | Bulk reference ID returned from the original bulk requisition request<br>*Example:* `3811` | Yes |

#### BatchRequisitionResponse Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| messageID | string | Message identifier echoed from the request<br>*Example:* `"MSG-2024-001"` | No |
| responses | [ { **"responseCode"**: string, **"responseDescription"**: string } ] | Array of response codes and descriptions | No |
| bulkReferenceId | string | Bulk reference ID for tracking this batch requisition<br>*Example:* `"BRK-20241124-001"` | No |

#### Response-1 Schema

Overall request-level status code and description.

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| responseCode | string | Result code for the request. "00" = Request Processed Successfully; "01" = Request processed partially (some accounts succeeded, some failed); "02" = Request could not be processed successfully. For request-level failures (schema/business validation, malformed request, unsupported method or media type, or an internal system error), a specific numeric error code is returned instead (e.g. "400" for a malformed/unsupported request, "7014" for a system exception, or a validation error code such as "7300", "120354"). | No |
| responseDescription | string | Human-readable description corresponding to the responseCode. | No |

#### Overrides Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| sequence | string | Sequence number for the override<br>*Example:* `"0"` | No |
| overrideCode | string | Code for the override type<br>*Example:* `"MCC"` | No |
| overrideValue | string | Value for the override<br>*Example:* `"5411"` | No |

#### RequisitionDetails Schema

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| rules | [ { **"ruleCode"**: string, **"overrides"**: [ { **"sequence"**: string, **"overrideCode"**: string, **"overrideValue"**: string } ] } ] | Array of rules to apply to virtual accounts | No |
| endDate | string | End date for virtual account validity. Supported formats: YYYY-MM-DD or MM/DD/YYYY<br>*Example:* `"2024-12-31"` | No |
| timeZone | string | Time zone as UTC offset (e.g., UTC+05:30, UTC-08:00)<br>*Example:* `"UTC+05:30"` | No |
| startDate | string | Start date for virtual account validity. Supported formats: YYYY-MM-DD or MM/DD/YYYY<br>*Example:* `"2024-12-01"` | No |
| mcgRuleAction | string | MCG rule action<br>*Example:* `"ALLOW"` | No |
