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
string -
shortCode
string -
url
string -
value
monetary -
paymentOptions
array -
merchantId
string -
merchantName
string -
configId
string -
status
string -
liveness
string -
createdAt
string -
updatedAt
string -
expiresAt
string -
merchantConditions
array -
remainingAmount
bignumber -
patronCodeId
string -
barcode
string -
barcodeType
string -
collectionId
string -
expirySeconds
integer -
lineItems
array -
purchaseOrderRef
string -
invoiceRef
string -
redirectCancelUrl
string experimental -
redirectPaidUrl
string experimental -
externalRef
string -
terminalId
string -
deviceId
string -
operatorId
string -
createdByAccountId
string -
createdByAccountName
string -
conditionsEnabled
boolean -
patronNotPresent
boolean -
cancellationReason
string -
preAuth
boolean -
preAuthExpiresAt
string -
preAuthStatus
string -
taxNumber
object -
partialAllowed
boolean -
paidBy
object -
basketAmount
bignumber -
connectionId
string experimental -
connectionStatus
string experimental -
paymentLinkId
string experimental
Payment Option Model
Attributes
-
assetType
string -
amount
bignumber -
bitcoinAddress
string -
acceptedCollections
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
string -
lineItems
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
-
id
bignumber -
name
string -
message
string -
status
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.
Attributes
Product Classification
Attributes
-
type
string -
code
string -
name
string -
props
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
string -
type
string -
value
monetary -
paymentRequestId
string -
merchantId
string -
merchantConfigId
string -
merchantAccountId
string -
merchantName
string -
createdAt
string -
createdBy
crn -
paymentRequestCreatedBy
crn -
activityNumber
bignumber -
shortCode
string -
assetType
string -
external
boolean -
cancellationReason
string -
conditionId
integer -
idempotencyKey
string -
confirmationIdempotencyKey
string -
preAuth
boolean -
paidBy
object -
strategy
object
Strategy Model
Attributes
-
refunds
array -
refunds.assetId
string -
refunds.assetType
string -
refunds.completedPaymentId
string -
refunds.amount
string -
refunds.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
string required -
barcode
string -
barcodeType
string -
collectionId
string -
expirySeconds
integer -
lineItems
array -
purchaseOrderRef
string -
invoiceRef
string -
redirectCancelUrl
string experimental -
redirectPaidUrl
string experimental -
externalRef
string -
terminalId
string -
deviceId
string -
operatorId
string -
createdByAccountName
string -
conditionsEnabled
boolean -
patronNotPresent
boolean -
preAuth
boolean -
partialAllowed
boolean -
basketAmount
bignumber -
connectionId
string experimental -
paymentLinkId
string experimental
Errors
-
LINE_ITEMS_SUM_CHECK_FAILED
400 -
CHECKSUM_FAILED
400 -
BAD REQUEST
400 -
UNAUTHORIZED
401 -
REDIRECT_URL_INVALID
403 -
PATRON_CODE_INVALID
403 -
NO_AVAILABLE_PAYMENT_OPTIONS
403 -
TOKEN_COLLECTION_NOT_FOUND
403 -
CONNECTION_NOT_FOUND
403 -
CONNECTION_MERCHANT_MISMATCH
403 -
CONNECTION_CREATED_BY_MISMATCH
403 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
string required
Errors
-
BAD REQUEST
400 -
UNAUTHORIZED
401 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
string required
Errors
-
CHECKSUM_FAILED
400 -
BAD REQUEST
400 -
UNAUTHORIZED
401 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
400 -
UNAUTHORIZED
401 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
string required
Errors
-
BAD REQUEST
400 -
UNAUTHORIZED
401 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
string required -
merchantAccountId
string required -
pageKey
string -
paginationLimit
string
Errors
-
BAD REQUEST
400 -
UNAUTHORIZED
401 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
string required
Errors
-
BAD REQUEST
400 -
UNAUTHORIZED
401 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
string required -
assetType
string required -
idempotencyKey
string required -
assetId
string -
transactionId
string -
authorization
string -
mode
string -
amount
bignumber -
externalPaymentRef
string -
lineItems
array
Errors
-
BAD REQUEST
400 -
UNAUTHORIZED
401 -
INVALID_ASSET_TYPE
403 -
REQUEST_EXPIRED
403 -
REQUEST_PAID
403 -
REQUEST_CANCELLED
403 -
INACTIVE_ASSET
403 -
INVALID_MERCHANT_CONFIG
403 -
QUOTA_EXCEEDED
403 -
INSUFFICIENT_ASSET_VALUE
403 -
ASSET_REDEMPTION_DENIED
403 -
PAYMENT_DECLINED
403 -
PAYMENT_UNCONFIRMED
403 -
REMAINING_AMOUNT_EXCEEDED
403 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
string required -
externalRef
string required -
invoiceRef
string -
confirmationIdempotencyKey
string -
lineItems
array -
merchantConfigId
string
Errors
-
LINE_ITEMS_SUM_CHECK_FAILED
400 -
BAD REQUEST
400 -
UNAUTHORIZED
401 -
NOT_PAID
403 -
ALREADY_REFUNDED
403 -
INVALID_AMOUNT
403 -
REPEAT_REFERENCE
403 -
PARTIAL_REFUNDS_NOT_ALLOWED
403 -
INACTIVE_ASSET
403 -
REFUND_NOT_SUPPORTED
403 -
REFUND_WINDOW_EXCEEDED
403 -
PRE_AUTH_PENDING
403 -
CONFIRMATION_NOT_FOUND
403 -
REFUND_DECLINED
403 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
string required
Errors
-
BAD REQUEST
400 -
UNAUTHORIZED
401 -
VOID_WINDOW_EXCEEDED
403 -
ALREADY_REFUNDED
403 -
REPEAT_REFERENCE
403 -
INACTIVE_ASSET
403 -
REFUND_NOT_SUPPORTED
403 -
REQUEST_EXPIRED
403 -
PRE_AUTH_ALREADY_CONFIRMED
403 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
string required
Errors
-
BAD REQUEST
400 -
UNAUTHORIZED
401 -
INVALID_PAYMENT_REQUEST_TYPE
403 -
PRE_AUTH_RELEASED
403 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
string required -
idempotencyKey
string required -
invoiceRef
string required -
lineItems
array required -
value
monetary
Errors
-
BAD REQUEST
400 -
UNAUTHORIZED
401 -
INVALID_PAYMENT_REQUEST_TYPE
403 -
PRE_AUTH_RELEASED
403 -
PRE_AUTH_PENDING
403 -
REQUEST_CANCELLED
403 -
INVALID_AMOUNT
403 -
IDEMPOTENT_OPERATION_FAILED
403 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
string required -
pageKey
string required
Errors
-
BAD REQUEST
400 -
UNAUTHORIZED
401 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
string required
Errors
-
BAD REQUEST
400 -
UNAUTHORIZED
401 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
string required -
conditionId
string required
Errors
-
BAD REQUEST
400 -
UNAUTHORIZED
401 -
PATRON_NOT_AUTHORIZED
403 -
MERCHANT_NOT_AUTHORIZED
403 -
CONDITION_ALREADY_SET
403 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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
string required -
conditionId
string required
Errors
-
BAD REQUEST
400 -
UNAUTHORIZED
401 -
PATRON_NOT_AUTHORIZED
403 -
MERCHANT_NOT_AUTHORIZED
403 -
CONDITION_ALREADY_SET
403 -
FORBIDDEN
403 -
NOT FOUND
404 -
RATE LIMIT EXCEEDED
429 -
SERVER 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é"}