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.
Centrapay Payment Requests are serviced via two sets of endpoints; the “next” version (documented on this page) and the “legacy” version (documented at Legacy Payment Requests API ).
Attributes
-
id
-
shortCode
-
url
-
value
monetary -
paymentOptions
-
merchantId
-
merchantName
-
configId
-
status
-
liveness
-
createdAt
timestamp -
updatedAt
timestamp -
expiresAt
timestamp -
merchantConditions
-
remainingAmount
bignumber -
patronCodeId
-
barcode
-
barcodeType
-
collectionId
-
expirySeconds
-
lineItems
-
purchaseOrderRef
-
invoiceRef
-
redirectCancelUrl
-
redirectPaidUrl
-
externalRef
-
terminalId
-
deviceId
-
operatorId
-
createdByAccountId
-
createdByAccountName
-
conditionsEnabled
-
patronNotPresent
-
cancellationReason
-
preAuth
-
preAuthExpiresAt
timestamp -
preAuthStatus
-
taxNumber
-
partialAllowed
-
paidBy
-
basketAmount
bignumber
Attributes
-
assetType
-
amount
bignumber -
bitcoinAddress
-
acceptedCollections
⭐️ 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 using the legacy payment API.
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 API can be used to pay a Payment Request, and the Line Items able to be purchased using the Token.
Attributes
-
id
-
lineItems
Some Asset Types API 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
-
message
-
status
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
Attributes
-
type
-
code
-
name
-
props
The Paid By provides a summary of the transactions after the Payment Request was paid.
Attributes
-
assetTotals
The Asset Totals provides a sum of every transaction for each Asset Type API
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
-
type
-
value
monetary -
paymentRequestId
-
merchantId
-
merchantConfigId
-
merchantAccountId
-
merchantName
-
createdAt
timestamp -
createdBy
crn -
paymentRequestCreatedBy
crn -
activityNumber
bignumber -
shortCode
-
assetType
-
external
-
cancellationReason
-
conditionId
-
idempotencyKey
-
confirmationIdempotencyKey
-
preAuth
-
paidBy
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. |
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. |
This endpoint allows you to create a Payment Request.
Attributes
-
configId
-
barcode
-
barcodeType
-
collectionId
-
expirySeconds
-
lineItems
-
purchaseOrderRef
-
invoiceRef
-
redirectCancelUrl
-
redirectPaidUrl
-
externalRef
-
terminalId
-
deviceId
-
operatorId
-
createdByAccountName
-
conditionsEnabled
-
patronNotPresent
-
preAuth
-
partialAllowed
-
basketAmount
bignumber
Errors
-
LINE_ITEMS_SUM_CHECK_FAILED
-
CHECKSUM_FAILED
-
REDIRECT_URL_INVALID
-
PATRON_CODE_INVALID
-
NO_AVAILABLE_PAYMENT_OPTIONS
-
TOKEN_COLLECTION_NOT_FOUND
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": "1",
"currency": "NZD"
}
}
'
{
"id": "VYowvZmuw3hbp1va9xqWx7",
"shortCode": "CP-X4V-6N",
"url": "https://app.centrapay.com/pay/VYowvZmuw3hbp1va9xqWx7",
"merchantId": "5efbe17d96c083633e2b9241",
"merchantName": "NZD Test Merchant",
"configId": "mc_5efbe2fb96c08357bb2b9242",
"value": {
"amount": "1",
"currency": "NZD"
},
"paymentOptions": [
{
"assetType": "centrapay.nzd.test",
"amount": "1"
},
{
"assetType": "cca.coke.test",
"amount": "1"
},
{
"assetType": "farmlands.nzd.test",
"amount": "1"
},
{
"assetType": "quartz.nzd.test",
"amount": "1"
},
{
"assetType": "uplinkapi.test",
"amount": "1"
},
{
"assetType": "epay.test",
"amount": "1"
}
],
"status": "new",
"createdAt": "2023-10-23T22:56:46.145Z",
"updatedAt": "2023-10-23T22:56:46.145Z",
"expiresAt": "2023-10-23T22:58:46.145Z",
"liveness": "test",
"expirySeconds": 120,
"merchantConditions": [],
"createdByAccountId": "BtCjTpNwFcbuJQUP1c4qXp",
"createdByAccountName": "Smoke Test Merchant Prod",
"taxNumber": {
"value": "123-456-789",
"type": "nz-gst"
},
"remainingAmount": "1"
}
This endpoint allows you to retrieve a Payment Request.
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"
}
],
"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
}
This endpoint returns the latest Payment Request that matches the given short code.
Errors
-
CHECKSUM_FAILED
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
}
This endpoint returns the latest Payment Request with status new
that has been attached to a Patron Code API .
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.
curl -X GET \
https://service.centrapay.com/api/me/patron-code-payment-request \
-H 'authorization: <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
}
This endpoint allows you to retrieve the summary of a Payment Request while the status is new
.
curl -X GET \
https://service.centrapay.com/api/payment-requests/MhocUmpxxmgdHjr7DgKoKw/summary
{
"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"
}
]
}
]
}
],
"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"
}
]
}
To pay a Payment Request you must supply the name of the Asset Type API and one of assetId
, transactionId
or authorization
.
- Use
assetId
if the Asset Type API is managed by Centrapay. - Use
transactionId
to verify an external transaction such as a Bitcoin payment. - Use
authorization
to authorize an external transaction.
Attributes
-
assetType
-
assetId
-
transactionId
-
authorization
-
mode
-
amount
-
externalPaymentRef
Errors
-
INVALID_ASSET_TYPE
-
REQUEST_EXPIRED
-
REQUEST_PAID
-
REQUEST_CANCELLED
-
INACTIVE_ASSET
-
INVALID_MERCHANT_CONFIG
-
QUOTA_EXCEEDED
-
INSUFFICIENT_ASSET_VALUE
-
ASSET_REDEMPTION_DENIED
-
PAYMENT_DECLINED
curl -X POST \
https://service.centrapay.com/api/payment-requests/MhocUmpxxmgdHjr7DgKoKw/pay \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '
{
"assetType": "centrapay.nzd.main",
"assetId": "WRhAxxWpTKb5U7pXyxQjjY",
"amount": "200",
"mode": "partial-payment",
"externalPaymentRef": "62e4b0d7-551b-4b93-8b62-28265b4457d1"
}
'
{
"type": "payment",
"value": {
"currency": "NZD",
"amount": "1000"
},
"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"
}
This endpoint allows you to initiate a refund of a Payment Request. The refund will be completed asynchronously.
Attributes
-
externalRef
-
invoiceRef
-
confirmationIdempotencyKey
-
lineItems
-
merchantConfigId
Errors
-
LINE_ITEMS_SUM_CHECK_FAILED
-
NOT_PAID
-
ALREADY_REFUNDED
-
INVALID_AMOUNT
-
REPEAT_REFERENCE
-
PARTIAL_REFUNDS_NOT_ALLOWED
-
INACTIVE_ASSET
-
REFUND_NOT_SUPPORTED
-
REFUND_WINDOW_EXCEEDED
-
PRE_AUTH_PENDING
-
CONFIRMATION_NOT_FOUND
-
REFUND_DECLINED
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": "100",
"currency": "NZD"
},
"externalRef": "e8df06e2-13a5-48b4-b670-3fd6d815fe0a"
}
'
{
"type": "refund",
"value": {
"currency": "NZD",
"amount": "100"
},
"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"
}
Voiding a payment request will cancel the request and trigger any refunds if necessary.
Errors
-
VOID_WINDOW_EXCEEDED
-
ALREADY_REFUNDED
-
REPEAT_REFERENCE
-
INACTIVE_ASSET
-
REFUND_NOT_SUPPORTED
-
REQUEST_EXPIRED
-
PRE_AUTH_ALREADY_CONFIRMED
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"
}
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.
Errors
-
INVALID_PAYMENT_REQUEST_TYPE
-
PRE_AUTH_RELEASED
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"
}
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
-
idempotencyKey
-
invoiceRef
-
lineItems
-
value
monetary
Errors
-
INVALID_PAYMENT_REQUEST_TYPE
-
PRE_AUTH_RELEASED
-
PRE_AUTH_PENDING
-
REQUEST_CANCELLED
-
INVALID_AMOUNT
-
IDEMPOTENT_OPERATION_FAILED
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"
}
This endpoint allows you to list Payment Activities for a Merchant. Results are paginated API and ordered by descending activity created date.
Attributes
-
merchantId
-
pageKey
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"
},
{
"type": "Authorization",
"value": {
"currency": "NZD",
"amount": "100"
},
"paymentRequestId": "5zXMDueDJRNNyP3UeWBgSA",
"shortCode": "CP-W4R-01J",
"merchantName": "Centrapay Café",
"merchantId": "5ee0c486308f590260d9a07f",
"merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9",
"merchantConfigId": "5ee168e8597be5002af7b454",
"createdAt": "2021-05-12T01:15:46.000Z",
"createdBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878",
"paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878",
"activityNumber": "2",
"preAuth": true
},
{
"type": "preAuthRequest",
"value": {
"currency": "NZD",
"amount": "100"
},
"paymentRequestId": "5zXMDueDJRNNyP3UeWBgSA",
"shortCode": "CP-W4R-01J",
"merchantName": "Centrapay Café",
"merchantId": "5ee0c486308f590260d9a07f",
"merchantAccountId": "C4QnjXvj8At6SMsEN4LRi9",
"merchantConfigId": "5ee168e8597be5002af7b454",
"createdAt": "2021-05-12T01:15:46.000Z",
"createdBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878",
"paymentRequestCreatedBy": "crn::user:0af834c8-1110-11ec-9072-3e22fb52e878",
"activityNumber": "1",
"preAuth": true
}
]
}
This endpoint allows you to list Payment Activities for a Payment Request. Results are ordered by descending activity created date.
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 listed in merchantConditions
with status awaiting-merchant
.
Returns a Payment Activity.
Errors
-
PATRON_NOT_AUTHORIZED
-
MERCHANT_NOT_AUTHORIZED
-
CONDITION_ALREADY_SET
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 listed in merchantConditions
with status awaiting-merchant
.
Returns a Payment Activity.
Errors
-
PATRON_NOT_AUTHORIZED
-
MERCHANT_NOT_AUTHORIZED
-
CONDITION_ALREADY_SET
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é"
}