Payerworks writes and explains files; it sends nothing to a payer. What that means
Write the review request as a 278 from JSON, send it the way the payer takes it, and give Payerworks the response that comes back to read. The authorization sandbox answers from the same payer as the eligibility sandbox. POST /v1/authorizations/required checks codes against Medicare’s published prior authorization lists.
Routes
- POST
/v1/authorizations/278Write a 278 - POST
/v1/authorizations/explainExplain a 278 response - POST
/v1/sandbox/authorizationsRun the prior authorization sandbox - POST
/v1/authorizations/requiredDoes Medicare require it
Each route shows its call with curl and with the two clients, then its real answer, shortened, and the fields it holds. The client calls assume one client made once, const pw = new Payerworks() in JavaScript or pw = payerworks.Payerworks() in Python, each reading PAYERWORKS_API_KEY and PAYERWORKS_BASE_URL, and body is the request.json shown.
Request
curl -sS -X POST "$PAYERWORKS_BASE_URL/v1/authorizations/278" \
-H "Authorization: Bearer $PAYERWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d @request.jsonWith the JavaScript client
const answer = await pw.postAuthorizations278(body);With the Python client
answer = pw.post_authorizations_278(body){
"sender_id": "SAMPLEBILLER",
"receiver_id": "99999",
"control_number": 31,
"request": {
"controlNumber": "AUTH-0001",
"tradingPartnerServiceId": "99999",
"requester": {
"organizationName": "Sample Family Medicine",
"npi": "1234567893"
},
"subscriber": {
"memberId": "W123456789",
"firstName": "SAMPLE",
"lastName": "PATIENT",
"dateOfBirth": "1980-02-14",
"gender": "F"
},
"review": {
"serviceTypeCode": "12",
"placeOfServiceCode": "12",
"diagnoses": [
"M17.11"
]
},
"services": [
{
"procedureCode": "L1833",
"units": 4,
"serviceDate": "2026-11-02"
}
]
}
}{
"version": "005010X217",
"usage": "T",
"x12": "ISA*00* *00* *ZZ*SAMPLEBILLER *ZZ*99999 *261019*1500*^*00501*000000031*0*T*:~GS*HI*SAMPLEBILLER*99999*20261019*1500*31*X*005010X217~ST*278*0001*005010X217~BHT*0007*13*AUTH-0001*20261019*1500~HL*1**20*1~NM1*X3*2*…",
"interchange_control_number": "000000031",
"group_control_number": "31",
"transaction_set_control_numbers": [
"0001"
],
"segments": 22,
"requests": [
{
"index": 0,
"trace": "AUTH-0001",
"transaction_set_control_number": "0001",
"warnings": []
}
],
"payer_choice": "Payerworks sends nothing. Whether a payer accepts an X12 278 or a FHIR prior authorization request at all is the payer's choice: many take them only on a portal, by fax or by phone, and its companion guide says what it requires.",
"transmitted": false
}Shortened here: lists show their first two items and long strings are cut. The whole answer is this route’s example in /openapi.json.
| Field | Type | What it is |
|---|---|---|
version | Typestring | |
usage | Typeone of "T", "P" | |
x12 | Typestring | |
interchange_control_number | Typestring | |
group_control_number | Typestring | |
transaction_set_control_numbers | Typelist of string | |
segments | Typeinteger | |
fhir | Typeobject | What it isWith output fhir or both: the implementation guide named, a note that the shape is not validated, and each request’s bundle. |
requests | Typelist of object | |
payer_choice | Typestring | What it isThat Payerworks sends nothing, and whether a payer takes a 278 at all is the payer’s choice. |
transmitted | Typethe value false |
Request
curl -sS -X POST "$PAYERWORKS_BASE_URL/v1/authorizations/explain" \
-H "Authorization: Bearer $PAYERWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d @request.jsonWith the JavaScript client
const answer = await pw.postAuthorizationsExplain(body);With the Python client
answer = pw.post_authorizations_explain(body){
"x12": "ISA*00* *00* *ZZ*PWSANDBOX *ZZ*SUBMITTER *261019*1500*^*00501*000000002*0*T*:~GS*HI*PWSANDBOX*SUBMITTER*20261019*1500*2*X*005010X217~ST*278*0001*005010X217~BHT*0007*11*AUTH-0001*20261019*1500*18~HL*1**20*1~NM1*X3*2*PAYERWORKS SANDBOX PAYER*****PI*PWSANDBOX~HL*2*1*21*1~NM1*1P*2*Sample Family Medicine*****XX*1234567893~HL*3*2*22*1~NM1*IL*1*PATIENT*SAMPLE****MI*W12345PARTIAL~DMG*D8*19800214*F~HL*4*3*EV*1~TRN*2*AUTH-0001*9SUBMITTER~UM*HS*I*12*12:B~HCR*A2*PWA033425780*10~REF*NT*PWR951115437~DTP*AAH*RD8*20261102-20270130~DTP*102*D8*20261019~DTP*007*RD8*20261102-20270130~DTP*036*D8*20270130~HI*ABK:M1711~HL*5*4*SS*0~TRN*2*852346626*9SUBMITTER~HCR*A2*PWA033425780*10~DTP*472*D8*20261102~SV1*HC:L1833**UN*2~SE*25*0001~GE*1*2~IEA*1*000000002~",
"asked": {
"controlNumber": "AUTH-0001",
"tradingPartnerServiceId": "PWSANDBOX",
"requester": {
"organizationName": "Sample Family Medicine",
"npi": "1234567893"
},
"subscriber": {
"memberId": "W12345PARTIAL",
"firstName": "SAMPLE",
"lastName": "PATIENT",
"dateOfBirth": "1980-02-14",
"gender": "F"
},
"review": {
"serviceTypeCode": "12",
"placeOfServiceCode": "12",
"diagnoses": [
"M17.11"
]
},
"services": [
{
"procedureCode": "L1833",
"units": 4,
"serviceDate": "2026-11-02"
}
]
}
}{
"kind": "278",
"source": "x12",
"envelope": {
"sender_qualifier": "ZZ",
"sender": "PWSANDBOX",
"receiver_qualifier": "ZZ",
"receiver": "SUBMITTER",
"date": "261019",
"time": "1500",
"control_number": "000000002",
"usage": "T",
"functional_group": "HI",
"version": "005010X217",
"transaction_sets": {
"278": 1
},
"segments": 28
},
"reviews": [
{
"index": 0,
"trace": "AUTH-0001",
"purpose": "response",
"payer": {
"name": "PAYERWORKS SANDBOX PAYER",
"id": "PWSANDBOX",
"entity": "X3"
},
"requester": {
"name": "Sample Family Medicine",
"id_qualifier": "XX",
"id": "1234567893",
"entity": "1P"
},
"subscriber": {
"name": "SAMPLE PATIENT",
"member_id": "W12345PARTIAL",
"birth_date": "1980-02-14",
"gender": "F"
},
"dependent": null,
"request_category": {
"code": "HS",
"words": "health services review: outpatient services",
"known": true
},
"service_type": {
"code": "12",
"words": "durable medical equipment, purchased",
"known": true,
"verified_in_005010": true,
"later_words": ""
},
"verdict": "partially_approved",
"words": "Approved in part, certification number PWA033425780: fewer units than asked on one service.",
"next_step": "Bill only what was approved, with PWA033425780 as priorAuthorizationNumber (2300 REF*G1). For what was not, ask the payer to reconsider (a 278 with certificationType N and the administrative reference number, where the payer takes one) or f…",
"certification_number": "PWA033425780",
"administrative_reference_number": "PWR951115437",
"previous_authorization_number": "",
"decision": {
"code": "A2",
"words": "certified in part",
"verdict": "partially_approved",
"known": true,
"certification_number": "PWA033425780",
"second_surgical_opinion": ""
},
"reason": {
"code": "10",
"words": "the delivery pattern asked (units, days, visits, weeks, hours or months)",
"kind": "denial",
"known": true
},
"rejections": [],
"dates": {
"event": {
"begin": "2026-11-02",
"end": "2027-01-30"
},
"admission": "",
"certification": {
"issued": "2026-10-19",
"effective": {
"begin": "2026-11-02",
"end": "2027-01-30"
},
"expires": "2027-01-30"
}
},
"services": [
{
"index": 0,
"trace": "852346626",
"procedure": {
"qualifier": "HC",
"code": "L1833",
"modifiers": []
},
"verdict": "partially_approved",
"decision": {
"code": "A2",
"words": "certified in part",
"verdict": "partially_approved",
"known": true,
"certification_number": "PWA033425780"
},
"reason": {
"code": "10",
"words": "the delivery pattern asked (units, days, visits, weeks, hours or months)",
"known": true
},
"units": 2,
"units_asked": 4,
"units_cut": 2,
"dates": {
"begin": "2026-11-02",
"end": "2026-11-02"
},
"dates_asked": {
"begin": "2026-11-02",
"end": "2026-11-02"
},
"dates_changed": false,
"quantities": [],
"administrative_reference_number": "",
"messages": []
}
],
"quantities": [],
"messages": [],
"claim": {
"prior_authorization_number": "PWA033425780",
"field": "claimInformation.claimSupplementalInformation.priorAuthorizationNumber",
"segment": "2300 REF*G1",
"route": "POST /v1/claims/837p"
},
"notes": [
"From 01/01/2026, CMS-0057-F (89 FR 8758, 02/08/2024) requires Medicare Advantage organizations, Medicaid and CHIP programs and plans, and QHP issuers on the federal exchanges to give a specific reason for a denied prior authorization (drugs…"
],
"label_source": "paraphrase"
}
],
"label_source": "paraphrase"
}Shortened here: lists show their first two items and long strings are cut. The whole answer is this route’s example in /openapi.json.
| Field | Type | What it is |
|---|---|---|
kind | Typethe value "278" | |
source | Typeone of "x12", "json", "fhir" | |
envelope | TypeEnvelope or null | |
reviews | Typelist of AuthorizationReview | |
answer | Typeobject | What it isOnly with ?include=answer: the 278 read to JSON. |
label_source | Typethe value "paraphrase" |
Request
curl -sS -X POST "$PAYERWORKS_BASE_URL/v1/sandbox/authorizations" \
-H "Authorization: Bearer $PAYERWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d @request.jsonWith the JavaScript client
const answer = await pw.postSandboxAuthorizations(body);With the Python client
answer = pw.post_sandbox_authorizations(body){
"request": {
"controlNumber": "AUTH-0001",
"tradingPartnerServiceId": "PWSANDBOX",
"requester": {
"organizationName": "Sample Family Medicine",
"npi": "1234567893"
},
"subscriber": {
"memberId": "W12345PARTIAL",
"firstName": "SAMPLE",
"lastName": "PATIENT",
"dateOfBirth": "1980-02-14",
"gender": "F"
},
"review": {
"serviceTypeCode": "12",
"placeOfServiceCode": "12",
"diagnoses": [
"M17.11"
]
},
"services": [
{
"procedureCode": "L1833",
"units": 4,
"serviceDate": "2026-11-02"
}
]
}
}{
"usage": "T",
"transmitted": false,
"control": {
"interchange_request": "000000001",
"interchange_response": "000000002",
"sets": [
"0001"
]
},
"files": {
"authorization_request_278": "ISA*00* *00* *ZZ*SUBMITTER *ZZ*PWSANDBOX *261019*1500*^*00501*000000001*0*T*:~GS*HI*SUBMITTER*PWSANDBOX*20261019*1500*1*X*005010X217~ST*278*0001*005010X217~BHT*0007*13*AUTH-0001*20261019*1500~HL*1**20*1~NM1*X3*2*…",
"authorization_response_278": "ISA*00* *00* *ZZ*PWSANDBOX *ZZ*SUBMITTER *261019*1500*^*00501*000000002*0*T*:~GS*HI*PWSANDBOX*SUBMITTER*20261019*1500*2*X*005010X217~ST*278*0001*005010X217~BHT*0007*11*AUTH-0001*20261019*1500*18~HL*1**20*1~NM1*X3…"
},
"outcomes": [
{
"index": 0,
"trace": "AUTH-0001",
"outcome": "partially_approved",
"trigger": "PARTIAL"
}
],
"requests": [
{
"index": 0,
"trace": "AUTH-0001",
"warnings": []
}
],
"explained": [
{
"index": 0,
"trace": "AUTH-0001",
"purpose": "response",
"payer": {
"name": "PAYERWORKS SANDBOX PAYER",
"id": "PWSANDBOX",
"entity": "X3"
},
"requester": {
"name": "Sample Family Medicine",
"id_qualifier": "XX",
"id": "1234567893",
"entity": "1P"
},
"subscriber": {
"name": "SAMPLE PATIENT",
"member_id": "W12345PARTIAL",
"birth_date": "1980-02-14",
"gender": "F"
},
"dependent": null,
"request_category": {
"code": "HS",
"words": "health services review: outpatient services",
"known": true
},
"service_type": {
"code": "12",
"words": "durable medical equipment, purchased",
"known": true,
"verified_in_005010": true,
"later_words": ""
},
"verdict": "partially_approved",
"words": "Approved in part, certification number PWA033425780: fewer units than asked on one service.",
"next_step": "Bill only what was approved, with PWA033425780 as priorAuthorizationNumber (2300 REF*G1). For what was not, ask the payer to reconsider (a 278 with certificationType N and the administrative reference number, where the payer takes one) or f…",
"certification_number": "PWA033425780",
"administrative_reference_number": "PWR951115437",
"previous_authorization_number": "",
"decision": {
"code": "A2",
"words": "certified in part",
"verdict": "partially_approved",
"known": true,
"certification_number": "PWA033425780",
"second_surgical_opinion": ""
},
"reason": {
"code": "10",
"words": "the delivery pattern asked (units, days, visits, weeks, hours or months)",
"kind": "denial",
"known": true
},
"rejections": [],
"dates": {
"event": {
"begin": "2026-11-02",
"end": "2027-01-30"
},
"admission": "",
"certification": {
"issued": "2026-10-19",
"effective": {
"begin": "2026-11-02",
"end": "2027-01-30"
},
"expires": "2027-01-30"
}
},
"services": [
{
"index": 0,
"trace": "852346626",
"procedure": {
"qualifier": "HC",
"code": "L1833",
"modifiers": []
},
"verdict": "partially_approved",
"decision": {
"code": "A2",
"words": "certified in part",
"verdict": "partially_approved",
"known": true,
"certification_number": "PWA033425780"
},
"reason": {
"code": "10",
"words": "the delivery pattern asked (units, days, visits, weeks, hours or months)",
"known": true
},
"units": 2,
"units_asked": 4,
"units_cut": 2,
"dates": {
"begin": "2026-11-02",
"end": "2026-11-02"
},
"dates_asked": {
"begin": "2026-11-02",
"end": "2026-11-02"
},
"dates_changed": false,
"quantities": [],
"administrative_reference_number": "",
"messages": []
}
],
"quantities": [],
"messages": [],
"claim": {
"prior_authorization_number": "PWA033425780",
"field": "claimInformation.claimSupplementalInformation.priorAuthorizationNumber",
"segment": "2300 REF*G1",
"route": "POST /v1/claims/837p"
},
"notes": [
"From 01/01/2026, CMS-0057-F (89 FR 8758, 02/08/2024) requires Medicare Advantage organizations, Medicaid and CHIP programs and plans, and QHP issuers on the federal exchanges to give a specific reason for a denied prior authorization (drugs…"
],
"label_source": "paraphrase"
}
],
"payer_choice": "Payerworks sends nothing. Whether a payer accepts an X12 278 or a FHIR prior authorization request at all is the payer's choice: many take them only on a portal, by fax or by phone, and its companion guide says what it requires."
}Shortened here: lists show their first two items and long strings are cut. The whole answer is this route’s example in /openapi.json.
| Field | Type | What it is |
|---|---|---|
usage | Typethe value "T" | |
transmitted | Typethe value false | |
control | Typeobject | |
files | Typeobject | |
outcomes | Typelist of object | |
requests | Typelist of object | |
explained | Typelist of AuthorizationReview | |
payer_choice | Typestring |
Request
curl -sS -X POST "$PAYERWORKS_BASE_URL/v1/authorizations/required" \
-H "Authorization: Bearer $PAYERWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d @request.jsonWith the JavaScript client
const answer = await pw.postAuthorizationsRequired(body);With the Python client
answer = pw.post_authorizations_required(body){
"procedure_codes": [
"L1833",
"L3761",
"E0601"
],
"date_of_service": "2026-11-02",
"payer_type": "medicare_fee_for_service"
}{
"date_of_service": "2026-11-02",
"payer_type": "medicare_fee_for_service",
"state": null,
"setting": null,
"payer_choice": "Payerworks sends nothing. Whether a payer accepts an X12 278 or a FHIR prior authorization request at all is the payer's choice: many take them only on a portal, by fax or by phone, and its companion guide says what it requires.",
"codes": [
{
"code": "L1833",
"kind": "hcpcs",
"required": true,
"lists": [
{
"list": "dmepos",
"name": "CMS DMEPOS Required Prior Authorization List",
"url": "https://www.cms.gov/research-statistics-data-and-systems/monitoring-programs/medicare-ffs-compliance-programs/dmepos/downloads/dmepos_pa_required-prior-authorization-list.pdf",
"updated": "07/29/2026",
"read": "10/19/2026",
"group": "Orthoses",
"words": "knee orthosis, adjustable joints, positional, off the shelf",
"required": true,
"from": "2026-10-28",
"why": "nationwide"
}
],
"words": "L1833 needs prior authorization for Medicare fee-for-service on 11/02/2026: it is on the DMEPOS Required Prior Authorization List, required from 10/28/2026."
},
{
"code": "L3761",
"kind": "hcpcs",
"required": "depends_on_state",
"lists": [
{
"list": "dmepos",
"name": "CMS DMEPOS Required Prior Authorization List",
"url": "https://www.cms.gov/research-statistics-data-and-systems/monitoring-programs/medicare-ffs-compliance-programs/dmepos/downloads/dmepos_pa_required-prior-authorization-list.pdf",
"updated": "07/29/2026",
"read": "10/19/2026",
"group": "Orthoses",
"words": "elbow orthosis, adjustable locking joint, off the shelf",
"required": "depends_on_state",
"from": "2026-10-28",
"states": [
"NY",
"MI"
],
"nationwide_from": "2027-04-26",
"why": "phased"
}
],
"words": "L3761 is on the DMEPOS Required Prior Authorization List, phased in by state: on 11/02/2026 it is required where the beneficiary lives in NY, MI, FL, CA, and nationwide from 04/26/2027. Send the state the beneficiary lives in to settle it."
}
],
"sources": [
{
"name": "CMS DMEPOS Required Prior Authorization List",
"url": "https://www.cms.gov/research-statistics-data-and-systems/monitoring-programs/medicare-ffs-compliance-programs/dmepos/downloads/dmepos_pa_required-prior-authorization-list.pdf",
"updated": "07/29/2026",
"read": "10/19/2026"
},
{
"name": "CMS Hospital Outpatient Department Services That Require Prior Authorization",
"url": "https://www.cms.gov/files/document/opd-services-require-prior-authorization.pdf",
"updated": "09/25/2026",
"read": "10/19/2026"
}
],
"note": "Medicare fee-for-service claims for these items, by the date of delivery (for a rental, of the initial rental claim). It does not apply to Medicare Advantage plans. Medicare fee-for-service services furnished in a hospital outpatient depart…"
}Shortened here: lists show their first two items and long strings are cut. The whole answer is this route’s example in /openapi.json.
| Field | Type | What it is |
|---|---|---|
date_of_service | Typestring | |
payer_type | Typestring | |
state | Typestring or null | |
setting | Typestring or null | |
payer_choice | Typestring | |
codes | Typelist of object | |
sources | Typelist of object | |
note | Typestring |
Reading the answer
- Each review in an explain answer has a
verdictand itswords, thedecisionandreasoncodes explained, thecertification_numberwhen the payer gave one, and thenext_step. - A request to the sandbox with a member ID the eligibility sandbox cannot find is not found here either, and a claim the claims sandbox denies is not certified here.
Troubleshooting
invalid_authorization_requests(422): One request would be refused, so nothing was written; each request’s errors are listed.not_a_278_response(422): This 278 holds requests only: send the payer’s response.
Every refusal these routes may answer, with its status. Any route may also answer the codes every route shares, on Every error.
| Code | Status | What it means |
|---|---|---|
invalid_asked_requests | Status400 | What it meansasked is the review request, or the list of them, that the response answers. |
invalid_date_of_service | Status400 | What it meansdate_of_service is a day, YYYY-MM-DD. |
invalid_explain_include | Status400 | What it meansinclude names what to add to the answer: answer (the read of the 278). |
invalid_output | Status400 | What it meansoutput is "x12" (the default), "fhir" (the Da Vinci PAS bundle shape) or "both". |
invalid_payer_type | Status400 | What it meanspayer_type is medicare_fee_for_service, medicare_advantage, medicaid, commercial or other. |
invalid_procedure_codes | Status400 | What it meansEach procedure code is a HCPCS Level II code (a letter and four digits) or a five-character CPT code. |
invalid_sender_id | Status400 | What it meanssender_id is your submitter id at the receiver: 2 to 15 letters, digits or spaces. |
invalid_setting | Status400 | What it meanssetting is hospital_outpatient or other (where the service is furnished), or left out. |
invalid_state | Status400 | What it meansstate is the two-letter state the patient lives in, such as CA. |
no_authorization_answer | Status400 | What it meansSend the 278 response as x12 (the file's text), as json (Payerworks' own read of one) or as fhir (a Da Vinci PAS response Bundle or ClaimResponse). |
no_authorization_request | Status400 | What it meansThe body has no review request: send requests (a list), request, or the request itself in the JSON shape the docs describe. |
no_procedure_codes | Status400 | What it meansSend procedure_codes: a list of HCPCS or CPT codes, such as L1833 or 64490. |
too_many_authorization_requests | Status400 | What it meansAt most 100 review requests a call. |
too_many_procedure_codes | Status400 | What it meansAt most 100 procedure codes a call. |
test_key_production_file | Status403 | What it meansA test key writes test interchanges only (ISA15 = T). Use a live key for a production file. |
answer_too_large | Status413 | What it meansThis answer is larger than one response can carry: send less in each call (split the file, or send fewer claims or requests). |
file_too_large | Status413 | What it meansThis file holds more than one call can read: the error names what was counted (unit) and the most one call reads (limit). Split it and send each part in its own call. |
duplicate_authorization_trace | Status422 | What it meansTwo review requests in one file carry the same trace (controlNumber); each must be unique so its response matches back. |
invalid_authorization_requests | Status422 | What it meansOne or more review requests would be refused; nothing was written. Each request's errors are listed. |
not_a_278 | Status422 | What it meansThis is not an X12 278 request for review and response (005010X217): send the 278 with its ISA envelope. |
not_a_278_json | Status422 | What it meansThis JSON is not a read 278: it holds no reviews with a decision or a rejection. |
not_a_278_response | Status422 | What it meansThis 278 holds requests only (BHT02 13): send the payer's response (BHT02 11). |
not_a_pas_response | Status422 | What it meansThis FHIR resource is not a PAS response: send a Bundle holding a ClaimResponse, or the ClaimResponse, with a reviewAction or an error. |
Code lists
The prior authorization sandbox’s member ID endings
It answers from the same payer as the eligibility sandbox, and the endings the two share answer alike: a member the eligibility sandbox cannot find is not found here either, and a claim the claims sandbox denies is not certified here. These are its endings:
| Ending | Outcome | What it answers |
|---|---|---|
NOTFOUND | Outcomesubscriber_not_found | What it answersA member ID ending in NOTFOUND is not found: the response refuses in the subscriber’s loop with AAA 75 and reviews nothing. |
BADDOB | Outcomebirth_date_mismatch | What it answersA member ID ending in BADDOB is found, but the birth date does not match: AAA 71 in the patient’s loop, and nothing reviewed. |
DOWN | Outcomepayer_unavailable | What it answersA member ID ending in DOWN reaches a payer that cannot answer: AAA 42 in the payer’s loop, follow-up R. Send it again later, unchanged. |
REJ | Outcomemember_id_invalid | What it answersA member ID ending in REJ is refused as a member ID the payer does not accept: AAA 72 in the subscriber’s loop, the same refusal the claims sandbox gives. |
INACTIVE | Outcomenot_eligible | What it answersA member ID ending in INACTIVE is not certified because the patient was not covered on the date of service: HCR A3 with reason 53, as the eligibility sandbox ends that coverage last year. |
NOTREQ | Outcomenot_required | What it answersA member ID ending in NOTREQ needs no authorization: HCR NA with reason 0H, and no certification number. |
PARTIAL | Outcomepartially_approved | What it answersA member ID ending in PARTIAL is certified in part: each service asked for two or more units is approved for half of them, rounded down (HCR A2, reason 10); a service of one unit is approved in full. |
MODDATE | Outcomemodified_dates | What it answersA member ID ending in MODDATE is certified with changes (HCR A6): the dates approved start two weeks after the dates asked and run for thirty days. |
DENY | Outcomedenied | What it answersA member ID ending in DENY is not certified as not medically necessary (HCR A3, reason 0F), as the claims sandbox denies the claim. |
INFO | Outcomemore_information_needed | What it answersA member ID ending in INFO is pended until the payer has more patient information (HCR A4, reason 0U), and a message names the visit notes it needs. |
PEND | Outcomepended | What it answersA member ID ending in PEND is pended while the first utilization review runs (HCR A4, reason 30), with an administrative reference number to follow it by. |
| `` | Outcomeapproved | What it answersAny other member ID is certified in total (HCR A1) with a certification number, every service approved for the units asked, effective from the first date asked for at least ninety days. |
In detail
Prior authorization, written and read
Write the 278 from JSON, send it the way the payer takes it, and give Payerworks the response that comes back. Payerworks sends nothing.
- Whether a payer takes a 278 at all is the payer’s choice: many take prior authorizations only on a portal, by fax or by phone. Every answer that writes a file says so.
- A response is read by its decision code: a request the payer never reviewed reads not reviewed, never denied, and a pend that asks for something reads waiting on more information.
- The certification number goes on the claim by the request’s kind: an authorization’s as the prior authorization number, a referral’s as the referral number, and only when something was approved.
- The Medicare lists are dated copies of CMS’s own, said with their dates, and a code on neither is not on the lists held, never not required. A CPT code is held by its number only.
- The FHIR output is the Da Vinci PAS bundle’s shape, built from the guide’s published pages and examples; it has not been run through the HL7 validator.
Example
prior-authorization.mjs runs every step below against the API with a test key. It needs payerworks.mjs and sample-data.mjs beside it.
// Payerworks example: prior authorization, a 278 written and its response read. Docs: https://payerworks.com/docs/prior-authorization
//
// Run it with Node 18 or later, with the JavaScript client (https://payerworks.com/sdk/payerworks.mjs)
// and sample-data.mjs beside this file:
// PAYERWORKS_API_KEY=pw_test_... PAYERWORKS_BASE_URL=<the base URL shown with your key> node prior-authorization.mjs
// A test key and invented data only. Payerworks sends nothing to a payer: every file it writes is yours.
import { pathToFileURL } from 'node:url';
import { Payerworks, PayerworksError } from './payerworks.mjs';
import { AUTHORIZATION_REQUEST, SENDER_ID, PAYER_ID, copy, refusalOf } from './sample-data.mjs';
/** @param {Payerworks} pw */
export async function run(pw) {
// 1. The request written as a 278, to send the way the payer takes it.
const written = await pw.postAuthorizations278({ sender_id: SENDER_ID, receiver_id: PAYER_ID, control_number: 31, request: copy(AUTHORIZATION_REQUEST) });
// 2. The authorization sandbox answers it with a 278 response, already explained.
const request = { ...copy(AUTHORIZATION_REQUEST), tradingPartnerServiceId: 'PWSANDBOX' };
const sandbox = await pw.postSandboxAuthorizations({ request });
// 3. Explain a response you hold: the same reading, from the file alone.
const explained = await pw.postAuthorizationsExplain({ x12: sandbox.files.authorization_response_278 });
// 4. The failure path: the request you sent is not the payer's response, and the route says so.
const refused = await refusalOf(() => pw.postAuthorizationsExplain({ x12: written.x12 }), { PayerworksError });
return {
written: { transmitted: written.transmitted },
verdict: explained.reviews[0].verdict,
next_step: Boolean(explained.reviews[0].next_step),
refused,
};
}
// Run as a script: node <this file>, with PAYERWORKS_API_KEY and PAYERWORKS_BASE_URL set.
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
console.log(JSON.stringify(await run(new Payerworks()), null, 2));
}
{
"written": {
"transmitted": false
},
"verdict": "approved",
"next_step": true,
"refused": {
"status": 422,
"code": "not_a_278_response",
"request_id": "req_4"
}
}A free test key lets you try the API’s calls with invented data only. Payerworks sends nothing to any payer yet.
Get a test key