Skip to main content

PayPal Community

  • Dashboard
  • Send and Request
  • Wallet
  • Business
  • Help
Log in
  • Welcome
    • Guidelines
    • News and Events
    • Suggestions for PayPal
    • General Discussions
  • PayPal Help Community
    • Managing Account
    • Transactions
    • Wallet
    • Security and Fraud
    • Products & Services
    • Reporting
  • MTS Community
    • PayPal Upgrade Community
    • PayPal Payments Standard
    • REST APIs
    • NVP/SOAP APIs
    • SDKs
    • Sandbox Environment
    • PayPal Reporting
    • Payflow
    • Ideas for MTS
    • Client-side Integration
    • Server-side Integration
  • The Archives
    • PayPal Help Community Archives
      • Managing Account Archives
      • Transactions Archives
      • Wallet Archives
      • Security and Fraud Archives
      • Products & Services Archives
      • Reporting Archives
    • Help Community
      • PayPal Basics Archives
      • Payments Archives
      • My Money Archives
      • My Account Archives
      • Disputes and Limitations Archives
      • Products and Services Archives
      • PayPal Credit Archives
    • Merchant Community
      • Merchant Products
      • Business Tools Archives
      • Reporting Archives
      • Managing Risk and Fraud Archives
    • Help Archives
      • About Business (Archive)
      • About Payments (Archive)
      • About Settings (Archive)
      • About eBay (Archive)
      • About Protections (Archive)
      • About Products (Archive)
    • Social and Your Voice Archives
      • Off Topic (Archive)
      • My Feedback for PayPal (Archive)
    • About PayPal Archives
      • Watercooler (Archive)
      • Tax Information (Archive)
      • Fees (Archive)
      • eBay and PayPal (Archive)
      • Coupons and promotions (Archive)
    • My Account Archives
      • My account settings (Archive)
      • Account limits and verification (Archive)
      • Account balance (Archive)
      • Bank accounts and credit cards (Archive)
    • Payments Archives
      • Sending money (Archive)
      • Receiving money (Archive)
      • Refunds (Archive)
      • Donations and Fundraising (Archive)
    • Disputes and Security Archives
      • Disputes and claims (Archive)
      • Fraud, phishing and spoof (Archive)
    • My Business Archives
      • Merchant services (Archive)
      • Reporting and tracking (Archive)
      • Shipping (Archive)
    • PayPal Products Archives
      • PayPal Debit Mastercard (Archive)
      • PayPal Extras MasterCard (Archive)
      • PayPal Mobile & Other Services (Archive)
      • Student Accounts (Archive)
      • Bill Me Later (Archive)
    • Getting to know PayPal
      • My PayPal account
      • Security and protection
    • Receiving and sending money
      • Buying with PayPal
      • Selling with PayPal
    • PayPal Here UK
      • PayPal Here News and Events
      • PayPal Here Community
      • Chip and Pin Card Reader
      • PayPal Here App

The Community Forum is not available for new posts or responses; previous posts remain available to review. For comprehensive support options, please visit PayPal.com/HelpCenter
Merchant Technical Support: For technical support and related questions, please visit our Technical Support Help Center or Developer Central

If you want to report illegal content under the EU Digital Services Act, please do so here

since ‎Jul-16-2021
synagen
synagen Contributor
Contributor
4
Posts
1
Kudos
0
Solutions
Liked
Your PayPal Anniversary
Ice Breaker
The Return
New Look
Active
View all
Latest Contributions by synagen
  • Topics synagen has Participated In
  • Latest Contributions by synagen

Re: Learn what's new with PayPal Subscriptions

by synagen Contributor in REST APIs
‎Jul-22-2021 06:07 PM
1 Kudo
‎Jul-22-2021 06:07 PM
1 Kudo
Hi. What sort of functionality do you need? The answer will depend on the level of flexibility you need. Creating subscriptions in Paypal is quite simple, but if you need your system to programmatically alter them, that's a major challenge. On our website, https://calltaker.co, we have implemented 4 different subscription plans, where the customer chooses the plan they want, and then the customer's subscription gets created by the system automatically, with the actual monthly fee dependent on the number of registered users they have (i.e., "per seat" billing). The only action the customer needs to do is to log into Paypal and authorise the subscription. ... View more

