Developers

This page is a ZenPay-styled copy of the Zenith Payments developer documentation. View the original docs

Credit Requests API

A credit request is a disbursement of funds to a customer bank account. Credits are submitted with a customer reference, amount, and destination account proxy.

Create a credit request#

POST/v2/credit-requests

View this endpoint in the original docs

Creates a credit request from the supplied request payload.

Authentication: Api-Key + BasicAuth

Request body

Credit request details required to create a credit request.

Content types: application/json, application/x-www-form-urlencoded · required

Schema: CreditsRequest

FieldTypeDescription
creditAmount requirednumber <double>

Payment amount.

customerName requiredstring

Customer name.

Max length: 100
customerReference requiredstring

Customer reference.

Max length: 20
paymentAccountProxy requiredstring

Payment Account Proxy.

Max length: 50
reason requiredstring

Credit reason.

Max length: 50
requestUniqueId requiredstring

Unique credit id provided by the merchant.

Max length: 50

Example: Credit request created

Shows submission and the resulting pending credit request.

JSON
{
  "creditAmount": 1,
  "customerName": "Test Customer",
  "customerReference": "cr-1210180471651",
  "paymentAccountProxy": "858b5f59d687468da8b76d0487184f95",
  "reason": "Example capture",
  "requestUniqueId": "credit-8662342847790"
}

Responses

201 Credit created.

application/json · object (CreditRequestResponse)

Example: Credit request created

Shows submission and the resulting pending credit request.

JSON
{
  "creditAmount": 1,
  "creditReference": 1188,
  "merchantCode": "1337",
  "merchantName": "Menethil",
  "requestReason": "Example capture",
  "requestStatus": 0,
  "requestStatusString": "Pending",
  "requestUniqueId": "credit-8662342847790",
  "status": 6
}

400 Invalid input detail.

application/json · object

403 Merchant is forbidden to perform this operation.

application/json · object

409 UniqueId is not unique.

application/json · object

412 Not allowed due to limit or not eligible to process.

application/json · object

Example: Card proxy not eligible

Shows the eligibility refusal; changing the amount alone does not demonstrate eligibility.

JSON
{
  "errorCode": "ERR",
  "errorMessage": "The Proxy provided is not eligible for credit."
}

Example: Daily credit limit reached

A limit refusal requires different handling from an ineligible payment account.

JSON
{
  "errorCode": "ERR",
  "errorMessage": "Maximum amount of credits per day limit reached."
}

422 Merchant is forbidden to perform this operation.

application/json · object

500 Something went wrong. Please try again.

application/json · object

Example request (cURL, sandbox host)

cURL
curl -X POST 'https://api.sandbox.zenpay.com.au/v2/credit-requests' \
  -H 'Api-Key: <your API key>' \
  -u '<username>:<password>' \
  -H 'Content-Type: application/json' \
  -d '{
  "creditAmount": 1,
  "customerName": "Test Customer",
  "customerReference": "cr-1210180471651",
  "paymentAccountProxy": "858b5f59d687468da8b76d0487184f95",
  "reason": "Example capture",
  "requestUniqueId": "credit-8662342847790"
}'

Get a credit request#

GET/v2/credit-requests/{requestUniqueId}

View this endpoint in the original docs

Returns the credit request for the specified request unique ID.

Authentication: Api-Key + BasicAuth

Parameters

NameInTypeDescription
requestUniqueId requiredpathstring

The merchant's unique identifier for the credit request.

Responses

200 Found the credit.

application/json · object (CreditRequestResponse)

Example: Credit request pending

Read straight after creating the credit, before ZenPay has processed it; preserving the captured array response.

JSON
[
  {
    "creditAmount": 1,
    "creditReference": 1188,
    "merchantCode": "1337",
    "merchantName": "Menethil",
    "requestReason": "Example capture",
    "requestStatus": 0,
    "requestStatusString": "Pending",
    "requestUniqueId": "credit-8662342847790",
    "status": 6
  }
]

404 Unable to find the credit.

Example request (cURL, sandbox host)

cURL
curl -X GET 'https://api.sandbox.zenpay.com.au/v2/credit-requests/{requestUniqueId}' \
  -H 'Api-Key: <your API key>' \
  -u '<username>:<password>' \
  -H 'Accept: application/json'
Need help with your integration?Talk to the Zenith Integrations Team.
Email integrationsTalk to us