Create API keys
/api-keysIssue a token. The secret is on the response and nowhere else, ever.
Permissions
serviceTokens:createRequires the `create` action on `serviceTokens` for the supplied runtime context
Request body
This body is a tagged shape: type is always "ApiKeyCmdCreate". Send it; more variants can be added, and a caller that switches on it keeps working when they are.
typetype = "ApiKeyCmdCreate"descriptionstringrequiredWhat the token is for. This is the only way to tell two secrets apart later, so make it specific.
typeAn enterprise's key. Reaches every marketplace and merchant in the enterprise.
enterpriseIdEntIdrequiredIdentifier of an enterprise.
Example ent_9f2Kd8QpLzXw
A marketplace's key. Reaches every merchant in the marketplace.
marketplaceIdMktpIdrequiredIdentifier of a marketplace.
Example mktp_9f2Kd8QpLzXw
A merchant's publishable key, safe to put in a browser. Its value is returned on every read.
merchantIdMchtIdrequiredIdentifier of a merchant.
Example mcht_9f2Kd8QpLzXw
A merchant's secret key.
merchantIdMchtIdrequiredIdentifier of a merchant.
Example mcht_9f2Kd8QpLzXw
typeOnly these actions, on only these resources. Cannot grant anything the issuing credential lacks.
typeenumrequiredApiKeyGrantAttributesresourceApiKeyResourcerequiredThe resource this grant is over.
BlockedCardCustomerDelegatesDisputesEnterprisesFilesFxRatesLoanFacilitiesLoanProductsLoanTransactionsLoanMasterAgreements+57 moreShow fewer
Loans, LoanStatements, CreditCards, Marketplaces, MarketplaceUsers, Merchants, MerchantCustomers, MerchantKYB, MerchantPaymentProfiles, MerchantFinancials, MerchantBillingPaymentSource, MerchantState, MerchantUsers, Orders, CustomerPaymentSources, TemporaryPaymentSources, PaymentTokens, PayCards, PayPlans, PayToAgreements, Reports, Queues, Simulations, Refunds, MerchantServiceTokens, MarketplaceServiceTokens, EnterpriseServiceTokens, SourceVerifications, SystemJournals, SystemJournalEntries, SystemLedgers, SystemLedgerEntries, Transactions, IssuerTransactions, IssuerTransactionDiscrepancies, WebhookMerchantSubscriptions, WebhookMarketplaceSubscriptions, WebhookSubscriptions, Sessions, ServiceTokens, ReferenceData, Users, Roles, OidcIdps, ReportsAcquiring, ReportsLending, ReportsIssuing, ReportsCustomers, ReportsOperations, ReportsOversight, Organisations, Persons, Suppliers, Rules, MerchantStatementPasswords, MerchantTravelData, Unknown
actionsarray of ApiKeyActionThe actions this grant allows on the resource.
QuerySearchViewPIICreateUpsertUpsertMinimalUpsertPluginApplyActivateUpdate+11 moreShow fewer
UpdatePermissions, Link, Delete, Verify, Impersonate, Simulate, Pay, Transfer, SpecifySurcharge, Orchestrate, Unknown
Everything the issuing credential's own policy allows. The token is as capable as its issuer, and no more.
Everything the issuing credential's own policy allows. The token is as capable as its issuer, and no more.
expiresAtstring (date-time)When it stops working. Omit for a token that does not expire.
Example 2026-08-19T04:21:07Z
curl -X POST https://api.tst.au.apgpay.dev/api-keys \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "ApiKeyCmdCreate",
"description": "string",
"scope": {
"type": "ApiKeyScopeEnterprise",
"enterpriseId": "ent_9f2Kd8QpLzXw"
},
"permissions": {
"type": "ApiKeyPermissionsExplicit",
"grants": [
{
"type": "ApiKeyGrantAttributes",
"resource": "BlockedCard",
"actions": [
"Query"
]
}
]
},
"expiresAt": "2026-08-19T04:21:07Z"
}'Responses
The response is a tagged shape: type is always "ApiKeyCreateRspIssued". Switch on it; subtypes can be added, and a client that already reads it will not break.
typetype = "ApiKeyCreateRspIssued"The token as it will read from now on.
typeenumrequiredApiKeyViewAttributesapiKeyIdApiKeyIdrequiredIdentifier of a service token.
Example key_9f2Kd8QpLzXw
descriptionstringrequiredWhat the token is for, in words. This is how you tell two secrets apart, there is nothing else.
typeAn enterprise's key. Reaches every marketplace and merchant in the enterprise.
enterpriseIdEntIdrequiredIdentifier of an enterprise.
Example ent_9f2Kd8QpLzXw
A marketplace's key. Reaches every merchant in the marketplace.
marketplaceIdMktpIdrequiredIdentifier of a marketplace.
Example mktp_9f2Kd8QpLzXw
A merchant's publishable key, safe to put in a browser. Its value is returned on every read.
merchantIdMchtIdrequiredIdentifier of a merchant.
Example mcht_9f2Kd8QpLzXw
A merchant's secret key.
merchantIdMchtIdrequiredIdentifier of a merchant.
Example mcht_9f2Kd8QpLzXw
typeOnly these actions, on only these resources. Cannot grant anything the issuing credential lacks.
typeenumrequiredApiKeyGrantAttributesresourceApiKeyResourcerequiredThe resource this grant is over.
BlockedCardCustomerDelegatesDisputesEnterprisesFilesFxRatesLoanFacilitiesLoanProductsLoanTransactionsLoanMasterAgreements+57 moreShow fewer
Loans, LoanStatements, CreditCards, Marketplaces, MarketplaceUsers, Merchants, MerchantCustomers, MerchantKYB, MerchantPaymentProfiles, MerchantFinancials, MerchantBillingPaymentSource, MerchantState, MerchantUsers, Orders, CustomerPaymentSources, TemporaryPaymentSources, PaymentTokens, PayCards, PayPlans, PayToAgreements, Reports, Queues, Simulations, Refunds, MerchantServiceTokens, MarketplaceServiceTokens, EnterpriseServiceTokens, SourceVerifications, SystemJournals, SystemJournalEntries, SystemLedgers, SystemLedgerEntries, Transactions, IssuerTransactions, IssuerTransactionDiscrepancies, WebhookMerchantSubscriptions, WebhookMarketplaceSubscriptions, WebhookSubscriptions, Sessions, ServiceTokens, ReferenceData, Users, Roles, OidcIdps, ReportsAcquiring, ReportsLending, ReportsIssuing, ReportsCustomers, ReportsOperations, ReportsOversight, Organisations, Persons, Suppliers, Rules, MerchantStatementPasswords, MerchantTravelData, Unknown
actionsarray of ApiKeyActionThe actions this grant allows on the resource.
QuerySearchViewPIICreateUpsertUpsertMinimalUpsertPluginApplyActivateUpdate+11 moreShow fewer
UpdatePermissions, Link, Delete, Verify, Impersonate, Simulate, Pay, Transfer, SpecifySurcharge, Orchestrate, Unknown
Everything the issuing credential's own policy allows. The token is as capable as its issuer, and no more.
Everything the issuing credential's own policy allows. The token is as capable as its issuer, and no more.
statusApiKeyStatusrequiredEnabledDisabledUnknownvaluestringThe token itself, where the platform holds it in the clear, always for a publishable key, and for a merchant secret key too, which is how a dashboard shows a merchant its own. A token stored as a salted hash is never returned. Treat this field as sensitive on every read.
expiresAtstring (date-time)Example 2026-08-19T04:21:07Z
createdBystringThe user who created it. Absent for tokens the platform generated itself.
createdAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
updatedAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
secretstringrequiredThe secret. Returned once, here, and never retrievable again, store it now.
{
"type": "ApiKeyCreateRspIssued",
"created": {
"type": "ApiKeyViewAttributes",
"apiKeyId": "key_9f2Kd8QpLzXw",
"description": "string",
"scope": {
"type": "ApiKeyScopeEnterprise",
"enterpriseId": "ent_9f2Kd8QpLzXw"
},
"permissions": {
"type": "ApiKeyPermissionsExplicit",
"grants": [
{
"type": "ApiKeyGrantAttributes",
"resource": "BlockedCard",
"actions": [
"Query"
]
}
]
},
"status": "Enabled",
"value": "string",
"expiresAt": "2026-08-19T04:21:07Z",
"createdBy": "string",
"createdAt": "2026-08-19T04:21:07Z",
"updatedAt": "2026-08-19T04:21:07Z"
},
"secret": "string"
}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"
}