APG PayAPG Paydocs

Customers

Create customers

POST/customers

Create 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.

2 actionsCustCmdCreateConsumerCustCmdCreateOrganisation

Permissions

Required permission
merchantCustomers:upsert

Requires 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.

Discriminated by type
type = "CustCmdCreateConsumer"
merchantIdstringrequired

Example mcht_9f2Kd8QpLzXw

givenNamestring

Named as the view names it. The domain's own input says firstName; one vocabulary is better than two.

Example Ada Lovelace

middleNamestring

Example Ada Lovelace

familyNamestringrequired

Example Ada Lovelace

emailAddressstringrequired

Example ada@example.com

phoneNumberstring

Kept 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

referenceCustomerIdstring

Example your-own-reference

isVerifiedboolean

Whether 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.

Discriminated by type
type = "CustCreateRspAttributes"

The resource that was created.

Example
{
  "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