Credit and Debit Adjustment APIs
Credit and debit adjustments are bi-directional transactions that allows buyers and sellers to ensure the accuracy of financial records and reconcile discrepancies between invoices, payments, and inventory. These adjustments ensure accurate financial records and proper inventory management, reflecting true transaction values between MAH, wholesalers, distributors, and retailers. Use the credit and debit adjustment transactions to correct errors or adjust previously recorded financial transactions. In both cases, adjustments are made to the accounts receivable or payable ledger to reflect the corrected balances. For example, if the manufacturer detects an undercharge on products shipped to the wholesaler for a specific purchase order, they send a credit and debit adjustment memo to the wholesaler, debiting them for the missing charge. Conversely, if the wholesaler finds an overcharge for products listed on a purchase order that were not received, they send a credit and debit adjustment memo to the manufacturer, debiting them for the overcharged amount.
Users can configure post-transformation logic to classify a sent or received credit and debit adjustment transaction as a client credit and debit adjustment or provider credit and debit adjustment. For example, if the controlFileHeader/fileSenderNumber
attribute in the canonical matches the companyIdentifierType
and companyIdentifierValue
within the thirdPartyLogisticsInformation
attribute in the canonical, the system should create the transaction subtype as Provider Credit Debit Adjustments. If no match is found, the system should instead create the transaction subtype as Client Credit Debit Adjustments.
Both credit and debit adjustments directly impact the accounts receivable or payable ledger, ensuring that it accurately reflects the current financial status. The following adjustments are recorded in the ledger to update the balances:
- Credit Adjustments - Decreases the amount a buyer (such as a pharmacy, hospital, or wholesaler) or a customer owes. It typically occurs in scenarios such as the return of goods, pricing errors, promotional discounts or rebates, and short shipments.
- Debit Adjustments - Increases the amount a buyer (such as a pharmacy, hospital, or wholesaler) or a customer owes. It may occur when applying additional charges, correcting undercharged amounts, or invoicing previously unpaid fees, under-billed shipments, price increases, additional charges, damage or loss during shipment.
Credit And Debit Adjustments (X12)
Buyers or sellers use credit and debit adjustments to ensure the accuracy of financial records and reconcile discrepancies between invoices, payments, and inventory.
- Message Type: MPC_CREDIT_DEBIT_ADJUSTMENT
- X12 Format: 812
- Transform Names:
- X12 (inbound)
- B2B_EDI_X12_812_CreditDebitAdjustment_IB_V1
- X12 (inbound)

