APG PayAPG Paydocs

Identity

Create customer API keys

POST/customer-api-keys

Issue an API key to a customer. The key is on the response and nowhere else, ever.

Permissions

Required permission
merchantCustomers:update

Requires the `update` action on `merchantCustomers` for the supplied runtime context

Request body

This body is a tagged shape: type is always "CustkeyCmdIssue". Send it; more variants can be added, and a caller that switches on it keeps working when they are.

Discriminated by type
type = "CustkeyCmdIssue"
customerIdCustIdrequired

Identifier of a customer.

Example cust_9f2Kd8QpLzXw

curl -X POST https://api.tst.au.apgpay.dev/customer-api-keys \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "CustkeyCmdIssue",
  "customerId": "cust_9f2Kd8QpLzXw"
}'

Responses

The response is a tagged shape: type is always "CustkeyAttributes". Switch on it; subtypes can be added, and a client that already reads it will not break.

Discriminated by type
type = "CustkeyAttributes"
customerIdCustIdrequired

Identifier of a customer.

Example cust_9f2Kd8QpLzXw

apiKeystringrequired

The key. Store it now: nothing returns it again, and nothing can take it away.

Example
{
  "type": "CustkeyAttributes",
  "customerId": "cust_9f2Kd8QpLzXw",
  "apiKey": "string"
}

Error responses