# Update
source: https://developer.mastercard.com/iccp/documentation/05_api_reference/soap_api/purchaserequest/updatepurchaserequest/index.md

> Update the details of a purchase request, including the controls on the VCN. Include the unchanged data and controls sent in the initial submitPurchaseRequest call along with the details to update. This call does not generate a new VCN, but will update the controls on the existing VCN if appropriate.

## Request Headers {#request-headers}

|    Key name     |                   Value                    |                                                                                                            Description for ICCP                                                                                                            |
|-----------------|--------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Idempotency-Key | Any random UUID set in HTTP Request Header | 1. The header key Idempotency-Key is optional. 2. If the header key Idempotency-Key is added then it should be non-null and non-empty. 3. Max length of key is 80 chars. 4. It is recommended that the key is UUID and generated randomly. |

## Parameters {#parameters}

Same as the *submitPurchaseRequest* call [parameters](https://developer.mastercard.com/iccp/documentation/05_api_reference/soap_api/purchaserequest/submitpurchaserequest/index.md#parameters) plus the ID of the purchase request.
Note: `SupplierDetails` is not required for `UpdatePurchaseRequest` API calls for Mastercard® In Control for Mobile Payments (ICMP) enabled purchase requests made through the ICCP API. `SupplierDetails` is still required for ICCP-only purchase requests.

## Clearing Controls {#clearing-controls}

If Clearing Controls is enabled for a company and Real Card, the Payment Controls and their corresponding limits applied on a Virtual Card at the time of generation are also applied during the clearing process of transaction. For payment controls supported by Clearing Controls, the same control values set on Virtual Card are enforced during authorization and clearing. Other unsupported payment controls present in the Purchase Request continue to get applied during authorization only.  

If Clearing Controls was applied on the Purchase Request and later disabled for the company or Real Card, then Clearing Controls continues to be applied for the Purchase Request after updates and vice versa.

### Sample request without ICMP enabled {#sample-request-without-icmp-enabled}

```xml
<soapenv:Envelope xmlns:ser="http://mastercard.com/sd/pc2/service"
	xmlns:ser1="http://mastercard.com/sd/pc/service"
	xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
	<soapenv:Header/>
	<soapenv:Body wsu:Id="id-75"
		xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
		<ser:updatePurchaseRequestRequest>
			<ser:purchaseRequestId>1454</ser:purchaseRequestId>
			<ser:purchaseRequest>
				<ser:RCNData>
					<ser1:rcnId>2718</ser1:rcnId>
					<ser1:rcnAlias>Arun</ser1:rcnAlias>
				</ser:RCNData>
				<ser:companyId>233191</ser:companyId>
				<ser:description>Test2</ser:description>
				<ser:TemplateDetails2>
					<ser:templateId>1907</ser:templateId>
					<!--1 or more repetitions:-->
					<ser:fullTemplateRuleDetails>
						<ser:ruleName>1</ser:ruleName>
						<ser:ruleType>A</ser:ruleType>
						<!--1 or more repetitions:-->
						<ser:templateControl xsi:type="ser:VelocityControlType2"
							xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
							<ser:maxTrans>10</ser:maxTrans>
							<ser:cumulativeLimit>1000</ser:cumulativeLimit>
							<ser:period>M</ser:period>
						</ser:templateControl>
						<ser:templateControl xsi:type="ser:CreditBlockControl"
							xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
							<ser:refundMethod>B</ser:refundMethod>
						</ser:templateControl>
					</ser:fullTemplateRuleDetails>
					<ser:templateCustomField>
						<!--1 to 30 repetitions:-->
						<ser:templateCustomField>
							<ser1:customFieldName>Purchase Type</ser1:customFieldName>
							<ser1:customFieldValue>Contracted Services</ser1:customFieldValue>
						</ser:templateCustomField>
					</ser:templateCustomField>
				</ser:TemplateDetails2>
				<ser:supplierDetails>
					<ser:supplierId>850</ser:supplierId>
				</ser:supplierDetails>
			</ser:purchaseRequest>
		</ser:updatePurchaseRequestRequest>
	</soapenv:Body>
</soapenv:Envelope>
```

### Sample request with ICMP enabled {#sample-request-with-icmp-enabled}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
	<SOAP-ENV:Header />
	<SOAP-ENV:Body>
	 <updatePurchaseRequestRequest xmlns="http://mastercard.com/sd/pc2/service" xmlns:ns3="http://mastercard.com/sd/pc/service">
	  <purchaseRequestId>28739738</purchaseRequestId>
			<purchaseRequest>
			 <RCNData>
				<ns3:rcnId>262831</ns3:rcnId>
				<ns3:rcnAlias>test</ns3:rcnAlias>
			 </RCNData>
			 <dataSourceId>646</dataSourceId>
			 <companyId>266497</companyId>
			 <validFor>2</validFor>
			 <description>"Automation test"</description>
					 <TemplateDetails2>
						<templateId>20165522</templateId>
						<fullTemplateRuleDetails>
							<ruleName>a</ruleName>
							<ruleType>A</ruleType>
							<templateControl xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="merchantIdControl">
							 <negate>true</negate>
							</templateControl>
						<templateControl xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="VelocityControlType2">
							<maxTrans>4</maxTrans>
							<cumulativeLimit>80</cumulativeLimit>
							<period>C</period>
							<currencyType>M</currencyType>
							<currencyCode>826</currencyCode>
						</templateControl>
					</fullTemplateRuleDetails>
					<templateCustomField>
						<templateCustomField>
							<ns3:customFieldName>Purchase Type</ns3:customFieldName>
							<ns3:customFieldValue>1</ns3:customFieldValue>
						</templateCustomField>
					</templateCustomField>
				</TemplateDetails2>
				<supplierDetails>
					<supplierId>20679588</supplierId>
					<supplierEmails>icmpmidsupplier@fakemail.com</supplierEmails>
					<notifySupplier>false</notifySupplier>
				</supplierDetails>
				<userDetails>
					<firstName>NewIcmpMidFirstName</firstName>
					<lastName>NewIcmpMidLastName</lastName>
					<mobileCountryCode>+91</mobileCountryCode>
					<mobileNumber>88888888888</mobileNumber>
				</userDetails>
			  <vcnDelivery>APP</vcnDelivery>
		   </purchaseRequest>
		</updatePurchaseRequestRequest>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
```

Note:   

* End user email address can be updated only for ICMP purchase requests in DRAFT status. Email addresses cannot be updated for all other purchase request statuses.
* When updating a purchase request in draft status using API, the ICMP email address format is validated. A valid email address consists of a local part (for example, `username`), an `@` symbol, and a domain part (for example, `example.com`). A valid email would be, for example: `john.doe@example.com`.
* When updating an ICMP Purchase Request, the `userDetails` section must be included. If no changes are intended for the user details, each sub-field within the `userDetails` must exactly match the values provided in the original `SubmitPurchaseRequest`.
* `supplierEmail` information must be provided for ICCP Purchase Requests, if no default email is associated.

## Response {#response}

Same as [submitPurchaseRequestResponse](https://developer.mastercard.com/iccp/documentation/05_api_reference/soap_api/purchaserequest/submitpurchaserequest/index.md#response).

### Sample response without ICMP enabled {#sample-response-without-icmp-enabled}

```xml
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
	<S:Body>
		<ns2:getPurchaseRequestDetail xmlns="http://mastercard.com/sd/pc/service" xmlns:ns2="http://mastercard.com/sd/pc2/service">
			<ns2:purchaseRequestId>28986226</ns2:purchaseRequestId>
			<ns2:requestStatus>Approved</ns2:requestStatus>
			<ns2:PurchaseRequestTemplateDetails>
				<ns2:templateId>20165732</ns2:templateId>
				<ns2:fullTemplateRuleDetails>
					<ns2:ruleName>a</ns2:ruleName>
					<ns2:ruleType>A</ns2:ruleType>
					<ns2:templateControl xsi:type="ns2:templateValidityPeriodControl2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
						<ns2:from>2026-04-23</ns2:from>
						<ns2:to>2026-04-30</ns2:to>
						<ns2:timeZone>GMT</ns2:timeZone>
						<ns2:strictPreAuthCheck>false</ns2:strictPreAuthCheck>
						<ns2:negate>false</ns2:negate>
					</ns2:templateControl>
					<ns2:templateControl xsi:type="ns2:agingVelocityControl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
						<ns2:authorizationHoldDays>5</ns2:authorizationHoldDays>
						<ns2:cumulativeLimit>200.0</ns2:cumulativeLimit>
						<ns2:timeZone>GB-Eire</ns2:timeZone>
						<ns2:negate>false</ns2:negate>
						<ns2:availableBalance>200.0</ns2:availableBalance>
						<ns2:availableClearingBalance>200.0</ns2:availableClearingBalance>
						<ns2:currencyType>B</ns2:currencyType>
					</ns2:templateControl>
					<ns2:templateControl xsi:type="ns2:CreditBlockControl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
						<ns2:refundMethod>B</ns2:refundMethod>
					</ns2:templateControl>
				</ns2:fullTemplateRuleDetails>
				<ns2:templateCustomField>
					<ns2:templateCustomField>
						<customFieldName>Purchase Type</customFieldName>
						<customFieldValue>1</customFieldValue>
					</ns2:templateCustomField>
				</ns2:templateCustomField>
			</ns2:PurchaseRequestTemplateDetails>
			<ns2:vcnInformation>
				<ns2:Id>27623060</ns2:Id>
				<ns2:Pan>XXXXXXXXXXXX8886</ns2:Pan>
				<ns2:Expiry>2609</ns2:Expiry>
				<ns2:Avv>932</ns2:Avv>
				<ns2:Status>S</ns2:Status>
				<ns2:EVCNIndicator>false</ns2:EVCNIndicator>
			</ns2:vcnInformation>
			<ns2:addenda>
				<tripLeg/>
				<railDetail/>
				<travelAgency/>
			</ns2:addenda>
			<ns2:cardImage></ns2:cardImage>
			<ns2:supplierDetails>
				<ns2:supplierId>20679566</ns2:supplierId>
				<ns2:notifySupplier>false</ns2:notifySupplier>
			</ns2:supplierDetails>
			<ns2:ClearingControls>Y</ns2:ClearingControls>
		</ns2:getPurchaseRequestDetail>
	</S:Body>
</S:Envelope>
```

### Sample response with ICMP enabled {#sample-response-with-icmp-enabled}

```xml
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
	<S:Body>
		<ns2:getPurchaseRequestDetail xmlns="http://mastercard.com/sd/pc/service" xmlns:ns2="http://mastercard.com/sd/pc2/service">
			<ns2:purchaseRequestId>28739738</ns2:purchaseRequestId>
			<ns2:requestStatus>Approved</ns2:requestStatus>
			<ns2:PurchaseRequestTemplateDetails>
				<ns2:templateId>20165522</ns2:templateId>
				<ns2:fullTemplateRuleDetails>
					<ns2:ruleName>a</ns2:ruleName>
					<ns2:ruleType>A</ns2:ruleType>
					<ns2:templateControl xsi:type="ns2:VelocityControlType2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
						<ns2:maxTrans>4</ns2:maxTrans>
						<ns2:cumulativeLimit>80.0</ns2:cumulativeLimit>
						<ns2:period>C</ns2:period>
						<ns2:availableBalance>80.0</ns2:availableBalance>
						<ns2:currencyType>M</ns2:currencyType>
						<ns2:currencyCode>826</ns2:currencyCode>
					</ns2:templateControl>
					<ns2:templateControl xsi:type="ns2:merchantIdControl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
						<ns2:merchantIds>
							<ns2:merchantId>123456789123456</ns2:merchantId>
							<ns2:acquirerId>123456</ns2:acquirerId>
						</ns2:merchantIds>
					<ns2:negate>true</ns2:negate>
				</ns2:templateControl>
			</ns2:fullTemplateRuleDetails>
			<ns2:templateCustomField>
				<ns2:templateCustomField>
					<customFieldName>Purchase Type</customFieldName>
					<customFieldValue>1</customFieldValue>
				</ns2:templateCustomField>
			</ns2:templateCustomField>
		</ns2:PurchaseRequestTemplateDetails>
		<ns2:vcnInformation>
			<ns2:Id>27476418</ns2:Id>
			<ns2:digitizationGuid>c025d892-3496-4e58-9ce5-f942c384a06e</ns2:digitizationGuid>
			<ns2:Pan>5995020125226088</ns2:Pan>
			<ns2:Expiry>2606</ns2:Expiry>
			<ns2:Avv>762</ns2:Avv>
			<ns2:Status>S</ns2:Status>
			<ns2:EVCNIndicator>false</ns2:EVCNIndicator>
		</ns2:vcnInformation>
		<ns2:addenda>
			<tripLeg/>
			<railDetail/>
			<travelAgency/>
		</ns2:addenda>
		<ns2:cardImage></ns2:cardImage>
		<ns2:supplierDetails>
			<ns2:supplierId>20679588</ns2:supplierId>
		</ns2:supplierDetails>
		<ns2:userDetails>
			<ns2:firstName>NewIcmpMidFirstName</ns2:firstName>
			<ns2:lastName>NewIcmpMidLastName</ns2:lastName>
			<ns2:email>abcd@xyz.com</ns2:email>
			<ns2:mobileCountryCode>+91</ns2:mobileCountryCode>
			<ns2:mobileNumber>88888888888</ns2:mobileNumber>
		</ns2:userDetails>
		<ns2:vcnDelivery>APP</ns2:vcnDelivery>
		</ns2:getPurchaseRequestDetail>
	</S:Body>
</S:Envelope>
```