Re: Learn what's new with PayPal Subscriptions

by synagen Contributor in REST APIs
‎Jul-19-2021 07:37 PM
‎Jul-19-2021 07:37 PM
Has anyone been able to get quantity updating on quantity-based subscriptions working with PHP? I've spent months trying to get it working. I've tried the raw CURL code, as per the developer docs and returned "PAYMENT_IN_PROGRESS" error. When using the PHP libraries, I get a 204 (no content) response and the subscription is not changed. CURL code: curl -v -X POST https://api-m.paypal.com/v1/billing/subscriptions/I-4PAEKHKDNA81/revise -H "Content-Type: application/json" -H "Authorization: Basic base64_encode($paypal_client_id.':'.$paypal_secret)" -d '{"quantity":"5"}'  (the base64 stuff is just showing how I used PHP to create a base64 version of client_id:client_secret for inserting into the CURL command)   PHP code:  <?php namespace PayPal\Api; require '/opt/bitnami/php/bin/vendor/autoload.php'; use PayPalCheckoutSdk\Orders\OrdersPatchRequest; use PayPalCheckoutSdk\Orders\OrdersGetRequest; use PayPalCheckoutSdk\Orders\OrdersCreateRequest; use PayPalCheckoutSdk\Core\PayPalHttpClient; use PayPalCheckoutSdk\Core\ProductionEnvironment; include('globals.php'); // defines Paypal client_id, client_secret, etc. $subscrID ='I-YT07M8NCEMRN'; // hard coded for test ini_set('error_reporting', E_ALL); // or error_reporting(E_ALL); ini_set('display_errors', '1'); ini_set('display_startup_errors', '1'); $environment=new ProductionEnvironment($paypal_client_id, $paypal_secret); $client = new PayPalHttpClient($environment); $request = new OrdersCreateRequest(); $request->prefer("return=representation"); $request->body =[ "intent" => "CAPTURE", "purchase_units" => [[ "reference_id" => $subscrID, "amount" => [ "value" => "1.77", "currency_code" => "USD" ] ]], "redirect_urls" => [ "cancel_url" => "https://calltaker.co/cancel", "return_url" => "https://calltaker.co/return" ] ]; $createdOrder = $client->execute($request); $request2 = new OrdersPatchRequest($createdOrder->result->id); $request2->body = [ 0=>[ "op" => "add", "path" => "/purchase_units/@reference_id=='$subscrID'/description", "value" => "3 user license" ], 1=>[ "op" => "replace", "path" => "/purchase_units/@reference_id=='$subscrID'/amount", "resource"=>[ "quantity"=>"3" ], "value" => [ "currency_code" => "USD", "value" => "1.56", "quantity" => "3" ] ] ]; try { // Call API with your client and get a response for your call $response2 = $client->execute($request2); // If call returns body in response, you can get the deserialized version from the result attribute of the response print_r($response2); }catch (HttpException $ex) { echo $ex->statusCode; print_r($ex->getMessage()); } $space4='&nbsp; &nbsp; &nbsp; &nbsp; '; foreach($response2 as $key=>$value) { print "$key = "; if (is_array($value)) { print "(array):<BR>"; foreach($value as $key2=>$value2) { print $space4.$key2."="; if (is_array($value2)) { print "(array):<BR>"; foreach($value2 as $key3=>$value3) print $space4.$space4."$key3=$value3<BR>"; } else print "$value2<BR>"; } } else print "$value<BR>"; } ?> ... View more

Re: Subscription - revise quantity

