SaleCreditNote

SaleCreditNote

The SaleCreditNote resource allows adding credit note for sale task. This is how you call it:

The full range of URIs and HTTP Verbs supported are:

Operation                                                         

HTTP Action                                                                                                                                                                                   

Create new Credit Note                                                    

POST /SaleCreditNote                                                                                                                                                                                   

 

Available Fields for SaleCreditNote:

Property                                       

Type                                      

Length                  

Required                      

Notes                                                                                                        

TaskID                                       

Guid                                      

 

Yes                      

Sale task identifier                                                                                                        

CreditNoteDate                                       

Date                                      

 

 

Date of credit note. Default is current UTC date                                                                                                        

Lines                                       

Array of CreditNoteLine                                      

1                  

Yes                      

At least one line must be provided. Credit note lines should correspond to invoice lines in sale                                                                                                        

AdditionalCharges                                       

Array of CreditNoteAdditionalCharge                                      

 

 

Credit Note Additional Charges, see below                                                                                                        

Refunds                                       

Array of Refund                                      

 

 

Refunds. See description below                                                                                                        

Restock                                       

Array of RestockLine                                      

 

 

Restock lines. See description below. Any line in restock must be present in Lines                                                                                                        

Available Fields for CreditNoteLine:

Property                                    

Type                      

Length                  

Required                      

Notes                                                                                                                            

SKU                                    

String                      

50                  

Yes                      

Product SKU referenced by this Line                                                                                                                            

Quantity                                    

Decimal with up to 4 decimal places                      

 

Yes                      

 

Price                                    

Decimal with up to 4 decimal places                      

 

Yes                      

Price per unit in Customer currency                                                                                                                            

Discount                                    

Decimal with up to 2 decimal places                      

 

 

Discount. Value between 0 and 100. For free items discount is 100. Default value is 0.                                                                                                                            

Tax                                    

Decimal with up to 4 decimal places                      

 

Yes                      

Tax amount for this line                                                                                                                            

Total                                    

Decimal with up to 2 decimal places                      

 

Yes                      

Line Total. Total = ROUNDUP(ROUNDUP(Price * (100 - Discount)/100, 4)*Quantity, 2)

Comment                                    

String                      

256                  

 

 

Available Fields for CreditNoteAdditionalCharge:                                                                                                                            

Property                                    

Type                      

Length                  

Required                      

Notes                                                                                                                            

Description                                    

String                      

256                  

Yes                      

Additional charge description                                                                                                                            

Amount                                    

Decimal with up to 4 decimal places                      

 

Yes                      

Charge amount in Customer currency                                                                                                                            

Discount                                    

Decimal with up to 2 decimal places                      

 

Yes                      

Discount. Value between 0 and 100. For free items discount is 100                                                                                                                            

Tax                                    

Decimal with up to 4 decimal places                      

 

Yes                      

Calculated Credit Note Tax value in Customer currency                                                                                                                            

Total                                    

Decimal with up to 2 decimal places                      

 

Yes                      

Additional Charge line for Credit Note total in Customer currency. Can include Tax if Tax Rule for Sale is Tax Inclusive                                                                                                                            

TaxRule                                    

String                      

50                  

No*                      

Credit Note Additional Charge Line Tax Rule name.                                                                                                                             

Required if ‘Description’ not matches with Invoice line, otherwise TaxRule from InvoiceLine will be used                                                                                                                            

Account                                    

String                      

50                  

No*                      

Revenue Account code                                                                                                                            

Required if ‘Description’ not matches with Invoice line, otherwise Account from InvoiceLine will be used                                                                                                                            

Available Fields for Refund:

Property                                    

Type                      

Length                  

Required                      

Notes                                                                                                                            

Reference                                    

String                      

50                  

 

Payment reference number                                                                                                                            

Amount                                    

Money                      

 

Yes                      

Payment amount in customer currency                                                                                                                            

DatePaid                                    

Date                      

 

Yes                      

Date when payment has been made                                                                                                                            

Account                                    

String                      

50                  

Yes                      

Account Code of the bank/payment account                                                                                                                            

CurrencyRate                                    

Decimal with up to 5 decimal places                      

 

Yes                      

Currency Conversion rate expressed as number of Base currency units for one Customer currency unit.                                                                                                                            

Available Fields for RestockLine:

Property                                    

Type                      

Length                  

Required                      

Notes                                                                                                                            

SKU                                    

String                      

50                  

Yes                      

Product SKU referenced by this Line                                                                                                                            

Location                                    

String                      

256                  

Yes                      

Location where to restock the product. Bin should be referenced by “Location: Bin” format                                                                                                                            

Quantity                                    

Decimal with up to 4 decimal places                      

 

Yes                      

Cannot exceed picked quantity and credited quantity                                                                                                                            

Operation description

To create new Credit Note you need to send POST request to SaleCreditNote endpoint with SaleCreditNote structure (see above) as payload.

Note

To successfully create credit note you need to check if your sale task’s invoice and shipment stage are AUTHORISED, otherwise you will receive error.

Sample of payload

POST /SaleCreditNote

{
"TaskID": "91f129f3-5ce4-4e65-845f-ef656c9b84c6",

"CreditNoteDate": "2015/01/01",
"Lines": [
{
"SKU": "TTRPS",
"Quantity": 20,
"Price": 89,
"Discount": 0,
"Tax": 0,
"Total": 89,
}
],
"Refunds": [
{
"Account": "713",
"DatePaid": "2015/01/01",
"Amount": 890,
"CurrencyRate": 1
}
],
"Restock": [
{
"SKU": "TTRPS",
"Location": "Main Warehouse",
"Quantity": 10
}
]
}

Return value

In case if no errors occurred you will receive response with Sale structure for provided SaleTask, otherwise you will receive response with error list, like this:

[{
“ErrorCode”:400,
“Exception”:”Error explanation will be here”
},
{
“ErrorCode”:400,
“Exception”:”Error explanation will be here”
}]

Was this article helpful?

Have more questions? Submit a request