This endpoint allows you to create a Patron Code. You can find payment request information attached to a Patron Code by polling for the Payment Request using the transacting APIs.
testScenarioNameenumInjects behavior into a Payment Request when the generated barcode is supplied on creation. A Patron Code with a Test Scenario Name is a test resource and can only be used with Payment Requests that will have a liveness oftest. The Asset Typecentrapay.nzd.testis required to run test scenarios.
✩ Barcode is a 16 digit number. The first 6 digits are a Centrapay defined prefix, then a 9 digit code, then a luhn checksum digit.
9 9 9 0 0 0 1 2 3 4 5 6 7 8 9 5 ❖ complete barcode9 9 9 0 0 0 - - - - - - - - - - ❖ centrapay prefix- - - - - - 1 2 3 4 5 6 7 8 9 - ❖ code- - - - - - - - - - - - - - - 5 ❖ luhn checksumThe Centrapay Prefix may present any of the following prefixes:
- 121921
- 123000
- 282828
- 293000
- 321000
- 321123
- 636863
- 713131
- 765432
- 777000
- 839234
- 848484
- 888444
- 929394
- 987600
- 999000
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.
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.ForbiddenThe resource doesn't exist, or your user or API key doesn't have permission to access it. See 403 Forbidden.
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/patron-codes \-H 'x-api-key: <TOKEN>'{ "accountId": "Jaim1Cu1Q55uooxSens6yk", "appName": "centrapay", "barcode": "9990001234567895", "createdAt": "2021-06-08T22:55:00.000Z", "expiresAt": "2021-06-08T23:00:00.000Z", "id": "V17FByEP9gm1shSG6a1Zzx", "metadata": {}}{ "error": "Bad Request", "message": "amount is required", "statusCode": 400}{ "error": "Unauthorized", "message": "Missing authentication", "statusCode": 401}{ "error": "Forbidden", "message": "Forbidden", "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}