Pharmacy Claims Reversal API: How B2 Transactions Work
Not every pharmacy claim sticks. Sometimes the wrong drug gets billed, the quantity is off, or the patient changes their mind entirely. When that happens, you need a B2 reversal, the NCPDP transaction that undoes a previously adjudicated claim. Getting reversals right is critical for accurate inventory, correct patient accumulators, and clean financial reconciliation.
What is a B2 reversal?
A B2 transaction is the NCPDP standard for reversing (voiding) a previously paid pharmacy claim. When a pharmacy submits a B2 to the PBM, it tells the payer: "That claim I submitted earlier? Undo it." The PBM then reverses the adjudication, removing the claim from the patient's history, restoring accumulators (deductible, out-of-pocket), and adjusting the pharmacy's reimbursement.
The B2 must reference the original B1 claim precisely. The PBM matches on key fields (prescription number, date of service, NDC, and quantity) to find and reverse the correct claim.
When reversals are needed
Reversals are a daily occurrence in pharmacy operations. Common scenarios:
Wrong drug billed
The technician billed the brand when the generic was dispensed, or scanned the wrong NDC. Reverse and resubmit with the correct product.
Wrong quantity or days supply
Billed for 90 days supply but the patient only needs 30. Reverse and resubmit with the correct quantity.
Patient didn't pick up
The prescription was filled and billed but the patient never came. Reverse the claim and return to stock.
Insurance changed
Patient has new coverage. Reverse the claim on the old plan and resubmit to the new one.
Price correction
The pharmacy needs to rebill at a different price, perhaps after a DAW code change or discount card application.
The reversal workflow
A typical reversal follows this sequence:
- 1.Identify the original paid claim (B1 response with "P" status)
- 2.Submit B2 reversal with matching claim fields (Rx number, date of service, NDC, quantity)
- 3.PBM matches and reverses the original claim
- 4.Patient accumulators are restored (deductible, out-of-pocket amounts credited back)
- 5.Pharmacy reimbursement is adjusted on the next remittance cycle
- 6.If needed, resubmit a corrected B1 claim with the right information
Submitting a reversal via API
With Starlight's B2 Reversal API, submitting a reversal is a single JSON request:
A B2 reversal uses the same structure as the original B1. Just change the transaction_type to "B2" and resubmit with the same claim details:
curl -X POST https://starlight.claims/api/v1/submit \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"transaction_type": "B2",
"patient": {
"first_name": "JOHN",
"last_name": "SMITH",
"date_of_birth": "19900301",
"gender": "M",
"zip_code": "54321"
},
"insurance": {
"bin_number": "999999",
"pcn": "TEST",
"group_id": "GRP999999",
"cardholder_id": "SAMPLE123456",
"person_code": "002",
"relationship_code": "02"
},
"prescription": {
"rx_number": "999000001234",
"fill_number": "1",
"product_id": "00000000000",
"quantity_dispensed": "28",
"days_supply": "28",
"date_written": "20260101",
"daw_code": "0",
"prescriber_id": "1234567890",
"prescriber_last_name": "SAMPLE",
"prescriber_phone": "5555555555"
},
"pricing": {
"ingredient_cost": "0.00",
"dispensing_fee": "0.00",
"usual_customary": "0.00",
"gross_amount_due": "184.80"
}
}'The key detail: the PBM matches the reversal to the original claim using the Rx number, patient info, and insurance fields. Everything must match the original B1 submission exactly. This is how the PBM knows which claim to reverse.
Edge cases and gotchas
Reversals seem simple but have real-world complications you need to handle:
- •Timing windows. Some PBMs reject reversals after 90 days. Others have shorter windows. Always reverse as soon as possible.
- •Partial reversals don't exist. NCPDP B2 is all-or-nothing. To change a quantity, reverse the full claim and resubmit with the correct amount.
- •Duplicate reversals. Submitting a B2 for an already-reversed claim will return an error. Track reversal status in your system to prevent duplicates.
- •Claim not found. If the B2 fields don't exactly match the original B1, the PBM can't find the claim. Common culprits: wrong date of service, mismatched NDC, or incorrect quantity.
- •Rebilling after reversal. If you reverse to resubmit, do both in sequence. A gap between reversal and resubmission can cause the patient's accumulators to be temporarily incorrect.
Handle reversals with confidence
Starlight's B2 Reversal API makes claim reversals as simple as the original submission. JSON in, JSON out. Full audit trail included.