Input Element | Occurs | Length | Description | Example | |||
---|---|---|---|---|---|---|---|
ISA | – | Required.ISA interchange envelope. | – | ||||
ISA01 | 2/2 |
Required.Authorization information qualifier identifying the type of identifier in ISA02. Valid values:
Typically this value is |
00 | ||||
ISA02 | 10/10 |
Required.Authorization identifier value used for additional identification or authorization of the interchange sender or the data in the interchange.
|
– | ||||
ISA03 | 2/2 |
Required.Qualifier for security information in ISA04. Valid values:
Typically this value = |
00 | ||||
ISA04 | 10/10 |
Required.Security information identifying for the interchange sender or data.
|
– | ||||
ISA05 | 2/2 |
Required.Interchange sender partner ID qualifier. All X12 sender identifier type qualifiers in ISA05 are supported. Valid values:
|
07 | ||||
ISA06 | 15/15 | Required.ISA interchange sender identifier. | 7777776067344 | ||||
ISA07 | 2/2 |
Required.Interchange receiver partner ID qualifier. All X12 receiver identifier type qualifiers in ISA07 are supported. Valid values:
|
01 | ||||
ISA08 | 15/15 | Required.ISA interchange receiver ID. | 888888404358877 | ||||
ISA09 | 6/6 | Required.Interchange date in 6 char YYMMDD format. | 241028 | ||||
ISA10 | 4/4 | Required.Interchange time in 4 char HHMM format. | 1420 | ||||
ISA11 | 1/1 |
Required.This value is dependent on X12 version.
|
^ | ||||
ISA12 | 5/5 | Required.Interchange control version number. This could be any X12 version. | 00501 | ||||
ISA13 | 9/9 |
Required.Interchange Control Number mapping to file control header. |
0000000000619827 | ||||
ISA14 | 1/1 |
Required.Interchange level acknowledgment requested. Valid values:
|
0 | ||||
ISA15 | 1/1 |
Required.Indicates whether the interchange is for production, test, or information purposes. Valid values:
|
P | ||||
ISA16 | 1/1 |
Required.Component element separator. Delimiter that separates data elements within a composite data structure. Must be different than the data element separator and segment terminator. |
> | ||||
GS | – | GS group functional envelope. Child of ISA. Only one GS group expected per interchange. | – | ||||
GS01 | 2/2 |
Required.GS group function code. The valid
value is |
CD | ||||
GS02 | 2/15 | Required.Application sender's code. | 2222224043588 | ||||
GS03 | 2/15 | Required.Application receiver's code. | TRACELINK | ||||
GS04 | 8/8 | Required.Current date stamp in 8 char X12 date format YYYYMMDD. | 20241028 | ||||
GS05 | 4/8 | Required.Current time stamp in 6 char X12 time format HHMMSS. | 142000 | ||||
GS06 | 1/9 | Required.Group Control ID Number. | 619827 | ||||
GS07 | 1/2 |
Required.Responsible Agency Code. Valid values:
|
X | ||||
GS08 | 1/12 | Required.X12 message version code. This could be any X12 version. | 005010 | ||||
ST | – | ST transaction set envelope. Child of GS group. Only one ST transaction expected. | – | ||||
ST01 | 3/3 | Required.Transaction set identifier code. | 812 | ||||
ST02 | 4/9 | Required.Transaction set ID number. Counter for each ST segment beginning with 1. | 0001 | ||||
BCD | – | Required.Credit or debit adjustment beginning segment BCD. | – | ||||
BCD01 | 8/8 | Required.Date of credit or debit adjustment in string date format YYYYMMDD mapping to canonical header. | 20241028 | ||||
BCD02 | 1/22 |
Required.Credit or debit adjustment number mapping to canonical header. Reference document identifier for the credit or debit adjustment transaction. Required value for all three formats. |
0000458795 | ||||
BCD03 | 1/2 |
Required.Code identifying action to be taken by all parties, concerning the credit or debit recorded in the message. Valid values:
|
DEBITCREDIT | ||||
BCD04 | 1/15 |
Required.Total amount of the credit or debit adjustment for the complete transaction. Note: Amount includes two digits implicit decimals.(24589.23 treated as 2458923 ) |
2458923 | ||||
BCD05 | 1/1 |
Credit or debit flag code. Indicates if the amount is a credit or a debit. Valid values:
|
C | ||||
BCD06 | 8/8 | Date of credit memo in date format YYYYMMDD. HDA guideline identify BCD06 and BCD07 as the credit memo date and number. We're following the HDA guidelines here. | 20241028 | ||||
BCD07 | 1/22 |
Credit memo identifier. HDA guideline identify BCD06 and BCD07 as the credit memo date and number. Standard X12 uses this for the invoice identifier. We're following the HDA guidelines. If this field is populated we treat it as a credit memo.
|
002356874148 | ||||
BCD08 | 1/22 |
Vendor order number, Number assigned by a vendor referencing a particular customer purchase order as per HAD guideline. |
0085697458 | ||||
BCD09 | 8/8 | Purchase order date in date format YYYYMMDD. HDA guideline. | 20241028 | ||||
BCD10 | 1/22 | Purchase order identifier. HDA guideline. | 0000458795 | ||||
BCD11 | 2/2 |
Transaction set purpose code. Valid values:
|
00 | ||||
BCD12 | 2/2 |
Code specifying the type of transaction document supporting the message. Valid values include:
|
CG | ||||
BCD13 | 2/3 |
Reference identification qualifier for the reference identifier in BCD14. Valid values include:
If either BCD13 or BCD14 is present, then the other is required. |
CK | ||||
BCD14 | 1/80 | Reference identifier as qualified by BCD13 instance. | 0000458795 | ||||
N9 | – |
Extended reference information segment. Used to transmit identifying information specified by the reference identification qualifier. |
– | ||||
N901 | 2/3 |
Required.Reference identification qualifier. Valid values:
If CREDIMEMO is provided in both BCD07 and N901, BCD07 will be considered Credit memo identifier. If BATCH is provided in both BCD14 and N901, BCD14 will be considered as batch identifier. |
BT | ||||
N902 | 1/80 |
Reference identifier. Reference information as specified by the reference identification qualifier in N901. Required if N901 is present. |
002621337 | ||||
N904 | 8/8 | Date for reference identifier in date format YYYYMMDD. | 20241028 | ||||
ITD | – | Terms of sale or deferred terms of sale. | – | ||||
ITD01 | 2/2 |
Required.Terms of payment type code. Valid values:
|
01 | ||||
ITD02 | 1/2 |
Terms of payment basis date code. Identifies the beginning of the terms period. Valid values:
|
1 | ||||
ITD03 | 1/6 | Terms of payment discount percent available to the purchaser if an invoice is paid on or before the terms discount due date. | 10 | ||||
ITD04 | 8/8 | Terms of payment discount due date in date format YYYYMMDD. | 20241128 | ||||
ITD05 | 1/3 |
Terms of payment discount days due. Number of days in the terms discount period by which payment is due if terms discount is earned. |
15 | ||||
ITD06 | 8/8 | Terms of payment net due date in date format YYYYMMDD. Date when the total invoice amount becomes due. | 20241128 | ||||
ITD07 | 1/3 |
Terms of payment net days. Number of days until the total invoice amount is due. The discount not applicable. |
15 | ||||
ITD08 | 1/10 | Total amount of the terms of payment discount. | 25.00 | ||||
ITD09 | 8/8 |
Terms of payment deferred due date. Date deferred payment or percent of invoice payable is due. |
20241128 | ||||
ITD10 | 1/10 | Deferred amount due for payment. | 10.00 | ||||
ITD11 | 1/5 |
Percentage of invoice payable. Amount of invoice payable expressed as a percentage. |
15 | ||||
ITD12 | 1/80 | Free form description for terms of payment information. | |||||
ITD13 | 1/2 |
Day of month. The numeric value of the day of the month between 1 and the maximum day of the month being referenced. |
19 | ||||
DTM | – | DTM date segment for credit/debit adjustment at the header level. | – | ||||
DTM01 | 3/3 |
Required.Date type at header level relevant for credit debit adjustment. Valid values:
|
009 | ||||
DTM02 | 8/8 | Processing date in date format YYYYMMDD - Rquired if DTM01 is valid. | 20241028 | ||||
DTM03 | 4/8 |
Processing time in time format HHMMSS. |
123422 | ||||
SAC | – |
Service, promotion, allowance or charge information. Used to request or identify a service, promotion, allowance, or charge and/or to specify the amount or percentage for the service, promotion, allowance, or charge. |
– | ||||
SAC01 | 1/1 |
Required.Indicator that specifies the amount in SAC05 as an allowance or a charge. Valid values:
|
A | ||||
SAC02 | 4/4 |
Code representing type of credit or charge. (HDA and other company guidelines): ![]()
|
A170 | ||||
SAC05 | 1/15 |
Total amount for the service, promotion, allowance, or charge. Note: Amount includes two digits implicit decimals(125.25 treated as 12525) |
12525 | ||||
SAC09 | 2/2 |
Unit or Basis for Measurement Code. ![]()
Required if SAC10 is present. |
EA | ||||
SAC10 | 1/15 | Total number of units for credit or debit adjustment. Required if SAC09 is present | 100 | ||||
SAC15 | 1/80 | Free form description. HDA: Used to further describe the adjustment, ie, may be used to explain a quantity difference. | Discounted | ||||
N1 | – | Party data information. | – | ||||
N101 | 2/3 |
Required.Entity qualifier for the party identifier and address information. Valid value:
|
BT | ||||
N102 | 1/60 | Required.Name. | Pharma customer | ||||
N103 | 1/2 |
Required.Identifier code qualifier. ![]()
|
UL | ||||
N104 | 2/80 | Required.Party identifier as qualified by N103 mapping to companyIdentifierValue. | 3333331013655 | ||||
N3 | – | N3: Address: Child of party N1 name segment. | – | ||||
N301 | 1/55 | Required.Street address 1. | 555 Neelan Road | ||||
N302 | 1/55 | Street address 2. | Suite 123 | ||||
N4 | – | N4: Geographic Location. Child of party N1 name segment. | – | ||||
N401 | 2/30 | Required.City name. | Sacramento | ||||
N402 | 2/2 |
Required.State or province code. Code (Standard state/province) as defined by appropriate government agency. |
CA | ||||
N403 | 3/15 | Required.Postal code. Code defining international postal zone code excluding punctuation and blanks. | 95833 | ||||
N404 | 2/3 | Required.Country code. | US | ||||
PER | – | Contact Information. | – | ||||
PER01 | 2/2 | Required.Contact function code
identifying major duty or responsibility of person or group named as contact.
The valid value is AJ - Primary contact. |
AJ | ||||
PER02 | 1/60 | Name of the contact person responsible for authenticating the pedigree information. | John Smith | ||||
PER03 | 2/2 |
Communication Number Qualifier identifying the contact person's telephone number or email address. Valid values:
If either PER03 or PER04 is present, then the other is required. |
TE | ||||
PER04 | 1/2048 | Telephone number or email address of the contact person expected in this field. | +1.516.747.6849 | ||||
PER05 | 2/2 |
Communication Number Qualifier identifying the contact person's telephone number or email address. Valid values:
If either PER05 or PER06 is present, then the other is required. |
EM | ||||
PER06 | 1/2048 | Telephone number or email address of the contact person expected in this field. | jsmith@manufac.com | ||||
CDD | – | Credit or debit adjustment details loop. | – | ||||
CDD01 | 2/2 |
Required.Adjustment reason code specifying the reason for a debit or credit memo, an adjustment to an invoice, or a payment. Valid values:
|
01 | ||||
CDD02 | 1/1 |
Required.Credit or debit flag code. Indicates if the amount is a credit or a debit. Valid values:
|
C | ||||
CDD03 | 1/20 |
Assigned identification. Alphanumeric characters assigned for differentiation within a transaction set. HDA specifies line item number. |
000010 | ||||
CDD04 | 1/15 |
Monetary amount of credit or debit adjustment. Note: source amount includes two digits implicit decimals(125.50 shown as 12550) - At least one of CDD04 or CDD07 is required |
12550 | ||||
CDD07 | 1/10 |
Quantity of supplier units to be credited or debited. May use a decimal to indicate a quantity variance, fractions or partials. - At least one of CDD04 or CDD07 is required |
25 | ||||
CDD08 | 2/2 |
Unit or Basis for Measurement Code. ![]()
Required if CDD07 is present. |
EA | ||||
CDD10 | 3/3 |
Code identifying pricing specification. Qualifiers are from consulted HDA and company guidelines. Valid values:
If either CDD10 or CDD11 is present, then the other is required. |
UCP | ||||
CDD11 | 1/17 |
Unit price. Price per unit of product, service, commodity, etc. If either CDD10 or CDD11 is present, then the other is required. |
1.25 | ||||
LIN | – | Item identification. | – | ||||
LIN02 | 2/2 |
Required.Code to qualify product identifier type. Valid values:
|
IN | ||||
LIN03 | 1/80 | Required.Product identifier value as qualified by LIN02. | 00002541789536 | ||||
LIN04 | 2/2 |
Code to qualify product identifier type. If either LIN04 or LIN05 is present, then the other is required Valid values:
|
UK | ||||
LIN05 | 1/80 |
Product identifier value as qualified by LIN04. If either LIN04 or LIN05 is present, then the other is required |
00002541789536 | ||||
SAC | – |
Service, promotion, allowance or charge information at line item details level. Used to request or identify a service, promotion, allowance, or charge and/or to specify the amount or percentage for the service, promotion, allowance, or charge |
– | ||||
SAC01 | 1/1 |
Required.Indicator that specifies the amount in SAC05 as an allowance or a charge. Valid values:
|
A | ||||
SAC02 | 4/4 |
Code representing type of credit or charge. Valid values:
|
A170 | ||||
SAC05 | 1/15 | Total amount for the service, promotion, allowance, or charge. Note: source amount includes two digits implicit decimals(125.50 shown as 12550) | 12550 | ||||
SAC09 | 2/2 |
Unit or Basis for Measurement Code. ![]()
Required if SAC10 is present. |
EA | ||||
SAC10 | 1/15 | Total number of units for credit or debit adjustment. - Required if SAC09 is present | 100 | ||||
SAC15 | 1/80 | Free form description. HDA: Used to further describe the adjustment, ie, may be used to explain a quantity difference. | Discounted | ||||
N9 | – | Extended reference information segment. Used to transmit identifying information specified by the reference identification qualifier. | – | ||||
N901 | 2/3 |
Required.Reference identification qualifier. Valid values:
|
LT | ||||
N902 | 1/80 |
Reference identifier. Reference information as specified by the reference identification qualifier in N901. If N901 = TD, N902 will map to any of the valid adjustment reason codes in CDD01, for an additiional reason code for adjustment. Map will not enforce validity of code. Required if N901 is valid. |
002621337 | ||||
N903 | 1/45 | Free form description. HDA: Used to further describe the adjustment, ie, may be used to explain a quantity difference. | Credit or debit adjustment | ||||
N904 | 8/8 | Date for reference identifier in date format YYYYMMDD. | 20241028 | ||||
DTM | – | DTM date segment at line item details level of credit or debit adjustment. | – | ||||
DTM01 | 3/3 |
Required.Date type at header level relevant for credit debit adjustment. Valid values:
|
011 | ||||
DTM02 | 8/8 | Processing date in date format YYYYMMDD - Required if DTM01 is valid. | 20241028 | ||||
DTM03 | 4/8 | Processing time in time format HHMMSS | 123422 | ||||
SE | – | Required.ST … SE transaction set trailer envelope. Child of GS group. Only one ST transaction expected. | – | ||||
SE01 | 1/10 | Required.Total count of segments in ST … SE transaction set including ST and SE segments. | 10 | ||||
SE02 | 4/9 | Required.Transaction set control number. | 0001 | ||||
GE | – | Required.GS … GE functional group trailer envelope. Child of ISA interchange. Only one GS group expected. | – | ||||
GE01 | 1/6 | Required.Number of transaction sets in functional group. | 5 | ||||
GE02 | 1/9 | Required.Functional group control number. | 619827 | ||||
IEA | – | Required.ISA … IEA interchange control trailer envelope. Only one interchange expected per transmission. | – | ||||
IEA01 | 1/5 | Required.Number of functional groups in interchange. | 1 | ||||
IEA02 | 9/9 | Required.Interchange control number | 0000000000619827 |

