Skip to main content

Revise API

POST/rest/revise

Revise API is used to update an existing PayPal subscription (for example, change plan or quantity). Pass the transaction_id of the original subscription setup transaction.

warning

Revising a subscription may require the customer to approve the change again. When approval is required, the response includes client_action: "redirect" and an action_data.url pointing to PayPal.

info

This endpoint is for PayPal Subscriptions only. It is not used for one-time PayPal payments or authorization updates.

Revise API Request

transaction_idStringrequired
Transaction ID of the original subscription setup transaction
paypal_plan_idStringrequired
PayPal Plan ID to apply to the subscription
paypal_subscription_quantityInteger
Subscription quantity. Only when the plan supports quantities
effective_timeString
When changes take effect. Defaults to current time. Format: RFC 3339, e.g. 2021-09-29T11:47:25Z
shipping_costsFloat
Shipping costs if the order includes shipping
shipping_addressString
Street address (when updating shipping)
shipping_address2String
Second address line
shipping_companyString
Company name for shipping address
shipping_cityString
City of the shipping address
shipping_postal_codeString
Postal code of the shipping address
shipping_stateString
State or region of the shipping address
shipping_countryString
Country code (ISO 3166-1 alpha-2) of the shipping address
shipping_first_nameString
Customer first name for shipping
shipping_last_nameString
Customer last name for shipping
Example Request
POST /rest/revise
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"transaction_id": "c2a6bf6d-2dd7-4a9c-b4de-2d04347d802b",
"paypal_plan_id": "P-6UK2193323222643NMFJN66Q",
"paypal_subscription_quantity": 6,
"effective_time": "2021-11-30T20:47:25Z"
}

Revise API Response

transaction_idString
ID of the subscription setup transaction
order_idString
Order ID of the transaction
error_codeInteger
Error code for the response (0 for success)
status_codeInteger
Status code of the transaction
statusString
Status of the transaction
client_actionString
When redirect, redirect the customer to action_data.url for approval
action_data.urlString
PayPal URL for customer approval of subscription changes
paypal_subscription_idString
PayPal Subscription ID
paypal_plan_idString
PayPal Plan ID after revision
Example Response
{
"transaction_id": "dbd3ab13-38f3-49da-9e12-47ef445b0b72",
"order_id": "123000",
"error_code": 0,
"status_code": 9,
"status": "registered",
"client_action": "redirect",
"action_data": {
"url": "https://www.sandbox.paypal.com/webapps/billing/subscriptions?ba_token=BA-0M029980WL960863C"
},
"paypal_subscription_id": "I-B3452HHDSD",
"paypal_plan_id": "P-6UK2193323222643NMFJN66Q"
}