Revise API
POST/rest/revise
/rest/reviseProduction URL
https://api.betterpayment.de/rest/reviseTest URL
https://testapi.betterpayment.de/rest/reviseRevise 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_idStringrequiredTransaction ID of the original subscription setup transaction
paypal_plan_idStringrequiredPayPal Plan ID to apply to the subscription
paypal_subscription_quantityIntegerSubscription quantity. Only when the plan supports quantities
effective_timeStringWhen changes take effect. Defaults to current time. Format: RFC 3339, e.g.
2021-09-29T11:47:25Zshipping_costsFloatShipping costs if the order includes shipping
shipping_addressStringStreet address (when updating shipping)
shipping_address2StringSecond address line
shipping_companyStringCompany name for shipping address
shipping_cityStringCity of the shipping address
shipping_postal_codeStringPostal code of the shipping address
shipping_stateStringState or region of the shipping address
shipping_countryStringCountry code (
ISO 3166-1 alpha-2) of the shipping addressshipping_first_nameStringCustomer first name for shipping
shipping_last_nameStringCustomer 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_idStringID of the subscription setup transaction
order_idStringOrder ID of the transaction
error_codeIntegerError code for the response (0 for success)
status_codeIntegerStatus code of the transaction
statusStringStatus of the transaction
client_actionStringWhen
redirect, redirect the customer to action_data.url for approvalaction_data.urlStringPayPal URL for customer approval of subscription changes
paypal_subscription_idStringPayPal Subscription ID
paypal_plan_idStringPayPal 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"
}