Purpose
Use FedEx's legacy InvoiceServlet billing-adjustment flow to submit a request for a shipment identified by {tracking-number} and {invoice-number}. Select FedEx Express as the service type and the electronic-or-paper FedEx invoice payment method, submit the request, and return all text from the resulting Request Billing Adjustment section through the end of the response.
When to Use
- The caller wants to request or inspect a FedEx billing adjustment.
- The caller has both a FedEx tracking number and invoice number.
- The required payment method is that the caller received a FedEx invoice, electronically or on paper.
- Do not use this skill for package-status lookup; use a tracking skill instead.
Workflow
- Use a residential US browser session when available, then navigate directly to:
https://www.fedex.com/servlet/InvoiceServlet?link=4&jsp_name=adjustment&orig_country={country-code}&language={language}For the normal US English flow, useorig_country=US&language=english. - On the initial form, select the radio inputs directly:
input[name="service_type"][value="E"]— FedEx Express.input[name="pay_type"][value="invoice"]— I received a FedEx invoice (electronic or paper).
- Click
input[name="NewReq"]to open the request form. - Fill the request form:
input[name="tracking_nbr"]={tracking-number}input[name="invoice_nbr"]={invoice-number}
- Submit using
input[type="SUBMIT"]. - Wait for the response page to render, solving the FedEx/Akamai challenge if it appears. Keep the same browser session and reload the original InvoiceServlet URL only if the challenge or an expired session returns the initial form instead of advancing.
- On the resulting page, run this self-contained evaluator to return the requested response without another navigation:
(()=>{
const body=document.body?.innerText||'';
const markers=['Request Billing Adjustment','Your request for money-back'];
let start=-1,marker='';
for(const m of markers){const i=body.indexOf(m);if(i>=0&&(start<0||i<start)){start=i;marker=m;}}
return {
success:start>=0,
marker,
sectionText:start>=0?body.slice(start).trim():'',
pageText:body.trim()
};
})()Batch steps 1–7 in one browser-agent call where possible. The evaluator reads only the current page and returns both the text beginning at the billing-adjustment marker and the complete visible page text for troubleshooting.
Site-Specific Gotchas
- This is a legacy form at
/servlet/InvoiceServlet; do not replace it with the modern FedEx account or tracking pages. - The initial form requires the exact radio values
service_type=Eandpay_type=invoice; selecting the labels by visible text is less reliable than using these selectors. - Click
input[name="NewReq"]before attempting to filltracking_nbrandinvoice_nbr; those fields are on the next form state. - The observed submit selector is case-sensitive in practice: use
input[type="SUBMIT"]rather than assuming lowercasesubmit. - FedEx may present an Akamai challenge after submission. Solve it in the existing session, wait for navigation/rendering, and do not discard the session cookies.
- If submission unexpectedly returns the initial form, wait briefly and retry the direct initial URL in the same session, then repeat the required selections and submission.
- The resulting response can be a legacy HTML page with weak structure. Extract from the first occurrence of
Request Billing Adjustment, falling back toYour request for money-back, and preserve all text through the end rather than extracting only a presumed paragraph. - Treat tracking and invoice numbers as caller-provided values; never infer or fabricate them.
Expected Output
Return the complete visible response beginning at the billing-adjustment section, for example:
{
"success": true,
"marker": "Request Billing Adjustment",
"sectionText": "Request Billing Adjustment\\n...all response text through the end...",
"pageText": "...complete visible page text..."
}If neither marker is present, return success: false with the available pageText so the caller can distinguish an error, challenge, expired session, or unexpected page layout.