ISA*01*pnande1234*01*welcome123*01*777777606734412*01*888888404358877*240711*170
9*^*00501*000619827*0*T*:~
GS*CD*2222224043588*TRACELINK*20240807*170923*000619827*X*005010~
ST*812*0001~
BCD*20240807*0000458795*B*2458923*D*20240811**0085697458*20240811*0000458795*07*
74*CK*000045879501~
N9*BT*N9-002621999*BatchNumber*20240807~
ITD*02*2*.5*20240811*15*20240811*15*25*20240811*10*15*Sales Terms And
Conditions*05~
DTM*011*20240811*17092324~
SAC*A*A170*10*121*12525*1*.5*10*01*100*100*10*1234*1*Paracaetamol 20 MG~
N1*BT*Customer*1*BILL_TO_CUSTOMER~
N3*5th Cross*High Street Lane~
N4*Pune*MH*411057*IN~
PER*AJ*Kedar Urunkar*TE*9039943781~
PER*AJ*Kedar Urunkar*EM*kedar_pharma@abc.com~
N1*L8*HO_Customer*9*DUNS4-3333331013666~
N3*10th Cross Lane*Market Yard~
N4*Bangalore*KA*411088*IN~
PER*AJ*HO_Officer*TE*9039943782~
PER*AJ*HO_Officer*EM*headOffice_pharma@abc.com~
N1*QA*Pharmacy Customer*11*56889785~
N3*Royal Road*Yamuna Nagar~
N4*Pune*MH*496001*IN~
PER*AJ*pharmacy_Name*EM*pharmacy@QA1.com*TE*12345678901235~
PER*AJ*pharmacy_Name*TE*222222*EM*pharmacy@QA2.com~
N1*SU*Supplier*21*HIN-3333331013655~
N3*555 Neelan Road*suite 123~
N4*Sacramento*CA*95833*US~
PER*AJ*John Smith*TE*9039943784*EM*jsmith@manufac.com*~
N1*YE*PharmaSupplier_3PL*91*COMP-3333331013655~
N3*Sacramento*suite 123~
N4*Sacramento*CA*95833*US~
PER*AJ*JacobBarner*TE*12345888888267*EM*JB3PL@abc.com~
N1*XI*OriginalPharmaSupplier*92*CO-SITE-3333331013655~
N3*OrigPharmaSupp_Add_1*OrigPharmaSupp_Add_2~
N4*Sacramento*CA*95833*US~
PER*AJ*Peter Park*TE*123456789*EM*ppOrigSup@abc.com~
N1*RI*remitTo_Customer*UL*GLN-3333331013655~
N3*Remit_Add_1*Remit_Add_2~
N4*Sacramento*CA*95833*US~
PER*AJ*Alfred T*TE*123456789015438*EM*atRemit@abc.com~
N1*ST*shipTo_Customer*1*4547682202~
N3*Shipment_Address_1*Shipment_Addrss_2~
N4*Mumbai*MH*496771*IN~
PER*AJ*Ajay Mohanan*TE*12344453968*EM*ajayM@abc.com~
N1*DS*DistributionCust*1*3333331013655~
N3*Distrubitor_Add1*Distributor_Add2~
N4*Pune*MH*411057*IN~
PER*AJ*Chemist Lab*TE*1234567890*EM*chemistL@abc.com~
N1*DB*Distributor_Branch*1*45464212~
N3*Dist_Branch_Add1*Dist_Branch_Add2~
N4*Pune*MH*411057*IN~
PER*AJ*Apollo Pharmacy*TE*9876543211*EM*apolloPharmacy@abc.com~
CDD*01*C*000010*12550*N*DAM*25*EA*.5*UCP*1.25~
LIN*1*IN*Buyer*NH*559833663~
N9*LT*LOT-002621337*lot*20240807~
SAC*A*E063***12525****01*100*****Discounted_A~
DTM*036*20260711*170923~
SE*55*0001~
GE*1*000619827~
IEA*1*000619827~
Credit And Debit Adjustments (IDoc)
Buyers or sellers use Credit and debit adjustment transactions to ensure the accuracy of financial records and reconcile discrepancies between invoices, payments, and inventory.
Contact your TraceLink Services representative for more information about integrating with this message.
- Message Type: MPC_CREDIT_DEBIT_ADJUSTMENT
- X12 Format: PEXR2002
- Transform Names:
- IDoc (outbound)
- B2B_IDoc_CREADV_PEXR2002_CreditDebitAdjustment_OB_V1
- IDoc (outbound)