Voiding a payment request will cancel the request and trigger any refunds if necessary.
A Payment Activity records a transaction that has happened on a Payment Request.
Payment Activities are created when a Payment Request has been created, paid, refunded, cancelled, or expired.
CANCELLED_BY_MERCHANTThe merchant cancelled the Payment Request by calling the cancel or void endpoint.CANCELLED_BY_PATRONThe patron cancelled the transaction.DECLINED_BY_MERCHANTThe payment was declined by the merchant during approval steps.DECLINED_BY_PATRONThe payment was declined by the patron during approval steps.INACTIVE_ASSETThe asset used to pay the Payment Request is inactive.NO_AVAILABLE_PAYMENT_OPTIONSNo payment options match the requested payment parameters.PATRON_CODE_EXPIREDThe patron code on the Payment Request has expired.PATRON_CODE_INVALIDThe patron code on the Payment Request was invalid.PAYMENT_DECLINEDThe payment parameters were valid but payment was declined because additional payment restrictions were violated. For example, asset not active, asset overdrawn, quota exceeded or line item category restrictions.PAYMENT_FAILEDThe Payment Request failed for an unknown reason.PAYMENT_REQUEST_EXPIREDThe Payment Request has expired.
typeenumThe classification type. See GS1 Global Product Classification. WhenGS1is used as the product classification type then the product code should be the GPC product brick identifier.
discountbignumberDiscount amount in cents (tax exclusive). A discount that applies to multiple Line Items may be represented as a separate Line Item with a negative amount.pricebignumberThe total price in cents for the line item (eg.price = product price * qty - discounts + tax). EitherpriceorunitPriceis required; if both are supplied,pricetakes priority.
accept-conditionA Payment Condition was accepted.cancellationPayment Request was cancelled by the merchant or the shopper.confirmationFunds on a Pre Auth have been drawn down on.decline-conditionA Payment Condition was declined.expiryPayment Request wasn't paid before time out.paidPayment Request was paid.paymentA payment was made towards the Payment Request.preAuthRequestPayment Request was created with thepreAuthflag set to "true".refundFunds were returned to the shopper.releasePre Auth has been finalised and any remaining funds from Authorization have been returned.requestPayment Request was created.
errorstringThe name of the HTTP status. AlwaysBad Request.messageenumThe error code, or for a 400 a description of what's wrong with the request.Bad RequestThe request is malformed or missing required fields. The message says what's wrong, egamount is required. See 400 Malformed Request.
statusCodeintegerThe HTTP status code. Always400.
errorstringThe name of the HTTP status. AlwaysUnauthorized.messageenumThe error code, or for a 400 a description of what's wrong with the request.Missing authenticationAPI key or JWT is missing, expired or invalid. See Auth.
statusCodeintegerThe HTTP status code. Always401.
errorstringThe name of the HTTP status. AlwaysForbidden.messageenumThe error code, or for a 400 a description of what's wrong with the request.ALREADY_REFUNDEDThe Payment Request already been refunded.ForbiddenThe resource doesn't exist, or your user or API key doesn't have permission to access it. See 403 Forbidden.INACTIVE_ASSETThe Asset is not refundable. It may have been disabled, expired, or already refunded.PRE_AUTH_ALREADY_CONFIRMEDThe Pre Auth Payment Request already has confirmations. Use Refund endpoint to reverse the transaction.REFUND_NOT_SUPPORTEDThe Asset type does not support refunds.REPEAT_REFERENCEA refund has already been requested with the same external reference. Refunding the payment request twice with the same external reference is not allowed. If the amount of the refund is the same we assume it is a repeat request and return 200.REQUEST_EXPIREDThe Payment Request has expired.VOID_WINDOW_EXCEEDEDThe void window is closed 24 hours after the Payment RequestcreatedAt. After the void window has closed if the Payment Request is paid, use Refund endpoint to reverse the payment.
statusCodeintegerThe HTTP status code. Always403.
errorstringThe name of the HTTP status. AlwaysNot Found.messageenumThe error code, or for a 400 a description of what's wrong with the request.Not FoundThe route doesn't exist. Check the URL and HTTP method against the examples. See 404 Route Not Found.
statusCodeintegerThe HTTP status code. Always404.
errorstringThe name of the HTTP status. AlwaysToo Many Requests.messageenumThe error code, or for a 400 a description of what's wrong with the request.RATE_LIMIT_EXCEEDEDCentrapay API rate limits have been exceeded. See Rate Limits.
statusCodeintegerThe HTTP status code. Always429.
errorstringThe name of the HTTP status. AlwaysInternal Server Error.messageenumThe error code, or for a 400 a description of what's wrong with the request.An internal server error occurredSomething went wrong on our end. Retrying should solve the issue. See 5xx Server Error.
statusCodeintegerThe HTTP status code. Always500.
curl -X POST https://service.centrapay.com/api/payment-requests/MhocUmpxxmgdHjr7DgKoKw/void \-H 'x-api-key: <TOKEN>'{ "activityNumber": "3", "assetType": "centrapay.nzd.main", "createdAt": "2021-06-08T04:04:27.426Z", "createdBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9", "merchantConfigId": "5efbe2fb96c08357bb2b9242", "merchantId": "26d3Cp3rJmbMHnuNJmks2N", "merchantName": "Centrapay Café", "paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5-032", "type": "refund", "value": { "amount": "1000", "currency": "NZD" }}{ "error": "Bad Request", "message": "amount is required", "statusCode": 400}{ "error": "Unauthorized", "message": "Missing authentication", "statusCode": 401}{ "error": "Forbidden", "message": "VOID_WINDOW_EXCEEDED", "statusCode": 403}{ "error": "Not Found", "message": "Not Found", "statusCode": 404}{ "error": "Too Many Requests", "message": "RATE_LIMIT_EXCEEDED", "statusCode": 429}{ "error": "Internal Server Error", "message": "An internal server error occurred", "statusCode": 500}