my $http = HTTP::Tinyish->new(); my $res = $http->post("https://api.sandbox.paypal.com/v1/oauth2/token/", { headers => { 'username' => 'client_id', 'password' => 'screte', 'grant_type' => 'client_credentials'} }); $http->get("https://api.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI", { headers => { 'Content-Type' => 'application/json' }, }); if ( $res->{'is_success'} ) { print Dumper( decode_json $res->{'content'} ); } else { print "$res->{'status'} $res->{'reason'}\n"; }