This endpoint allows you to initiate a refund of a Payment Request. The refund will be completed asynchronously.
typeoptional enumThe 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.
discountoptional bignumberDiscount 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.pricerequired bignumberThe total price in cents for the line item (eg.price = product price * qty - discounts + tax). EitherpriceorunitPriceis required; if both are supplied,pricetakes priority.
merchantConfigIdoptional stringThe Merchant Config id of the refunding merchant when refunding afarmlands.nzd.*payment.valuerequired monetaryThe canonical value of the Payment Request. Must be less than 100000000 and positive.
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.LINE_ITEMS_SUM_CHECK_FAILEDThe sum value of the line items did not equal the value of the refund.
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. If you want to perfom additional refunds then anexternalRefis required.CONFIRMATION_NOT_FOUNDThe confirmationIdempotencyKey does not match a Confirmation on the Payment Request.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.INVALID_AMOUNTThe refund requested is greater than the refundable amount.NOT_PAIDThe Payment Request has not been paid.PARTIAL_REFUNDS_NOT_ALLOWEDThe Asset does not support partial refunds.PRE_AUTH_PENDINGThe Pre Auth Payment Request has yet to be authorized.REFUND_DECLINEDThe refund parameters were valid but refund was declined because additional business rules were violated.REFUND_NOT_SUPPORTEDThe Asset type does not support refunds.REFUND_WINDOW_EXCEEDEDThe time since the payment exceeds the window of time a payment request can be refunded in.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.
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/refund \-H 'content-type: application/json' \-H 'x-api-key: <TOKEN>' \-d '{ "externalRef": "e8df06e2-13a5-48b4-b670-3fd6d815fe0a", "lineItems": [ { "discount": "400", "name": "Hard Hat", "price": "4000", "qty": "1", "sku": "GH1234", "tax": "15" } ], "value": { "amount": "3600", "currency": "NZD" }}'{ "activityNumber": "3", "assetType": "centrapay.nzd.main", "createdAt": "2021-06-12T01:17:00.000Z", "createdBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "invoiceRef": "sy8CRmo3sp3ArOpnfmb423", "lineItems": [ { "discount": "400", "name": "Hard Hat", "price": "4000", "qty": "1", "sku": "GH1234", "tax": "15" } ], "merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9", "merchantConfigId": "mc_5ee168e8597be5002af7b454", "merchantId": "5ee0c486308f590260d9a07f", "merchantName": "Centrapay Café", "paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5-015", "type": "refund", "value": { "amount": "3600", "currency": "NZD" }}{ "error": "Bad Request", "message": "LINE_ITEMS_SUM_CHECK_FAILED", "statusCode": 400}{ "error": "Unauthorized", "message": "Missing authentication", "statusCode": 401}{ "error": "Forbidden", "message": "NOT_PAID", "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}