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.
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 ).
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
timestamp -
updatedAt
timestamp -
expiresAt
timestamp -
merchantConditions
array -
remainingAmount
bignumber -
patronCodeId
string -
barcode
string -
barcodeType
string -
collectionId
string -
expirySeconds
number -
lineItems
array experimental -
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
timestamp -
preAuthStatus
string -
taxNumber
object -
partialAllowed
boolean -
paidBy
object -
basketAmount
bignumber
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 using the legacy payment API.
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
Attributes
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
timestamp -
createdBy
crn -
paymentRequestCreatedBy
crn -
activityNumber
bignumber -
shortCode
string -
assetType
string -
external
boolean -
cancellationReason
string -
conditionId
number -
idempotencyKey
string -
confirmationIdempotencyKey
string -
preAuth
boolean -
paidBy
object
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.
Attributes
-
configId
string required -
barcode
string -
barcodeType
string -
collectionId
string -
expirySeconds
number -
lineItems
array experimental -
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
Errors
-
LINE_ITEMS_SUM_CHECK_FAILED
400 -
CHECKSUM_FAILED
400 -
REDIRECT_URL_INVALID
403 -
PATRON_CODE_INVALID
403 -
NO_AVAILABLE_PAYMENT_OPTIONS
403 -
TOKEN_COLLECTION_NOT_FOUND
403
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"}
Get a Payment Request
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}
Get a Payment Request by Short Code
This endpoint returns the latest Payment Request that matches the given short code.
Errors
-
CHECKSUM_FAILED
400
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}
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.
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}
List Payment Requests by External Reference
This endpoint returns a list of Payment Requests that match the given external reference. Results are paginated .
Attributes
-
merchantAccountId
string required -
pageKey
string -
paginationLimit
string
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" } ], "pageKey": "12312312"}
Get Payment Request Summary
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" } ], "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
assetId
if the Asset Type 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
string required -
idempotencyKey
string required -
assetId
string -
transactionId
string -
authorization
string -
mode
string -
amount
string -
externalPaymentRef
string
Errors
-
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
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
-
externalRef
string required -
invoiceRef
string -
confirmationIdempotencyKey
string -
lineItems
array experimental -
merchantConfigId
string
Errors
-
LINE_ITEMS_SUM_CHECK_FAILED
400 -
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
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"}
Void a Payment Request
Voiding a payment request will cancel the request and trigger any refunds if necessary.
Errors
-
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
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.
Errors
-
INVALID_PAYMENT_REQUEST_TYPE
403 -
PRE_AUTH_RELEASED
403
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
-
idempotencyKey
string required -
invoiceRef
string required -
lineItems
array required experimental -
value
monetary
Errors
-
INVALID_PAYMENT_REQUEST_TYPE
403 -
PRE_AUTH_RELEASED
403 -
PRE_AUTH_PENDING
403 -
REQUEST_CANCELLED
403 -
INVALID_AMOUNT
403 -
IDEMPOTENT_OPERATION_FAILED
403
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
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 } ]}
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.
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 .
Errors
-
PATRON_NOT_AUTHORIZED
403 -
MERCHANT_NOT_AUTHORIZED
403 -
CONDITION_ALREADY_SET
403
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 .
Errors
-
PATRON_NOT_AUTHORIZED
403 -
MERCHANT_NOT_AUTHORIZED
403 -
CONDITION_ALREADY_SET
403
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é"}