Create Credit

This function allows you to create a credit on a specific customer for a specific amount.

Request Parameters

referenceStringThe text reference that is added to the credit. [Max Length: 500 characters]Optional
effectiveTimestampDateTimeThe effective timestamp of this creditYes
customerIdIntegerThis is the Fusebill Customer Id of the customer the credit will apply against.Yes
amountDecimalThis is the amount of the credit.Yes
creditAllocationsList of objects. Definition belowThis is an optional list of credit allocations which tells Fusebill how to split the value of this credit over many invoices.Optional

Credit Allocations Resource Properties

invoiceIdNumberThis is the Invoice ID for the Invoice this payment allocation applies against.
amountNumberThis is the dollar amount to apply against the above invoice.
curl -X POST "" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{customerId:{customerId},reference:'this is a test credit',amount:10,effectiveTimeStamp:'2017-01-16T10:00:00'}"
//Json Payload
string jsonData = "{customerId:{customerId},reference:'this is a test credit',amount:10,effectiveTimeStamp:'2017-01-16T10:00:00'}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic " + apiKey);
//Set request method
request.Method = "POST";
//Add the json data to request
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
//Perform the request
var httpResponse = (HttpWebResponse)request.GetResponse();
//Record the response from our request
var result = "";
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
  result = streamReader.ReadToEnd();
#Import library JSON
import json
#Import library Requests
import requests
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in a dictionary to the Payload parameter
payload = {"customerId":{id},"reference":'this is a test credit',"amount":10,"effectiveTimeStamp":'2017-02-10T10:00:00'}
#Pass in your URI, Payload and Headers
r ='', data=json.dumps(payload), headers=headers)
  "reference": "Returned item discount",
  "customerId": 655643,
  "amount": 2,
  "effectiveTimestamp": "2020-01-01",
  "creditAllocations": [
      "invoiceId": 566935,
      "amount": 2
   "reference":"this is a test credit",


    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
            "Key": "Api Error",
            "Value": "The sum of allocations 3.0 cannot exceed the credit amount 2.0"