PAYMENTS
SIMPLIFIED


Offer all the payment features your
customers want with a fast integration
that limits your PCI scope.

GET STARTED

API Base URLs

  • Production Server

    For processing live transactions

    https://api.payjunction.com

  • Test Server

    For development

    https://api.payjunctionlabs.com

Most Commonly Referred to Articles

POST /invoices

Create a new invoice and send an email to the customer.

requirednameformatdescription

*

amountBaseMoney, Format: X.XX
Ex: 1000.00
Base amount to charge.

 

attachmentIdValid file IDFile associated with the invoice. Available for download on PayJunction's hosted checkout form.

*

customerEmailMax Length 255

Email address the Invoice will be sent to.

Required if notification type is not set, EMAIL, or BOTH.

 

customerFirstNameMax Length 16The customer's first name.

 

customerIdentifierMax Length 64Your own identifier to associate with the customer.

 

customerLastNameMax Length 32The customer's last name.

*

customerPhone10-Digit Long Code (USA only)

Phone number the Invoice will be texted to.

Required if notification type is TEXT or BOTH.

 

invoiceNumberMax Length 32An invoice number.

 

messageMax Length 2048Message to the customer displayed on PayJunction's hosted checkout form.

 

metadata[externalId]

Text, Valid ASCII

Max Length 36

Optional identifier copied from the invoice to the transaction at creation time.

 

metadata[externalData]

Text, Valid ASCII

Max Length 36

Optional status or value copied to the transaction at creation time.

 

notificationTypeEMAIL | TEXT | BOTH | NONEDefaults to "EMAIL" if not set.

*

terminalIdValid Terminal IDAlways specify a terminalId to ensure consistent behavior. If omitted, the default terminal assigned to the API Credential will be used (if set and on). If no default is configured or the terminal is off, the request will fail.

To attach a PDF file to the Invoice you must first save it to the Invoice system using POST /invoices/files

Invoices can be voided after creation but they cannot be edited. If an Invoice must be corrected, the original must be voided and a new Invoice created.

Example Request

curl -X POST https://api.payjunction.com/invoices \
  -u "YOUR_USER:YOUR_PASSWORD" \
  -H "Accept: application/json" \
  -H "X-PJ-Application-Key: YOUR_PRODUCTION_APP_KEY" \
  -d amountBase=1.99 \
  -d customerEmail=jdoe@payjunction.com \
  -d customerPhone=8006010230 \
  -d customerFirstName=John \
  -d customerLastName=Doe \
  -d invoiceNumber="TO-123456" \
  -d message="Invoice for takeout order #123456" \
  -d "metadata[externalId]=e1ad3185-6f93-458c-9df7-3d88edb4953e" \
  -d "metadata[externalData]=UNRECONCILED" \
  -d "transactionMetadata[externalId]=6c8370a2-2559-4cc1-9faf-04a0b4d2ff52" \
  -d "transactionMetadata[externalData]=UNRECONCILED" \
  -d notificationType="BOTH" \
  -d "terminalId=1"

Example Response

{
  "amountBase" : "1.99",
  "created" : "2020-11-24T01:19:23Z",
  "customerEmail" : "jdoe@payjunction.com",
  "customerFirstName" : "John",
  "customerIdentifier" : "customer-id",
  "customerLastName" : "Doe",
  "hostedInvoiceUrl" : "https://www.payjunction.com/trinity/invoice#/e321790e-c030-4501-aa99-09e35158c1a6",
  "invoiceId" : "e321790e-c030-4501-aa99-09e35158c1a6",
  "invoiceNumber" : "TO-123456",
  "lastModified" : "2020-11-24T01:19:23Z",
  "message" : "Invoice for takeout order #123456",
  "status" : "OPEN",
  "terminalId" : 1,
  "metadata" : {
    "externalId" : "e1ad3185-6f93-458c-9df7-3d88edb4953e",
    "externalData" : "UNRECONCILED"
  },
  "transactionMetadata" : {
    "externalId" : "6c8370a2-2559-4cc1-9faf-04a0b4d2ff52",
    "externalData" : "UNRECONCILED"
  }
}