Problem with adding metadata in PayPal Developer RestAPIs to Create a payment

BMs_Developer
New Community Member

We want to add metadata when creating a payment (https://developer.paypal.com/docs/api/payments/v1/) through Rest APIs. However, there is no object to add metadata like a JSON field. If we try to do it with a string, there is an option for custom metadata, but it only supports a limited number of characters (maximum characters: 127, it might be 256).

 

But we have mandatory data to add this:

metadatas = {
               'coupon': coupon_code,
                'user_id': UserID,
                'product_id': product.id,
                'package': package_name,
                'coupon_discount': discount,
                'currency_code': CurrencyCode,
                'exchange_rate': ExchangeRate,
                'currency_symbol': CurrencySymbol,
                'converted_price': final_price,
                'base_currency': base_currency_code,
                'base_currency_symbol': base_currency_symbol,
                'base_price': base_price,
                'requirements': Requirements[:400],
            }
Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.