Payment Requests
Payment Requests represent the intention for a merchant to receive payment for goods and services. Payment Requests define the amount to be paid and the Asset Types that are acceptable for payment.
A Payment Request is shared with, and paid by, a patron. The Payment Flows Guide has more details regarding negotiation of Payment Requests.
Payment Requests have the following statuses:
new: after being created.paid: after being paid with one or more transactions.cancelled: after being cancelled or voided by the merchant.expired: after expiry time is reached without being paid or cancelled.
Payment requests can also be refunded for a short period of time after being paid.
Payment request state transitions can be notified to webhooks.
Payment Request Model
Attributes
id
stringshortCode
stringurl
stringvalue
monetarypaymentOptions
arraymerchantId
stringmerchantName
stringconfigId
stringstatus
stringliveness
stringcreatedAt
stringupdatedAt
stringexpiresAt
stringmerchantConditions
arrayremainingAmount
bignumberpatronCodeId
stringbarcode
stringbarcodeType
stringcollectionId
stringexpirySeconds
integerlineItems
arraypurchaseOrderRef
stringinvoiceRef
stringredirectCancelUrl
stringexperimentalredirectPaidUrl
stringexperimentalexternalRef
stringterminalId
stringdeviceId
stringoperatorId
stringcreatedByAccountId
stringcreatedByAccountName
stringconditionsEnabled
booleanpatronNotPresent
booleancancellationReason
stringpreAuth
booleanpreAuthExpiresAt
stringpreAuthStatus
stringtaxNumber
objectpartialAllowed
booleanpaidBy
objectbasketAmount
bignumberconnectionId
stringexperimentalconnectionStatus
stringexperimentalpaymentLinkId
stringexperimental
Payment Option Model
Attributes
assetType
stringamount
bignumberbitcoinAddress
stringacceptedCollections
array
⭐️ For Payment Options which specify an address, there's a requirement to make a transaction on an external ledger. Once you have made that payment, you can use the transaction id to Pay a Payment Request.
Accepted Collections
If a Payment Request contains a centrapay.token.* Payment Option, an array of Accepted Collections will be present inside the centrapay.token Payment Option.
The Accepted Collections returned can be used to determine if a Centrapay Token can be used to pay a Payment Request, and the Line Items able to be purchased using the Token.
Attributes
id
stringlineItems
array
Payment Condition Model
Some Asset Types require conditional approval to pay. Possible Payment Conditions include confirming proof of ID or confirming a promotional item was purchased.
The conditionsEnabled flag should be set to true when Creating a Payment Request to indicate that
Payment Conditions can be accepted. If a Payment Condition arises, the absence of the conditionsEnabled flag will result in the
Payment Request being cancelled.
Conditions can either be accepted or declined. If a condition is declined, the Payment Request will be cancelled.
Attributes
name
stringmessage
stringstatus
string
Line Item Model
An order item for which payment is requested. The currency and units for a Line Item price will be consistent with the Payment Request value and the sum of Line Item prices should equal the Payment Request value.
Line items can include a discount amount. A discount that applies to multiple Line Items may be represented as a separate Line Item with a negative amount.
Either price or unitPrice must be supplied. If price is supplied it is used as-is; if only unitPrice is supplied, price is computed as unitPrice * qty. When both are supplied, price takes priority and is not validated against unitPrice * qty.
Attributes
Product Classification
Attributes
type
stringcode
stringname
stringprops
object
Paid By Model
The Paid By provides a summary of the transactions after the Payment Request was paid.
Attributes
assetTotals
array
Asset Totals
The Asset Totals provides a sum of every transaction for each Asset Type
Payment Activity Model
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.
Attributes
id
stringtype
stringvalue
monetarypaymentRequestId
stringmerchantId
stringmerchantConfigId
stringmerchantAccountId
stringmerchantName
stringcreatedAt
stringcreatedBy
crnpaymentRequestCreatedBy
crnactivityNumber
bignumbershortCode
stringassetType
stringexternal
booleancancellationReason
stringconditionId
integeridempotencyKey
stringconfirmationIdempotencyKey
stringpreAuth
booleanpaidBy
objectstrategy
object
Strategy Model
Attributes
refunds
arrayrefunds.assetId
stringrefunds.assetType
stringrefunds.completedPaymentId
stringrefunds.amount
stringrefunds.collectionId
string
Payment Activity Types
| Name | Description |
|---|---|
| request | Payment Request was created. |
| preAuthRequest | Payment Request was created with the preAuth flag set to "true". |
| paid | Payment Request was paid. |
| payment | A payment was made towards the Payment Request. |
| refund | Funds were returned to the shopper. |
| cancellation | Payment Request was cancelled by the merchant or the shopper. |
| expiry | Payment Request wasn't paid before time out. |
| accept-condition | A Payment Condition was accepted. |
| decline-condition | A Payment Condition was declined. |
| authorization | A Pre Auth Payment Request was approved and confirmations can be made against it. |
| confirmation | Funds on a Pre Auth have been drawn down on. |
| release | Pre Auth has been finalised and any remaining funds from Authorization have been returned. |
Cancellation Reasons
| Reason | Description |
|---|---|
| CANCELLED_BY_MERCHANT | The merchant cancelled the Payment Request by calling the cancel or void endpoint. |
| CANCELLED_BY_PATRON | The patron cancelled the transaction. |
| PATRON_CODE_INVALID | The patron code on the Payment Request was invalid. |
| PAYMENT_FAILED | The Payment Request failed for an unknown reason. |
| PATRON_CODE_EXPIRED | The patron code on the Payment Request has expired. |
| DECLINED_BY_PATRON | The payment was declined by the patron during approval steps. |
| DECLINED_BY_MERCHANT | The payment was declined by the merchant during approval steps. |
| PAYMENT_DECLINED | The 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_REQUEST_EXPIRED | The Payment Request has expired. |
| NO_AVAILABLE_PAYMENT_OPTIONS | No payment options match the requested payment parameters. |
| INACTIVE_ASSET | The asset used to pay the Payment Request is inactive. |
Create a Payment Request
This endpoint allows you to create a Payment Request for a given Merchant Config and value.
Attributes
configId
stringrequiredbarcode
stringbarcodeType
stringcollectionId
stringexpirySeconds
integerlineItems
arraypurchaseOrderRef
stringinvoiceRef
stringredirectCancelUrl
stringexperimentalredirectPaidUrl
stringexperimentalexternalRef
stringterminalId
stringdeviceId
stringoperatorId
stringcreatedByAccountName
stringconditionsEnabled
booleanpatronNotPresent
booleanpreAuth
booleanpartialAllowed
booleanbasketAmount
bignumberconnectionId
stringexperimentalpaymentLinkId
stringexperimental
Errors
LINE_ITEMS_SUM_CHECK_FAILED
400CHECKSUM_FAILED
400BAD REQUEST
400UNAUTHORIZED
401REDIRECT_URL_INVALID
403PATRON_CODE_INVALID
403NO_AVAILABLE_PAYMENT_OPTIONS
403TOKEN_COLLECTION_NOT_FOUND
403CONNECTION_NOT_FOUND
403CONNECTION_MERCHANT_MISMATCH
403CONNECTION_CREATED_BY_MISMATCH
403FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X POST https://service.centrapay.com/api/payment-requests \-H 'content-type: application/json' \-H 'x-api-key: <TOKEN>' \-d '{ "configId": "mc_5efbe2fb96c08357bb2b9242", "expirySeconds": 120, "value": { "amount": "10000", "currency": "NZD" }, "lineItems": [ { "name": "Hard Hat", "sku": "GH1234", "qty": "1", "price": "4000", "tax": "15", "discount": "400" }, { "name": "Tool Belt", "sku": "GH1234", "qty": "1", "price": "6000", "tax": "15", "discount": "600" } ], "connectionId": "cn_9asd9k19", "paymentLinkId": "pl_5srt998b"}'{ "id": "VYowvZmuw3hbp1va9xqWx7", "shortCode": "CP-X4V-6N", "url": "https://app.centrapay.com/pay/VYowvZmuw3hbp1va9xqWx7", "merchantId": "5efbe17d96c083633e2b9241", "merchantName": "NZD Test Merchant", "configId": "mc_5efbe2fb96c08357bb2b9242", "value": { "amount": "10000", "currency": "NZD" }, "status": "new", "liveness": "test", "expirySeconds": 120, "createdAt": "2023-10-23T22:56:46.145Z", "updatedAt": "2023-10-23T22:56:46.145Z", "expiresAt": "2023-10-23T22:58:46.145Z", "lineItems": [ { "name": "Hard Hat", "sku": "GH1234", "qty": "1", "price": "4000", "tax": "15", "discount": "400" }, { "name": "Tool Belt", "sku": "GH1234", "qty": "1", "price": "6000", "tax": "15", "discount": "600" } ], "connectionId": "cn_9asd9k19", "connectionStatus": "active", "paymentLinkId": "pl_5srt998b"}Get a Payment Request
This endpoint allows you to retrieve a Payment Request. |
Attributes
paymentRequestId
stringrequired
Errors
BAD REQUEST
400UNAUTHORIZED
401FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X GET https://service.centrapay.com/api/payment-requests/MhocUmpxxmgdHjr7DgKoKw \-H 'x-api-key: <TOKEN>'{ "id": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5", "url": "https://app.centrapay.com/pay/MhocUmpxxmgdHjr7DgKoKw", "patronCodeId": "V17FByEP9gm1shSG6a1Zzx", "barcode": "9990001234567895", "merchantId": "26d3Cp3rJmbMHnuNJmks2N", "merchantName": "Centrapay Café", "configId": "5efbe2fb96c08357bb2b9242", "purchaseOrderRef": "oF6kj1QlH5gK0y9rjRHFh2", "invoiceRef": "sy8CRmo3sp3ArOpnfmb423", "value": { "currency": "NZD", "amount": "8991" }, "paymentOptions": [ { "amount": "8991", "assetType": "centrapay.nzd.test" }, { "amount": "6190", "assetType": "centrapay.token.test", "acceptedCollections": [ { "id": "QWNB6jurnBczmvXDVfRuMK", "lineItems": [ { "name": "Coffee Grounds", "sku": "GH1234", "qty": "1", "price": "4195", "tax": "15.00" } ] } ] } ], "lineItems": [ { "name": "Coffee Grounds", "sku": "GH1234", "qty": "1", "price": "4195", "tax": "15.00" }, { "name": "Centrapay Cafe Mug", "sku": "SB456", "qty": "25", "price": "1995", "tax": "15.00", "discount": "199" } ], "merchantConditions": [ { "id": "1", "name": "photo-id-check", "message": "Please check ID", "status": "awaiting-merchant" } ], "paidBy": { "assetTotals": [ { "type": "centrapay.nzd.test", "description": "Centrapay NZD Test", "settlementDate": "2026-02-11T00:31:31.661Z", "total": { "amount": "1000", "currency": "NZD" }, "payerAccountId": "Bn8Wawd21Y2yoGb2KuSdK2" } ] }, "status": "new", "createdAt": "2021-06-08T04:04:27.426Z", "updatedAt": "2021-06-08T04:04:27.426Z", "expiresAt": "2021-06-08T04:06:27.426Z", "liveness": "test", "expirySeconds": 120, "connectionId": "cn_9asd9k19", "connectionStatus": "active"}Get a Payment Request by Short Code
This endpoint returns the latest Payment Request that matches the given short code.
Attributes
shortCode
stringrequired
Errors
CHECKSUM_FAILED
400BAD REQUEST
400UNAUTHORIZED
401FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X GET https://service.centrapay.com/api/payment-requests/short-code/CP-C7F-ZS5 \-H 'x-api-key: <TOKEN>'{ "id": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5", "url": "https://app.centrapay.com/pay/MhocUmpxxmgdHjr7DgKoKw", "patronCodeId": "V17FByEP9gm1shSG6a1Zzx", "barcode": "9990001234567895", "merchantId": "26d3Cp3rJmbMHnuNJmks2N", "merchantName": "Centrapay Café", "configId": "5efbe2fb96c08357bb2b9242", "value": { "currency": "NZD", "amount": "100" }, "paymentOptions": [ { "amount": "100", "assetType": "centrapay.nzd.test" } ], "merchantConditions": [], "status": "new", "createdAt": "2021-06-08T04:04:27.426Z", "updatedAt": "2021-06-08T04:04:27.426Z", "expiresAt": "2021-06-08T04:06:27.426Z", "liveness": "test", "expirySeconds": 120, "connectionId": "cn_9asd9k19", "connectionStatus": "active"}Get a Payment Request linked to a Patron Code
This endpoint returns the latest Payment Request with status new that has been attached to a Patron Code.
The Payment Request may have been created with a reference to any Patron Code owned by the user's
account.
This endpoint should be polled just after a user's Patron Code has been scanned. This will allow them to find the Payment Request and proceed to pay.
Errors
BAD REQUEST
400UNAUTHORIZED
401FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X GET https://service.centrapay.com/api/me/patron-code-payment-request \-H 'x-api-key: <TOKEN>'{ "id": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5", "url": "https://app.centrapay.com/pay/MhocUmpxxmgdHjr7DgKoKw", "patronCodeId": "V17FByEP9gm1shSG6a1Zzx", "barcode": "9990001234567895", "merchantId": "26d3Cp3rJmbMHnuNJmks2N", "merchantName": "Centrapay Café", "configId": "5efbe2fb96c08357bb2b9242", "value": { "currency": "NZD", "amount": "100" }, "paymentOptions": [ { "amount": "100", "assetType": "centrapay.nzd.test" } ], "merchantConditions": [], "status": "new", "createdAt": "2021-06-08T04:04:27.426Z", "updatedAt": "2021-06-08T04:04:27.426Z", "expiresAt": "2021-06-08T04:06:27.426Z", "liveness": "test", "expirySeconds": 120, "connectionId": "cn_9asd9k19", "connectionStatus": "active"}Get a Payment Request by Connection Id
This endpoint returns the latest Payment Request that is associated with the provided Connection. The caller of the endpoint must be the account that authorized the connection.
Attributes
connectionId
stringrequired
Errors
BAD REQUEST
400UNAUTHORIZED
401FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X GET https://service.centrapay.com/api/connections/cn_9asd9k19/latest-payment-request \-H 'x-api-key: <TOKEN>'{ "id": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5", "url": "https://app.centrapay.com/pay/MhocUmpxxmgdHjr7DgKoKw", "patronCodeId": "V17FByEP9gm1shSG6a1Zzx", "barcode": "9990001234567895", "merchantId": "26d3Cp3rJmbMHnuNJmks2N", "merchantName": "Centrapay Café", "configId": "5efbe2fb96c08357bb2b9242", "value": { "currency": "NZD", "amount": "100" }, "paymentOptions": [ { "amount": "100", "assetType": "centrapay.nzd.test" } ], "merchantConditions": [], "status": "new", "createdAt": "2021-06-08T04:04:27.426Z", "updatedAt": "2021-06-08T04:04:27.426Z", "expiresAt": "2021-06-08T04:06:27.426Z", "liveness": "test", "expirySeconds": 120, "connectionId": "cn_9asd9k19", "connectionStatus": "authorized"}List Payment Requests by External Reference
This endpoint returns a list of Payment Requests that match the given external reference. Results are paginated.
Attributes
externalRef
stringrequiredmerchantAccountId
stringrequiredpageKey
stringpaginationLimit
string
Errors
BAD REQUEST
400UNAUTHORIZED
401FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X GET 'https://service.centrapay.com/api/payment-requests/external-ref/e8df06e2-13a5-48b4-b670-3fd6d815fe0a?merchantAccountId=1mdj7bj95gjo92r0ux6wfy69gj3h77' \-H 'x-api-key: <TOKEN>'{ "items": [ { "id": "MhocUmpxxmgdHjr7DgKoKw", "url": "https://app.centrapay.com/pay/MhocUmpxxmgdHjr7DgKoKw", "merchantName": "Centrapay Café", "value": { "currency": "NZD", "amount": "8991" }, "createdAt": "2021-06-08T04:04:27.426Z", "expiresAt": "2021-06-08T04:06:27.426Z", "paymentOptions": [ { "amount": "8991", "assetType": "centrapay.nzd.test" }, { "amount": "6190", "assetType": "centrapay.token.test", "acceptedCollections": [ { "id": "QWNB6jurnBczmvXDVfRuMK", "lineItems": [ { "name": "Coffee Grounds", "sku": "GH1234", "qty": "1", "price": "4195", "tax": "15.00" } ] } ] } ], "status": "new", "liveness": "test", "connectionId": "cn_9asd9k19", "connectionStatus": "active" } ], "pageKey": "12312312"}Get Payment Request Summary
This endpoint allows you to retrieve the summary of a Payment Request while the status is new.
Attributes
paymentRequestId
stringrequired
Errors
BAD REQUEST
400UNAUTHORIZED
401FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X GET https://service.centrapay.com/api/payment-requests/MhocUmpxxmgdHjr7DgKoKw/summary \-H 'x-api-key: <TOKEN>'{ "id": "MhocUmpxxmgdHjr7DgKoKw", "url": "https://app.centrapay.com/pay/MhocUmpxxmgdHjr7DgKoKw", "merchantId": "26d3Cp3rJmbMHnuNJmks2N", "merchantName": "Centrapay Café", "value": { "currency": "NZD", "amount": "8991" }, "createdAt": "2021-06-08T04:04:27.426Z", "expiresAt": "2021-06-08T04:06:27.426Z", "paymentOptions": [ { "amount": "8991", "assetType": "centrapay.nzd.test" }, { "amount": "6190", "assetType": "centrapay.token.test", "acceptedCollections": [ { "id": "QWNB6jurnBczmvXDVfRuMK", "lineItems": [ { "name": "Coffee Grounds", "sku": "GH1234", "qty": "1", "price": "4195", "tax": "15.00" } ] } ] } ], "partialAllowed": true, "basketAmount": "8991", "remainingAmount": "8991", "status": "new", "lineItems": [ { "name": "Coffee Grounds", "sku": "GH1234", "qty": "1", "price": "4195", "tax": "15.00" }, { "name": "Centrapay Cafe Mug", "sku": "SB456", "qty": "25", "price": "1995", "tax": "15.00", "discount": "199" } ], "liveness": "test"}Pay a Payment Request
To pay a Payment Request you must supply the name of the Asset Type, idempotencyKey and one of assetId, transactionId or authorization.
- Use
assetIdif the Asset Type is managed by Centrapay. - Use
transactionIdto verify an external transaction such as a Bitcoin payment. - Use
authorizationto authorize an external transaction.
Attributes
paymentRequestId
stringrequiredassetType
stringrequiredidempotencyKey
stringrequiredassetId
stringtransactionId
stringauthorization
stringmode
stringamount
bignumberexternalPaymentRef
stringlineItems
array
Errors
BAD REQUEST
400UNAUTHORIZED
401INVALID_ASSET_TYPE
403REQUEST_EXPIRED
403REQUEST_PAID
403REQUEST_CANCELLED
403INACTIVE_ASSET
403INVALID_MERCHANT_CONFIG
403QUOTA_EXCEEDED
403INSUFFICIENT_ASSET_VALUE
403ASSET_REDEMPTION_DENIED
403PAYMENT_DECLINED
403PAYMENT_UNCONFIRMED
403REMAINING_AMOUNT_EXCEEDED
403FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X POST https://service.centrapay.com/api/payment-requests/MhocUmpxxmgdHjr7DgKoKw/pay \-H 'content-type: application/json' \-H 'x-api-key: <TOKEN>' \-d '{ "idempotencyKey": "b62-11ec-9072-3e22fb52e878", "assetType": "centrapay.nzd.main", "assetId": "WRhAxxWpTKb5U7pXyxQjjY", "amount": "200", "mode": "partial-payment", "externalPaymentRef": "62e4b0d7-551b-4b93-8b62-28265b4457d1"}'{ "type": "payment", "value": { "currency": "NZD", "amount": "1000" }, "idempotencyKey": "8b62-11ec-9072-3e22fb52e878", "assetType": "centrapay.nzd.main", "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5-015", "merchantName": "Centrapay Café", "merchantId": "26d3Cp3rJmbMHnuNJmks2N", "merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9", "merchantConfigId": "5efbe2fb96c08357bb2b9242", "createdAt": "2021-06-08T04:04:27.426Z", "createdBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "activityNumber": "2", "mode": "partial-payment", "id": "94a564c9a66d4893b7edf8ccafe3c5fb", "externalPaymentRef": "62e4b0d7-551b-4b93-8b62-28265b4457d1"}Refund a Payment Request
This endpoint allows you to initiate a refund of a Payment Request. The refund will be completed asynchronously.
Attributes
paymentRequestId
stringrequiredexternalRef
stringrequiredinvoiceRef
stringconfirmationIdempotencyKey
stringlineItems
arraymerchantConfigId
string
Errors
LINE_ITEMS_SUM_CHECK_FAILED
400BAD REQUEST
400UNAUTHORIZED
401NOT_PAID
403ALREADY_REFUNDED
403INVALID_AMOUNT
403REPEAT_REFERENCE
403PARTIAL_REFUNDS_NOT_ALLOWED
403INACTIVE_ASSET
403REFUND_NOT_SUPPORTED
403REFUND_WINDOW_EXCEEDED
403PRE_AUTH_PENDING
403CONFIRMATION_NOT_FOUND
403REFUND_DECLINED
403FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X POST https://service.centrapay.com/api/payment-requests/MhocUmpxxmgdHjr7DgKoKw/refund \-H 'content-type: application/json' \-H 'x-api-key: <TOKEN>' \-d '{ "value": { "amount": "3600", "currency": "NZD" }, "externalRef": "e8df06e2-13a5-48b4-b670-3fd6d815fe0a", "lineItems": [ { "name": "Hard Hat", "sku": "GH1234", "qty": "1", "price": "4000", "tax": "15", "discount": "400" } ]}'{ "type": "refund", "value": { "currency": "NZD", "amount": "3600" }, "assetType": "centrapay.nzd.main", "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5-015", "merchantName": "Centrapay Café", "merchantId": "5ee0c486308f590260d9a07f", "merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9", "merchantConfigId": "mc_5ee168e8597be5002af7b454", "createdAt": "2021-06-12T01:17:00.000Z", "createdBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "activityNumber": "3", "invoiceRef": "sy8CRmo3sp3ArOpnfmb423", "lineItems": [ { "name": "Hard Hat", "sku": "GH1234", "qty": "1", "price": "4000", "tax": "15", "discount": "400" } ]}Void a Payment Request
Voiding a payment request will cancel the request and trigger any refunds if necessary.
Attributes
paymentRequestId
stringrequired
Errors
BAD REQUEST
400UNAUTHORIZED
401VOID_WINDOW_EXCEEDED
403ALREADY_REFUNDED
403REPEAT_REFERENCE
403INACTIVE_ASSET
403REFUND_NOT_SUPPORTED
403REQUEST_EXPIRED
403PRE_AUTH_ALREADY_CONFIRMED
403FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X POST https://service.centrapay.com/api/payment-requests/MhocUmpxxmgdHjr7DgKoKw/void \-H 'x-api-key: <TOKEN>'{ "type": "refund", "value": { "currency": "NZD", "amount": "1000" }, "assetType": "centrapay.nzd.main", "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5-032", "merchantName": "Centrapay Café", "merchantId": "26d3Cp3rJmbMHnuNJmks2N", "merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9", "merchantConfigId": "5efbe2fb96c08357bb2b9242", "createdAt": "2021-06-08T04:04:27.426Z", "createdBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "activityNumber": "3"}Release Pre Auth funds
This endpoint allows you to release funds held for a Pre Auth Payment Request.
When you call release on a Pre Auth Payment Request any remaining funds that were being held for the authorization are returned to the asset, and a release Payment Activity is returned. If the authorization never completed, the Payment Request will instead be cancelled, and a cancellation Payment Activity will be returned.
Attributes
paymentRequestId
stringrequired
Errors
BAD REQUEST
400UNAUTHORIZED
401INVALID_PAYMENT_REQUEST_TYPE
403PRE_AUTH_RELEASED
403FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X POST https://service.centrapay.com/api/payment-requests/MhocUmpxxmgdHjr7DgKoKw/release \-H 'x-api-key: <TOKEN>'{ "type": "release", "value": { "currency": "NZD", "amount": "100" }, "assetType": "centrapay.nzd.main", "preAuth": true, "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5-015", "merchantName": "Centrapay Café", "merchantId": "5ee0c486308f590260d9a07f", "merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9", "merchantConfigId": "5ee168e8597be5002af7b454", "createdAt": "2021-06-12T01:17:00.000Z", "createdBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "activityNumber": "3"}Confirm Pre Auth Payment Request
This endpoint allows you to make a confirmation against a Pre Auth Payment Request.
An idempotencyKey is a identifier from your system used for guaranteeing at least once delivery of your request.
If our endpoint does not respond, you must retry until you get back a 200 or 403.
If we recive 2 requests with the same idempotencyKey, we won't process the second and return the first response.
Attributes
paymentRequestId
stringrequiredidempotencyKey
stringrequiredinvoiceRef
stringrequiredlineItems
arrayrequiredvalue
monetary
Errors
BAD REQUEST
400UNAUTHORIZED
401INVALID_PAYMENT_REQUEST_TYPE
403PRE_AUTH_RELEASED
403PRE_AUTH_PENDING
403REQUEST_CANCELLED
403INVALID_AMOUNT
403IDEMPOTENT_OPERATION_FAILED
403FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X POST https://service.centrapay.com/api/payment-requests/MhocUmpxxmgdHjr7DgKoKw/confirm \-H 'content-type: application/json' \-H 'x-api-key: <TOKEN>' \-d '{ "value": { "amount": "6190", "currency": "NZD" }, "idempotencyKey": "e8df06e2-13a5-48b4-b670-3fd6d815fe0a", "invoiceRef": "2022-08-03T16:56:50-06:00", "lineItems": [ { "name": "Coffee Grounds", "sku": "GH1234", "qty": "1", "price": "4195", "tax": "15.00" }, { "name": "Centrapay Cafe Mug", "sku": "SB456", "qty": "25", "price": "1995", "tax": "15.00", "discount": "199", "restricted": true, "productId": "19412345123459", "classification": { "type": "GS1", "code": "10001874", "name": "CROCKERY", "props": { "20001479": "30008960" } } } ]}'{ "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5", "value": { "amount": "6190", "currency": "NZD" }, "preAuth": true, "type": "confirmation", "idempotencyKey": "e8df06e2-13a5-48b4-b670-3fd6d815fe0a", "createdAt": "2021-06-08T04:04:27.426Z", "updatedAt": "2021-06-08T04:04:27.426Z", "lineItems": [ { "name": "Coffee Grounds", "sku": "GH1234", "qty": "1", "price": "4195", "tax": "15.00" }, { "name": "Centrapay Cafe Mug", "sku": "SB456", "qty": "25", "price": "1995", "tax": "15.00", "discount": "199" } ], "invoiceRef": "2022-08-03T16:56:50-06:00", "createdByAccountId": "Jaim1Cu1Q55uooxSens6yk", "createdByAccountName": "Bob's Burgers Intergration"}List Payment Activities for a Merchant
This endpoint allows you to list Payment Activities for a Merchant. Results are paginated and ordered by descending activity created date.
Attributes
merchantId
stringrequiredpageKey
stringrequired
Errors
BAD REQUEST
400UNAUTHORIZED
401FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X GET 'https://service.centrapay.com/api/payment-activities?merchantId=5ee0c486308f590260d9a07f&pageKey=PaymentRequest%23E9eXsErwA444qFDoZt5iLA%7CActivity%23000000000000001%7C614161c4c4d3020073bd4ce8%7C2021-09-15T03%3A00%3A21.156Z' \-H 'x-api-key: <TOKEN>'{ "nextPageKey": "PaymentRequest#E9eXsErwA444qFDoZt5iLA|Activity#000000000000001|614161c4c4d3020073bd4ce8|2021-09-15T03:00:21.156Z", "items": [ { "type": "refund", "value": { "currency": "NZD", "amount": "600" }, "assetType": "centrapay.nzd.main", "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5-032", "merchantName": "Centrapay Café", "merchantId": "5ee0c486308f590260d9a07f", "merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9", "merchantConfigId": "5ee168e8597be5002af7b454", "createdAt": "2021-06-12T01:17:00.000Z", "createdBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "activityNumber": "3" }, { "type": "payment", "value": { "currency": "NZD", "amount": "6190" }, "assetType": "centrapay.nzd.main", "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5-027", "merchantName": "Centrapay Café", "merchantId": "5ee0c486308f590260d9a07f", "merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9", "merchantConfigId": "5ee168e8597be5002af7b454", "createdAt": "2021-06-12T01:16:00.000Z", "createdBy": "crn::user:da75ad90-9a5b-4df0-8374-f48b3a8fbfcc", "paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "activityNumber": "2" }, { "type": "request", "value": { "currency": "NZD", "amount": "6190" }, "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5-015", "merchantName": "Centrapay Café", "merchantId": "5ee0c486308f590260d9a07f", "merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9", "merchantConfigId": "5ee168e8597be5002af7b454", "createdAt": "2021-06-12T01:15:46.000Z", "createdBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "activityNumber": "1" } ]}List Payment Activities for a Payment Request
This endpoint allows you to list Payment Activities for a Payment Request. Results are ordered by descending activity created date.
Attributes
paymentRequestId
stringrequired
Errors
BAD REQUEST
400UNAUTHORIZED
401FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X GET https://service.centrapay.com/api/payment-requests/MhocUmpxxmgdHjr7DgKoKw/activities \-H 'x-api-key: <TOKEN>'{ "items": [ { "type": "refund", "value": { "currency": "NZD", "amount": "600" }, "assetType": "centrapay.nzd.main", "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5-032", "merchantName": "Centrapay Café", "merchantId": "5ee0c486308f590260d9a07f", "merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9", "merchantConfigId": "5ee168e8597be5002af7b454", "createdAt": "2021-06-12T01:17:00.000Z", "createdBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "activityNumber": "3" }, { "type": "payment", "value": { "currency": "NZD", "amount": "6190" }, "assetType": "centrapay.nzd.main", "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5-027", "merchantName": "Centrapay Café", "merchantId": "5ee0c486308f590260d9a07f", "merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9", "merchantConfigId": "5ee168e8597be5002af7b454", "createdAt": "2021-06-12T01:16:00.000Z", "createdBy": "crn::user:da75ad90-9a5b-4df0-8374-f48b3a8fbfcc", "paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "activityNumber": "2" }, { "type": "request", "value": { "currency": "NZD", "amount": "6190" }, "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "shortCode": "CP-C7F-ZS5-015", "merchantName": "Centrapay Café", "merchantId": "5ee0c486308f590260d9a07f", "merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9", "merchantConfigId": "5ee168e8597be5002af7b454", "createdAt": "2021-06-12T01:15:46.000Z", "createdBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "activityNumber": "1" } ]}Accept a Payment Condition
Accept a Payment Condition listed in merchantConditions with status awaiting-merchant.
Returns a Payment Activity.
Attributes
paymentRequestId
stringrequiredconditionId
stringrequired
Errors
BAD REQUEST
400UNAUTHORIZED
401PATRON_NOT_AUTHORIZED
403MERCHANT_NOT_AUTHORIZED
403CONDITION_ALREADY_SET
403FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X POST https://service.centrapay.com/api/payment-requests/MhocUmpxxmgdHjr7DgKoKw/conditions/1/accept \-H 'x-api-key: <TOKEN>'{ "type": "accept-condition", "value": { "currency": "NZD", "amount": "100" }, "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "conditionId": 1, "createdAt": "2022-05-12T01:17:00.000Z", "createdBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "activityNumber": "2", "merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9", "merchantId": "5ee0c486308f590260d9a07f", "merchantConfigId": "5ee168e8597be5002af7b454", "merchantName": "Centrapay Café"}Decline a Payment Condition
Decline a Payment Condition listed in merchantConditions with status awaiting-merchant.
Returns a Payment Activity.
Attributes
paymentRequestId
stringrequiredconditionId
stringrequired
Errors
BAD REQUEST
400UNAUTHORIZED
401PATRON_NOT_AUTHORIZED
403MERCHANT_NOT_AUTHORIZED
403CONDITION_ALREADY_SET
403FORBIDDEN
403NOT FOUND
404RATE LIMIT EXCEEDED
429SERVER ERROR
500
curl -X POST https://service.centrapay.com/api/payment-requests/MhocUmpxxmgdHjr7DgKoKw/conditions/1/decline \-H 'x-api-key: <TOKEN>'{ "type": "decline-condition", "value": { "currency": "NZD", "amount": "100" }, "paymentRequestId": "MhocUmpxxmgdHjr7DgKoKw", "conditionId": 1, "createdAt": "2022-05-12T01:17:00.000Z", "createdBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878", "activityNumber": "2", "merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9", "merchantId": "5ee0c486308f590260d9a07f", "merchantConfigId": "5ee168e8597be5002af7b454", "merchantName": "Centrapay Café"}