Endpoints

Customer Payment

  • key Your private PayJoy partner API key. This parameter is required.
  • deviceTag DeviceTag of device that credit will be applied to. This parameter is optional.
  • financeOrderId PayJoy assigned contract number associated with the device that credit will be applied to. This parameter is optional.
  • partnerContractId Contract number assigned by the partner associated with the device that credit will be applied to. This parameter is optional.
  • amount The payment amount. This parameter is required.
  • currency ISO currency code. This parameter is required.
  • clientData This string parameter can be used by the client for whatever purpose it chooses, or it can be omitted. It is anticipated that the client will use this string to identify a record in the client’s database that corresponds to this payment, but this is not required. This paramter is optional, and has a 64 character maximum.

Note

While deviceTag, financeOrderId, and partnerContractId are individually optional, at least one must be present. It is an error if more than one is present.

Example Query:

curl 'https://api.payjoy.com/financepartner/v1/customer-payment.php?key=<apikey>&deviceTag=<deviceTag>&amount=<amount>&currency=<currency>&clientData=<clientData>'

The JSON return will have a valid key that will have the value true or false. If valid is true, the response will contain a payment element with the fields listed below.

{
  "valid": true,
  "payment": {
    "paymentId": "<integer, guaranteed to be unique>",
    "time": "<unix timestamp when payment was recorded>",
    "deviceTag": "<deviceTag of the device that received credit for the payment>",
    "remainingBalance": "<amount the customer needs to pay before the device is fully paid off>",
    "currency": "<currency of the remaining balance>",
    "nextPayment": "<unix timestamp when the device's lock will activate if payment is not received>"
  }
}

If the request fails, valid will be false:

{
   "valid":false,
   "message":"<string; see Error Messages>"
}
Error Message HTTP Response Code
Authentication failed 403
Missing key 400
Invalid key 400
Missing required parameter 400
No matching device found 400
Multiple identifiers passed. Only 1 allowed 400
Invalid currency for specified device. Valid currency is: <currency> 400
Invalid amount for specified device. Valid amounts: <list of valid amounts> 400
System Error 500