$ perl -Mstrict -MJSON -MData::Dumper -MHTTP::Tiny -E'my $resp = HTTP::Tiny->new->post("https://moneybird.com/api/v2/123/external_sales_invoices", { headers => {Accept => "application/json", "Content-Type" => "application/json", Authorization => "Bearer 123"}, content => to_json({ external_sales_invoices => { "reference" => "M-8426", "date" => "2020-03-14", "contact_id" => 456, "details_attributes" => [ { "description" => "coffee", "price" => 2.25, "tax_rate_id" => 891 } ] } })}); say Dumper $resp->{content}' #### $VAR1 = '{"error":"access token invalid","symbolic":{"request":"invalid_grant"}}';