Update an Invoice
Only include the parameters you want to update. All other values will remain unchanged.
Parameters
Other Fields
| required | name | format | description | when |
|---|---|---|---|---|
| metadata[externalId] | Text, Valid ASCII Max Length 36 | Optional identifier that can be used to link a transaction to the corresponding record in your system for reconciliation and tracking. | Anytime | |
| metadata[externalData] | Text, Valid ASCII Max Length 36 | Optional status/value field for storing additional system context, like reconciliation state, on a transaction. | Anytime | |
| transactionMetadata[externalId] | Text, Valid ASCII Max Length 36 | Optional identifier that is copied from the invoice to the transaction at the time the transaction is created. This value is a one-time snapshot. Updates to the invoice do not affect the transaction. The copied value is stored on the transaction under metadata[externalId]. | Anytime | |
| transactionMetadata[externalData] | Text, Valid ASCII Max Length 36 | Optional status/value field copied from the invoice to the transaction at creation time. This value is a one-time snapshot and can diverge later. The copied value is stored on the transaction under metadata[externalData]. | Anytime |
Example Request
curl -X PUT -u "YOUR_USER:YOUR_PASSWORD" -H "Accept: application/json" -H "X-PJ-Application-Key: YOUR_PRODUCTION_APP_KEY" \
-d "metadata[externalId]=4307dbc5-92a1-4125-bada-ffe534bc4b17" \
-d "metadata[externalData]=RECONCILED" \
-d "transactionMetadata[externalId]=5c4c9423-771b-4fc1-826e-c73353f3b019" \
-d "transactionMetadata[externalData]=RECONCILED" \
"https://api.payjunctionlabs.com/invoices/ba03b5e1-a7ae-42c9-bade-ae2611494c98"Example Response
{
"amountBase" : "1.00",
"amountTotal" : "1.00",
"created" : "2025-12-15T20:09:15Z",
"customerEmail" : "justinthyme@payjunction.com",
"hostedInvoiceUrl" : "https://www.payjunctionlabs.com/trinity/invoice#/EXzXsAEBTi6m1GGQGSohfmn2QZ",
"invoiceId" : "ba03b5e1-a7ae-42c9-bade-ae2611494c98",
"lastModified" : "2025-12-15T20:10:25Z",
"status" : "OPEN",
"terminalId" : 10000,
"metadata" : {
"externalId" : "4307dbc5-92a1-4125-bada-ffe534bc4b17",
"externalData" : "RECONCILED"
},
"transactionMetadata" : {
"externalId" : "5c4c9423-771b-4fc1-826e-c73353f3b019",
"externalData" : "RECONCILED"
}
}