Create customers
/customersCreate a customer, a consumer or an organisation, or refresh one already held under the same details. Selected by the body's type. A customer signing itself up before it is verified is held to MerchantCustomers_UpsertMinimal instead.
CustCmdCreateConsumerCustCmdCreateOrganisationPermissions
merchantCustomers:upsertRequires the `upsert` action on `merchantCustomers` for the supplied runtime context
Request body
This body is a typed union. Pick a variant to see its fields and a matching example.
typetype = "CustCmdCreateConsumer"merchantIdstringrequiredExample mcht_9f2Kd8QpLzXw
givenNamestringNamed as the view names it. The domain's own input says firstName; one vocabulary is better than two.
Example Ada Lovelace
middleNamestringExample Ada Lovelace
familyNamestringrequiredExample Ada Lovelace
emailAddressstringrequiredExample ada@example.com
phoneNumberstringKept only when isVerified is true. On an unverified customer the platform waits for the one-time code to prove the number, and until then the customer reads back without one, so a number sent here with isVerified absent is not stored.
Example +61400000000
referenceCustomerIdstringExample your-own-reference
isVerifiedbooleanWhether the contact details are already known to be good. Defaults to unverified.
Example true
curl -X POST https://api.tst.au.apgpay.dev/customers \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "CustCmdCreateConsumer",
"merchantId": "mcht_9f2Kd8QpLzXw",
"givenName": "Ada Lovelace",
"middleName": "Ada Lovelace",
"familyName": "Ada Lovelace",
"emailAddress": "ada@example.com",
"phoneNumber": "+61400000000",
"referenceCustomerId": "your-own-reference",
"isVerified": true
}'Responses
The response is a tagged shape: type is always "CustCreateRspAttributes". Switch on it; subtypes can be added, and a client that already reads it will not break.
typetype = "CustCreateRspAttributes"The resource that was created.
typeA person buying for themselves.
customerIdCustIdrequiredIdentifier of a customer.
Example cust_9f2Kd8QpLzXw
personIdPsonIdrequiredThe person this customer is, read at GET /persons/{personId}.
Example pson_9f2Kd8QpLzXw
merchantIdstringrequiredExample mcht_9f2Kd8QpLzXw
marketplaceIdstringThe marketplace the merchant sits under, where there is one.
Example mktp_9f2Kd8QpLzXw
referenceCustomerIdstringExample your-own-reference
givenNamestringExample Ada Lovelace
middleNamestringExample Ada Lovelace
familyNamestringAbsent when the caller may not see personal data, see the note on this view.
Example Ada Lovelace
emailAddressstringAbsent when the caller may not see personal data.
Example ada@example.com
phoneNumberstringExample +61400000000
isVerifiedbooleanrequiredWhether the customer's contact details have been verified.
Example true
Identity checks attempted against this customer, by the evidence they were run with.
typeenumrequiredCustKycAttemptsAttributeswithoutDocumentinteger (int32)Checks run on name and address alone. Absent where none were.
Example 1250
withDriversLicenceinteger (int32)Checks run against a driver licence.
Example 1250
withPassportinteger (int32)Checks run against a passport.
Example 1250
withDriversLicenceAndPassportinteger (int32)Checks run against both.
Example 1250
levelstringThe level reached, where one was.
createdAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
updatedAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
A business buying on account, with its own legal identity and KYB state.
customerIdCustIdrequiredIdentifier of a customer.
Example cust_9f2Kd8QpLzXw
organisationIdOrgIdrequiredThe organisation this customer is, read at GET /organisations/{organisationId}.
Example org_9f2Kd8QpLzXw
merchantIdstringrequiredExample mcht_9f2Kd8QpLzXw
marketplaceIdstringThe marketplace the merchant sits under, where there is one.
Example mktp_9f2Kd8QpLzXw
referenceCustomerIdstringrequiredRequired on an organisation, unlike on a consumer, the domain makes it so.
Example your-own-reference
organisationNamestringrequiredRegistered legal name of the organisation.
Example Ada Lovelace
taxIdstringrequiredThe business profile, which carries the trading address and the contact person.
typeenumrequiredCustBusinessProfileAttributeslegalNamestringrequiredRegistered legal name, as it appears against the business registration number.
Example Ada Lovelace
businessRegistrationNumberstringrequiredABN in Australia, NZBN in New Zealand.
taxRegistrationNumberstringABN in Australia, IRD number in New Zealand. Absent where the business has not supplied one.
businessTypeMchtBusinessTyperequiredCompanyIndividualSoleTraderPartnershipTrustUnknowncompanyTypestringRequired when businessType is Company.
industrystringrequiredwebsitestringrequiredsupportSitestringrequiredWhere a payer goes for help with this business.
taxCountrystringrequiredISO 3166-1 alpha-2. Where the business is registered for tax.
Example AU
tradingCountrystringISO 3166-1 alpha-2. Only present where the business trades somewhere other than its tax country.
Example AU
Where the business is registered.
typeenumrequiredCustAddressAttributesunitNumberstringUnit, shop or level, as written on the building. Free text, 12, Shop 4, Level 3. Omit where there is none.
streetNumberstringrequiredStreet number, including any range or letter, 34, 34A, 34-36.
streetNamestringrequiredStreet name, without the type, Smith, not Smith Street.
Example Ada Lovelace
streetTypestringStreet, Road, Avenue. Optional because not every address has one.
suburbstringSuburb. This is where Australia and South Africa keep what other countries call the city.
citystringCity. Required in New Zealand. In Australia and South Africa send suburb instead, the platform moves whichever you send to where that country keeps it.
statestringState, province or territory. Required in Australia.
postalCodestringrequiredExample 3000
countrystringrequiredISO 3166-1 alpha-2.
Example AU
Who to contact at the business.
typeenumrequiredCustBusinessContactAttributestitlestringrequiredfirstNamestringrequiredExample Ada Lovelace
lastNamestringrequiredExample Ada Lovelace
emailAddressstringrequiredExample ada@example.com
supportEmailAddressstringWhere a payer's support enquiry goes, when it is not the contact address.
Example ada@example.com
phoneNumberstringrequiredPhone number in E.164 format, such as +61400000000.
Example +61400000000
timeZonestringrequiredThe business's own time zone, as an IANA name such as Australia/Sydney.
emailAddressstringAbsent when the caller may not see personal data.
Example ada@example.com
phoneNumberstringExample +61400000000
isVerifiedbooleanrequiredWhether the customer's contact details have been verified.
Example true
organisationKycedbooleanrequiredWhether the organisation itself has passed KYB.
Example true
organisationCreditCheckedbooleanrequiredWhether a credit check has been run against the organisation.
Example true
Identity checks attempted, by the evidence they were run with.
typeenumrequiredCustKycAttemptsAttributeswithoutDocumentinteger (int32)Checks run on name and address alone. Absent where none were.
Example 1250
withDriversLicenceinteger (int32)Checks run against a driver licence.
Example 1250
withPassportinteger (int32)Checks run against a passport.
Example 1250
withDriversLicenceAndPassportinteger (int32)Checks run against both.
Example 1250
levelstringThe level reached, where one was.
metadatamap of any JSON valueFree-form data the platform stores and returns untouched. Values may be nested objects and arrays.
createdAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
updatedAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
{
"type": "CustCreateRspAttributes",
"created": {
"type": "CustViewConsumer",
"customerId": "cust_9f2Kd8QpLzXw",
"personId": "pson_9f2Kd8QpLzXw",
"merchantId": "mcht_9f2Kd8QpLzXw",
"marketplaceId": "mktp_9f2Kd8QpLzXw",
"referenceCustomerId": "your-own-reference",
"givenName": "Ada Lovelace",
"middleName": "Ada Lovelace",
"familyName": "Ada Lovelace",
"emailAddress": "ada@example.com",
"phoneNumber": "+61400000000",
"isVerified": true,
"kycAttempts": {
"type": "CustKycAttemptsAttributes",
"withoutDocument": 1250,
"withDriversLicence": 1250,
"withPassport": 1250,
"withDriversLicenceAndPassport": 1250,
"level": "string"
},
"createdAt": "2026-08-19T04:21:07Z",
"updatedAt": "2026-08-19T04:21:07Z"
}
}Error responses
statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}