PayPal UpdateAuthorization
Overview
UpdateAuthorization is a PayPal API that can be used to update the Shipping Address of an existing authorization.
URI Summary
Action | URI Template | URI Example | Non-URI Request | Response |
---|---|---|---|---|
POST | /vM.m/stores/[StoreId]/ payments/paypal/ updateAuth.[format] |
/v1.0/stores/AStoreId/ payments/paypal/updateAuth.xml |
XML | 200 + XML Response. |
Request Elements
Element | Required | Description | Type | Restriction |
---|---|---|---|---|
StoreId | Yes | Store identifier used in the URL. | String | 20 Characters |
OrderId | Yes | Order identifier. | String | 20 Characters |
ShipToName | Yes | The name of the person shipped to, for example, "John Smith." | String | 128 Characters |
ShippingAddress | No | Address the order will be shipped to. | Complex Type | Includes: Line1, Line2, Line3, Line4, City, MainDivision, CountryCode, PostalCode |
Line1 | Yes | Line 1 of the address. | String | Between 1 and 70 Characters. |
Line2 | No | Line 2 of the address. | String | Between 1 and 70 Characters. |
Line3 | No | Line 3 of the address. | String | Between 1 and 70 Characters. |
Line4 | No | Line 4 of the address. | String | Between 1 and 70 Characters. |
City | Yes | City the order will be shipped to. | String | Between 1 and 40 Characters. |
MainDivision | No | The state or province name for the shipping address. | String | Between 1 and 35 Characters. Use of the ISO 3166-2 code is recommended but not required. |
CountryCode | Yes | Country the order will be shipped to. | String | 2 Characters. Two digit ISO 3166 alpha 2 code country code. See: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2. |
PostalCode | No | Postal code the order will be shipped to. | String | Between 1 and 15 Characters. |
requestId | Yes | RequestId is used to uniquely identify a request, including as part of idempotent duplicate request processing. The value must be unique. It is recommended to use a variant 4 UUID for the request ID. The same request ID should only be reused if a read timeout occurs when attempting to receive a response from the payment service, or the payment service responds with a fault response. In all other cases a new request ID must be sent for retried requests, including responses such as Fail, Timeout or PaymentProcessorTimeout. | String | 40 Characters |
Request Example
The request is a PayPalUpdateAuthorizationRequest message.
Copy this code sample.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PayPalUpdateAuthorizationRequest
xmlns="http://api.gsicommerce.com/schema/checkout/1.0" requestId="123456">
<OrderId>12345</OrderId>
<ShipToName>John Doe</ShipToName>
<ShippingAddress>
<Line1>630 Allendale Road</Line1>
<City>King of Prussia</City>
<MainDivision>PA</MainDivision>
<CountryCode>US</CountryCode>
<PostalCode>19406</PostalCode>
</ShippingAddress>
</PayPalUpdateAuthorizationRequest>
Response Elements
Element | Required | Description | Type | Restriction |
---|---|---|---|---|
OrderId | Yes | Order identifier. | String | 20 Characters |
ResponseCode | Yes | Response code returned from Payment Service | String | 3 possible codes: Success, Failure, Timeout. |
ErrorMessage | No | Full error description. | String | Present only when the ResponseCode is Failure. |
ShortErrorMessage | No | Short error description. | String | Present only when the ResponseCode is Failure. |
ErrorCode | No | Error code coming from PayPal. | String | Present only when the ResponseCode is Failure. |
Successful Response Example
The response is a PayPalUpdateAuthorizationReply message.
Copy this code sample.
<?xml version="1.0" encoding="UTF-8"?>
<PayPalUpdateAuthorizationReply xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
<OrderId>12345</OrderId>
<ResponseCode>Success</ResponseCode>
</PayPalUpdateAuthorizationReply>
Failure Response Example
The response is a PayPalUpdateAuthorizationReply message.
Copy this code sample.
<?xml version="1.0" encoding="UTF-8"?>
<PayPalUpdateAuthorizationReply xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
<OrderId>12345</OrderId>
<ResponseCode>Failure</ResponseCode>
<ErrorMessage>Cannot find Order.</ErrorMessage>
<ShortErrorMessage>Cannot find Order.</ShortErrorMessage>
<ErrorCode>1234</ErrorCode>
</PayPalUpdateAuthorizationReply>
Timeout Response Example
The response is a XmlFaultReply message.
Copy this code sample.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XmlFaultReply xmlns="http://schema.gsicommerce.com/payments/services/1.0/"
xmlns:payment="http://schema.gsicommerce.com/payments/types/1.0/">
<payment:CreateTimestamp>2012-01-26T17:09:07.046Z</payment:CreateTimestamp>
<payment:Code>SystemProcessingError</payment:Code>
<payment:Description>A system error has occurred.</payment:Description>
</XmlFaultReply>