This endpoint allows you to create a Payment Request for a given Merchant Config and value.
barcodeoptional stringScanned Code used to create the Payment Request. Required when the Quick Pay payment flow is used.basketAmountoptional bignumberThe total amount of the transaction including non Centrapay payment methods. Required whenpartialAllowedistrue.connectionIdoptional stringexperimentalThe identifier of the Connection associated with the payment request.lineItemsoptional array of objectsThe Line Items being paid for. Line Item currency and units are consistent with the Payment Request value, and the sum of Line Item prices should equal the Payment Request value.typeoptional enumThe classification type. See GS1 Global Product Classification. WhenGS1is used as the product classification type then the product code should be the GPC product brick identifier.
discountoptional bignumberDiscount amount in cents (tax exclusive). A discount that applies to multiple Line Items may be represented as a separate Line Item with a negative amount.pricerequired bignumberThe total price in cents for the line item (eg.price = product price * qty - discounts + tax). EitherpriceorunitPriceis required; if both are supplied,pricetakes priority.
redirectCancelUrloptional stringexperimentalURL to redirect the user to after they cancel the Payment Request. Must start with one of the allowedRedirectUrls for the Merchant Config.redirectPaidUrloptional stringexperimentalURL to redirect the user to after they pay the Payment Request. Must start with one of the allowedRedirectUrls for the Merchant Config.valuerequired monetaryThe canonical value of the Payment Request. Must be less than 100000000 and positive.
barcodestringScanned Code used to create the Payment Request. Required when the Quick Pay payment flow is used.basketAmountbignumberThe total amount of the transaction including non Centrapay payment methods. Required whenpartialAllowedistrue.CANCELLED_BY_MERCHANTThe merchant cancelled the Payment Request by calling the cancel or void endpoint.CANCELLED_BY_PATRONThe patron cancelled the transaction.DECLINED_BY_MERCHANTThe payment was declined by the merchant during approval steps.DECLINED_BY_PATRONThe payment was declined by the patron during approval steps.INACTIVE_ASSETThe asset used to pay the Payment Request is inactive.NO_AVAILABLE_PAYMENT_OPTIONSNo payment options match the requested payment parameters.PATRON_CODE_EXPIREDThe patron code on the Payment Request has expired.PATRON_CODE_INVALIDThe patron code on the Payment Request was invalid.PAYMENT_DECLINEDThe payment parameters were valid but payment was declined because additional payment restrictions were violated. For example, asset not active, asset overdrawn, quota exceeded or line item category restrictions.PAYMENT_FAILEDThe Payment Request failed for an unknown reason.PAYMENT_REQUEST_EXPIREDThe Payment Request has expired.
lineItemsarray of objectsThe Line Items being paid for. Line Item currency and units are consistent with the Payment Request value, and the sum of Line Item prices should equal the Payment Request value.typeenumThe classification type. See GS1 Global Product Classification. WhenGS1is used as the product classification type then the product code should be the GPC product brick identifier.
discountbignumberDiscount amount in cents (tax exclusive). A discount that applies to multiple Line Items may be represented as a separate Line Item with a negative amount.pricebignumberThe total price in cents for the line item (eg.price = product price * qty - discounts + tax). EitherpriceorunitPriceis required; if both are supplied,pricetakes priority.
merchantConditionsarray of objectsA dynamic list of Payment Conditions that require operator approval to complete a payment. Some Asset Types require conditional approval, such as confirming proof of ID or a promotional item purchase. Conditions are calculated when polling a Payment Request, and can be accepted or declined - a declined condition cancels the Payment Request.paidByobjectShows the Paid By - a summary of the transactions - when a Payment Request is paid for with multiple Assets.typeenumThe classification type. See GS1 Global Product Classification. WhenGS1is used as the product classification type then the product code should be the GPC product brick identifier.
discountbignumberDiscount amount in cents (tax exclusive). A discount that applies to multiple Line Items may be represented as a separate Line Item with a negative amount.pricebignumberThe total price in cents for the line item (eg.price = product price * qty - discounts + tax). EitherpriceorunitPriceis required; if both are supplied,pricetakes priority.
paymentOptionsarray of objectsThe Payment Options, indicating valid asset for payment. ⭐️ For Payment Options which specify an address, a transaction on an external ledger is required - once made, use the transaction id to Pay a Payment Request.acceptedCollectionsarray of objectsAccepted Collections for the Payment Request, when the “assetType” iscentrapay.token.*. They can be used to determine whether a Centrapay Token can be used to pay the Payment Request, and which Line Items can be purchased using the Token.lineItemsarray of objectsThe Line Items that can be purchased by a Centrapay Token with matching collection id.typeenumThe classification type. See GS1 Global Product Classification. WhenGS1is used as the product classification type then the product code should be the GPC product brick identifier.
discountbignumberDiscount amount in cents (tax exclusive). A discount that applies to multiple Line Items may be represented as a separate Line Item with a negative amount.pricebignumberThe total price in cents for the line item (eg.price = product price * qty - discounts + tax). EitherpriceorunitPriceis required; if both are supplied,pricetakes priority.
redirectCancelUrlstringexperimentalURL to redirect the user to after they cancel the Payment Request. Must start with one of the allowedRedirectUrls for the Merchant Config.redirectPaidUrlstringexperimentalURL to redirect the user to after they pay the Payment Request. Must start with one of the allowedRedirectUrls for the Merchant Config.
errorstringThe name of the HTTP status. AlwaysBad Request.messageenumThe error code, or for a 400 a description of what's wrong with the request.Bad RequestThe request is malformed or missing required fields. The message says what's wrong, egamount is required. See 400 Malformed Request.CHECKSUM_FAILEDLuhn checksum digit doesn't pass.LINE_ITEMS_SUM_CHECK_FAILEDThe sum value of the line items did not equal the value of the Payment Request.
statusCodeintegerThe HTTP status code. Always400.
errorstringThe name of the HTTP status. AlwaysUnauthorized.messageenumThe error code, or for a 400 a description of what's wrong with the request.Missing authenticationAPI key or JWT is missing, expired or invalid. See Auth.
statusCodeintegerThe HTTP status code. Always401.
errorstringThe name of the HTTP status. AlwaysForbidden.messageenumThe error code, or for a 400 a description of what's wrong with the request.CONNECTION_CREATED_BY_MISMATCHThe connection was not created by the same caller as the payment request.CONNECTION_MERCHANT_MISMATCHThe connection is not for the same merchant as the payment request.CONNECTION_NOT_FOUNDThe connection does not exist.ForbiddenThe resource doesn't exist, or your user or API key doesn't have permission to access it. See 403 Forbidden.NO_AVAILABLE_PAYMENT_OPTIONSNo payment options match the requested payment parameters.PATRON_CODE_INVALIDPatron Code doesn't exist or has expired.REDIRECT_URL_INVALIDOne or more of the supplied redirect urls do not start with one of theallowedRedirectUrlson the Merchant Config.TOKEN_COLLECTION_NOT_FOUNDThe token collection does not exist.
statusCodeintegerThe HTTP status code. Always403.
errorstringThe name of the HTTP status. AlwaysNot Found.messageenumThe error code, or for a 400 a description of what's wrong with the request.Not FoundThe route doesn't exist. Check the URL and HTTP method against the examples. See 404 Route Not Found.
statusCodeintegerThe HTTP status code. Always404.
errorstringThe name of the HTTP status. AlwaysToo Many Requests.messageenumThe error code, or for a 400 a description of what's wrong with the request.RATE_LIMIT_EXCEEDEDCentrapay API rate limits have been exceeded. See Rate Limits.
statusCodeintegerThe HTTP status code. Always429.
errorstringThe name of the HTTP status. AlwaysInternal Server Error.messageenumThe error code, or for a 400 a description of what's wrong with the request.An internal server error occurredSomething went wrong on our end. Retrying should solve the issue. See 5xx Server Error.
statusCodeintegerThe HTTP status code. Always500.
curl -X POST https://service.centrapay.com/api/payment-requests \-H 'content-type: application/json' \-H 'x-api-key: <TOKEN>' \-d '{ "configId": "mc_5efbe2fb96c08357bb2b9242", "connectionId": "cn_9asd9k19", "expirySeconds": 120, "lineItems": [ { "discount": "400", "name": "Hard Hat", "price": "4000", "qty": "1", "sku": "GH1234", "tax": "15" }, { "discount": "600", "name": "Tool Belt", "price": "6000", "qty": "1", "sku": "GH1234", "tax": "15" } ], "paymentLinkId": "pl_5srt998b", "value": { "amount": "10000", "currency": "NZD" }}'{ "configId": "mc_5efbe2fb96c08357bb2b9242", "connectionId": "cn_9asd9k19", "connectionStatus": "active", "createdAt": "2023-10-23T22:56:46.145Z", "expiresAt": "2023-10-23T22:58:46.145Z", "expirySeconds": 120, "id": "VYowvZmuw3hbp1va9xqWx7", "lineItems": [ { "discount": "400", "name": "Hard Hat", "price": "4000", "qty": "1", "sku": "GH1234", "tax": "15" }, { "discount": "600", "name": "Tool Belt", "price": "6000", "qty": "1", "sku": "GH1234", "tax": "15" } ], "liveness": "test", "merchantId": "5efbe17d96c083633e2b9241", "merchantName": "NZD Test Merchant", "paymentLinkId": "pl_5srt998b", "shortCode": "CP-X4V-6N", "status": "new", "updatedAt": "2023-10-23T22:56:46.145Z", "url": "https://app.centrapay.com/pay/VYowvZmuw3hbp1va9xqWx7", "value": { "amount": "10000", "currency": "NZD" }}{ "error": "Bad Request", "message": "LINE_ITEMS_SUM_CHECK_FAILED", "statusCode": 400}{ "error": "Unauthorized", "message": "Missing authentication", "statusCode": 401}{ "error": "Forbidden", "message": "REDIRECT_URL_INVALID", "statusCode": 403}{ "error": "Not Found", "message": "Not Found", "statusCode": 404}{ "error": "Too Many Requests", "message": "RATE_LIMIT_EXCEEDED", "statusCode": 429}{ "error": "Internal Server Error", "message": "An internal server error occurred", "statusCode": 500}