These solutions are available in US and Canada only. For all other regions, please contact us for support.
Update certain fields of a previously completed sales transaction—such as the transaction amount, gratuity, or invoice number—without having to void or refund the sale. This feature is useful for correcting errors, adding tips, or amending invoices after the original sale has been processed.
To update the details of a credit sale, send a PATCH request to the relevant endpoint. You can update the following details:
In order to perform an Update you can use the ID (creditauth_id) assigned by the REST API which was returned in the transaction response. Alternatively, you can use the Reference ID (reference_id) you set in the transaction request. The tables below outline the URL to use in either case.
| Environment | HTTP Method | URL |
|---|---|---|
| Sandbox | PATCH | https://api.pit.paygateway.com/transactions/ |
| Production | PATCH | https://api.paygateway.com/transactions/ |
| Transaction Type | URL path |
|---|---|
| Sale | {base url}/creditsales/{creditsale_id} or {base url}/creditsales/reference_id/{reference_id} |
Important: For authentication, you must include the required headers in each request. For more information, please refer to Authenticating Your Requests.
Content-Type: application/json
Authorization: AuthToken {AuthTokenV2}
X-GP-Request-Id: {request_id}
X-GP-Version: 2021-04-08
X-GP-Api-Key: {API Key}
X-GP-Source-App-Name: {Name of integrating application}
{
"payment": {
"amount": "23.09",
"gratuity_amount": "10.00",
"invoice_number": "239087",
"purchase_order": {
"destination_postal_code": "84042",
"po_number": "2343445",
"tax_amount": "20.01"
}
},
"transaction": {
"processing_indicators": {
"generate_receipt": true
},
"terminal": {
"certification_id": "OEXXXX.0",
"pos_type": "MOBILE"
}
},
"receipt": {
"signature_image": "iVBORw0KGgoAAAANSUhEUgAAAEAAAAAXBAMAAABJzFSiAAAAG1BMVEUAAAD////f39+/v79fX19/f38fHx8/Pz+fn5+3RGHDAAABPklEQVQokXWSu0/DMBDGDUoj",
"signature_format": "PNG"
}
}{
"creditsale_id": "000008639902",
"reference_id": "XAZR863990",
"status": "approved",
"approval_code": "ADB123",
"card": {
"masked_card_number": "XXXXXXXXXXX5538",
"expiry_month": "03",
"expiry_year": "35",
"type": "visa"
},
"payment": {
"amount": "23.09",
"gratuity_amount": "10.00",
"invoice_number": "239087",
"type": "credit",
"purchase_order": {
"po_number": "2343445",
"tax_amount": "20.01"
}
},
"transaction": {
"batch_amount": "12.09",
"batch_number": "001333"
},
"receipt": {
"id": "72845",
"text": {
"customer_receipt": "\\nBatch # 000161\\nTrans ID 000000141687\\nOrder ID PAYAPIa0155b35-420c-\\n 46a5-9b0a-f01ac0004a\\n 76\\nReceipt # 123456890\\nTrans Type Return\\nClerk ID Al090\\nDate/Time 2018-12-10 21:56:16\\nCard Type Visa\\nCard Number XXXXXXXXXXXX2222\\nEntry Legend MAG STRIPE\\nEntry Method CONTACTLESS\\nApproval Code 577279\\n\\nTotal Amount USD$132.00\\n\\n Approved - Thank You\\n\\n X____________________________________\\n Signature: Joe Doe\\n\\n ****Customer Copy****\\n Retain this copy for statement\\n verification",
"merchant_receipt": "\\nBatch # 000161\\nTrans ID 000000141687\\nOrder ID PAYAPIa0155b35-420c-\\n 46a5-9b0a-f01ac0004a\\n 76\\nReceipt # 123456890\\nTrans Type Return\\nClerk ID Al090\\nDate/Time 2018-12-10 21:56:16\\nCard Type Visa\\nCard Number XXXXXXXXXXXX2222\\nEntry Legend MAG STRIPE\\nEntry Method CONTACTLESS\\nApproval Code 577279\\n\\nTotal Amount USD$132.00\\n\\n Approved - Thank You\\n\\n X____________________________________\\n Signature: Joe Doe\\n\\n ****Merchant Copy****"
},
"attributes": {
"authorization_agreement": "I agree to pay above total amount according to card issuer agreement",
"call_issuer": "CALL ISSUER",
"copy_label_customer": "****Customer Copy**** Retain this copy for statement verification",
"copy_label_merchant": "MERCHANT COPY",
"merchant_address": "2578 West 600 North",
"merchant_footer": "Thank you. Come again.",
"merchant_header": "ABC Grocery",
"merchant_name": "ABC Stores",
"merchant_phone": "901-492-7269",
"merchant_policy": "Generally, merchandise purchased in store or online can be returned or exchanged within ninety (90) days of purchase with or without a receipt",
"verbiage": "Approved - Thank You"
},
"labeled_attributes": {
"amount": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"approval_code": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"authorization_response_code": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"avs_response_code": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"batch_number": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"card_balance": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"card_type": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"cardsecurity_response_code": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"clerk_id": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"entry_legend": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"entry_method": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"gratuity_amount": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"masked_card_number": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"merchant_id": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"original_auth_code": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"payment_type": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"number": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"reference_id": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"subtotal_amount": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"total_amount": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"transaction_datetime": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"transaction_id": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"transaction_type": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"validation_code": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"application_cryptogram": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"application_identifier": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"application_label": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"application_preferred_name": {
"label": "Total Amount",
"value": "$99.45 USD"
},
"application_transaction_counter": {
"label": "Total Amount",
"value": "$99.45 USD"
}
}
},
"links": [
{
"creditsale_id": [
{
"href": "https://api.paygateway.com/cnp-payments/sales/000000106821",
"relation": "self",
"method": "POST",
"description": "Use this endpoint to retrieve a previous sales transaction using reference id."
}
],
"reference_id": [
{
"href": "https://api.paygateway.com/cnp-payments/sales/000000106821",
"relation": "self",
"method": "POST",
"description": "Use this endpoint to retrieve a previous sales transaction using reference id."
}
]
}
]
}