by synagen Contributor in REST APIs
‎Jul-19-2021 07:25 PM
‎Jul-19-2021 07:25 PM
Anyone have a resolution? It's now July 2021, 2 years since this thread was opened, and I'm getting the same error. At the moment I cant use Paypal for my business because modifying the quantity of a quantity-based subscription when the customer changes their quantity, doesnt work in Live. Never been able to get it working in Test because the subscription details pages of the sandbox have never worked, so I am testing in live. If I cant resolve this then I'll have to look for an alternative method of billing subscription customers. I have used raw CURL commands, as per the developer docs, and have also used the php Paypal libraries (code below). The PHP code returns nothing, just a 204 status (no content)   namespace PayPal\Api; require '/opt/bitnami/php/bin/vendor/autoload.php'; use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\WebhookList; use PayPal\Rest\ApiContext; use PayPal\Validation\UrlValidator; use PayPalCheckoutSdk\Core\PayPalHttpClient; use PayPalCheckoutSdk\Core\PayPalEnvironment; use PayPalCheckoutSdk\Core\ProductionEnvironment; ... View more

Unable to vary qty of a subscription with REST API

by synagen Contributor in Merchant Products and Services Archives
‎Jul-16-2021 09:04 PM
‎Jul-16-2021 09:04 PM
I have a monthly subscription plan set up in my merchant account that is quantity based (per registered user of the web site). A customer subscribes to the web site and selects a plan for monthly billing. The number of registered users of the client can vary, and so I need the web site to automatically vary the quantity of the customer's subscription whenever the number of users of that subscription changes. I have created a test REST API interface that attempts to change the quantity of the individual subscription, knowing the customer's subscription ID. The code runs without error and returns Status 204, but the customer's subscription on my Paypal does not change the qty, description or total monthly charge. <?php namespace PayPal\Api; require '/opt/bitnami/php/bin/vendor/autoload.php'; use PayPalCheckoutSdk\Orders\OrdersPatchRequest; use PayPalCheckoutSdk\Orders\OrdersGetRequest; use PayPalCheckoutSdk\Orders\OrdersCreateRequest; use PayPalCheckoutSdk\Core\PayPalHttpClient; use PayPalCheckoutSdk\Core\ProductionEnvironment; include('globals.php'); // defines the following fields: /* GLOBAL $paypal_URL; GLOBAL $paypal_account; GLOBAL $paypal_client_id; GLOBAL $paypal_secret; GLOBAL $APIusername; GLOBAL $APIpassword; GLOBAL $APIURL; GLOBAL $paypal_merchantID; GLOBAL $paypal; GLOBAL $PaypalAccountID; */ $merchant_id=$paypal_merchantID; $subscrID ='I-YT07M8NCEMRN'; // hard-coded subscription ID for testing ini_set('error_reporting', E_ALL); // or error_reporting(E_ALL); ini_set('display_errors', '1'); ini_set('display_startup_errors', '1'); $environment=new ProductionEnvironment($paypal_client_id, $paypal_secret); $client = new PayPalHttpClient($environment); $request = new OrdersCreateRequest(); $request->prefer("return=representation"); // hard coded change Qty to 3 $request->body =[ "intent" => "CAPTURE", "purchase_units" => [[ "reference_id" => $subscrID, "amount" => [ "value" => "1.23", "currency_code" => "USD" ] ]], "redirect_urls" => [ "cancel_url" => "https://calltaker.co/cancel", "return_url" => "https://calltaker.co/return" ] ]; $createdOrder = $client->execute($request); $request2 = new OrdersPatchRequest($createdOrder->result->id); $request2->body = [ [ "op" => "add", "path" => "/purchase_units/@reference_id=='$subscrID'/description", "value" => "3 user license" ], [ "op" => "replace", "path" => "/purchase_units/@reference_id=='$subscrID'/amount", "resource"=>[ "quantity"=>"3" ], "value" => [ "currency_code" => "USD", "value" => "1.56", "quantity" => "3" ] ] ]; $response2 = $client->execute($request2); ?> ... View more
Labels:
  • Labels:
  • Recurring Payments
  • Working Capital
Paypal Logo
  • Help
  • Contact Us
  • Security
  • Fees
  • © 1999-2025 PayPal, Inc. All rights reserved.
  • Privacy
  • Legal
  • Cookies
  • Policy Updates

The money in your balance is eligible for pass-through FDIC insurance.

The PayPal Cash Mastercard is issued by The Bancorp Bank pursuant to a license by Mastercard International Incorporated. The Bancorp Bank; Member FDIC.

Powered by Khoros
Welcome to the PayPal Community!