JSON Format


API Access


To access the API, use the following URL: https://billingorchardapi.com/webservice/ChooseService.php

JSON Format

The five functions described below expect a single post variable in json format. The CheckOut,Add,

and Edit functions have an additional "object" key that contains data necessary for the function to

accomplish its task, shown below. Please reference the "Json Fields for Add and Edit"for the proper

key names.

 

 

{
"apikey":"data",
"service":"ViewUsers",
"sig":"HMAC Signature",
"timestamp":"20120802 15:47",
	"object":{
	"key":"data",
	"key2":"data2"
	}
}

 

 

HMAC-SHA256 Signature

The HMAC Signature input is generated from appending the apikey, service, and timestamp values together. (e.g. $apikey.$service.$timestamp) The timestamp shall consist of the time the data is called in the format of "hh:mm" inGreenwich Mean Time. If the request is five minutes old when it gets processed by the server or the signature is incorrect, it will return a 401 not authorized. The encryption algorithm is currently set as sha256. The key is currently set as "BillingOrchard2012".

The signature is encoded into a base64 string that complies with established standards.

Checkout function

Procedure

  1. Call ChooseService.php
  2. Json Keys
    1. service
      • CheckOut
    2. apikey
    3. sig
    4. object
      • "AmountPaid":"45.45"
      • BilledMisc data - no invoice number
      • "ClientID" or client information
  3. Expected Output
    1. Wrong or invalid apikey
      • "Message":"Error with apikey"
    2. Error with selecting service
      • "Message":"Error selecting service"
    3. Successful and all IDs are returned
      • "Message":"success"
      • "ClientID":""
      • "Invoice":""
      • "Fee":""
      • "Recurring":""
      • "Payment":""
    4. Error adding or editing client
      • "Message":"Error with Creating Client"
    5. Error with adding or editing client vault account
      • "Message":"NMI Error with Client"
      • "Response_code":200|300|etc
    6. Error creating Invoice
      • "Message":"Error with Creating Invoice"
      • "ClientID":""
    7. Error creating BilledMisc Fee
      • "Message":"Error with Creating Fee"
      • "ClientID":""
      • "Invoice":""
    8. Error creating RecurringBilling
      • "Message":"Error with Creating Recurring"
      • "ClientID":""
      • "Invoice":""
      • "Fee":""
    9. Error processing payment
      • "Message":"NMI Error with Processing Payment"
      • "Response_code":200|300|etc
      • "ClientID":""
      • "Invoice":""
      • "Fee":""
      • "Recurring":""
    10. Error creating payment entry in billingorchard database
      • "Message":"Error with Creating Payment Record but it has been processed"
      • "ClientID":""
      • "Invoice":""
      • "Fee":""
      • "Recurring":""

View function

Procedure

  1. Call ChooseService.php
  2. Json Keys
    1. service
      • ViewUsers
      • ViewClients
      • ViewHourlyServices
      • ViewInvoices
      • ViewPayments
      • ViewBilledMisc
      • ViewBilledHourly
      • ViewSubscribers
      • ViewRecurringBilling
    2. apikey
    3. sig
    4. ID
      • optional field that expects the id number of the item, not passing an id will return all items associated with the apikey
  3. Expected Output
    1. Wrong or invalid apikey
      • "Message":"Error with apikey"
    2. Error with selecting service
      • "Message":"Error selecting service"
    3. Outputs the selected data

Delete function

Procedure

  1. Call ChooseService.php
  2. Json Keys
    1. service
      • DeleteClients
      • DeleteHourlyServices
      • DeleteInvoices
      • DeleteBilledMisc
      • DeleteBilledHourly
      • DeleteMiscItems
      • DeleteRecurringBilling
    2. apikey
    3. sig
    4. ID
      • ID used to identify item being deleted
  3. Expected Output
    1. Wrong or invalid apikey
      • "Message":"Error with apikey"
    2. Error with selecting service
      • "Message":"Error selecting service"
    3. Json output with key "Message"
      • "Message":"success"
      • "Message":"DeleteFail"

Edit function

Procedure

  1. Call ChooseService.php
  2. Json Keys
    1. service
      • UpdateClients
      • UpdateHourlyServices
      • UpdateInvoices
      • UpdateBilledMisc
      • UpdateBilledHourly
      • UpdateMiscItems
      • UpdateSubscribers
      • UpdateRecurringBilling
    2. apikey
    3. sig
    4. object
  3. Expected Output
    1. Wrong or invalid apikey
      • "Message":"Error with apikey"
    2. Error with selecting service
      • "Message":"Error selecting service"
    3. Json output with key "Message"
      • "Message":"success"
      • "Message":"UpdateFail"

Add function

Procedure

  1. Call ChooseService.php
  2. Json Keys
    1. service
      • AddClients
      • AddHourlyServices
      • AddInvoices
      • AddPayments
      • AddBilledMisc
      • AddBilledHourly
      • AddMiscItems
      • AddSubscribers
      • AddRecurringBilling
    2. apikey
    3. sig
    4. object
  3. Expected Output
    1. Wrong or invalid apikey
      • "Message":"Error with apikey"
    2. Error with selecting service
      • "Message":"Error selecting service"
    3. Output with "Message" and id of newly added item
      • "Message":"success"
      • "ID":"1234"
    4. Output with "Message" and id of newly added item but submitting to gateway resulted in error
      • "Message":"success"
      • "ID":"1234"
      • "Response_code":"300"
    5. Add Failure
      • "Message":"AddFail"