Add Payment Card to Apple Wallet
This endpoint provisions a Netevia payment card into Apple Wallet using the Apple Pay in-app provisioning flow. The caller supplies the payment card identifier along with the cryptographic certificates, nonce, and nonce signature generated by the PassKit framework on the device. Netevia forwards these values to the card network to complete the tokenization handshake.
Endpoint
POST /api/paymentCards/addToAppleWallet
Authentication
Bearer token required. Obtain via:
POST https://api.banking.netevia.dev/api/auth/v2
Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.
When to use
Use this endpoint when a mobile application user initiates an "Add to Apple Wallet" action for one of their Netevia payment cards. It should be called after the iOS PassKit framework returns the leaf and sub-CA certificates, nonce, and nonce signature from PKAddPaymentPassViewController. This applies to Physical, Virtual, and Burner card types.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| paymentCardId | string | Yes | Unique identifier of the Netevia payment card to be provisioned into Apple Wallet. Minimum length: 1. |
| sertificates | array of strings | Yes | Array of Base64-encoded DER certificate strings provided by the iOS PassKit framework (leaf certificate and sub-CA certificate). |
| nonce | string | No | Base64-encoded nonce value returned by PassKit during the provisioning request. |
| nonceSignature | string | No | Base64-encoded signature of the nonce, returned by PassKit during the provisioning request. |
{
"paymentCardId": "card_a1b2c3d4e5f6g7h8",
"sertificates": [
"MIICxDCCAaygAwIBAgIIVqpBMEGKfmwwDQYJKoZIhvcNAQELBQAwIzEhMB8GA1UE...",
"MIIBwjCCAWigAwIBAgIIR5VqBNEGKfmwwCgYIKoZIzj0EAwIwIzEhMB8GA1UE..."
],
"nonce": "bm9uY2VWYWx1ZUhlcmU=",
"nonceSignature": "c2lnbmF0dXJlVmFsdWVIZXJl"
}Response
200 OK
A 200 response indicates the provisioning request was successfully submitted to the card network. The response body confirms success and may contain the encrypted pass data required to complete the PassKit provisioning flow on the device.
| Field | Type | Description |
|---|---|---|
| (response payload) | object | Encrypted card provisioning data returned by the card network, to be passed back to the PassKit framework to complete Apple Wallet provisioning. |
{
"success": true
}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing required fields (paymentCardId or sertificates), invalid certificate format, or validation error |
| 401 | Token missing, expired, or invalid |
| 403 | Caller does not have permission to provision the specified card |
| 404 | Payment card not found for the given paymentCardId |
| 500 | Internal server error or card network provisioning failure |
Common Mistakes
- Misspelling the
sertificatesfield — the schema usessertificates(notcertificates); sending the correct spelling will cause the field to be ignored and return a 400 error. - Sending an empty array for
sertificates— at least the leaf certificate and sub-CA certificate from PassKit must be included. - Calling this endpoint before the iOS PassKit framework has returned the certificates, nonce, and nonce signature; collect all values from
PKAddPaymentPassViewControllerDelegatefirst. - Using a card ID that belongs to a different customer's account — the token's identity must match the cardholder who owns the specified
paymentCardId.
Related Endpoints
POST /api/paymentCards/addToGoogleWallet— Provision a payment card into Google WalletGET /api/paymentCards/{paymentCardId}— Retrieve details and current status of a payment cardPOST /api/paymentCards— Create a new Virtual or Burner payment card
Example
curl -X POST https://api.banking.netevia.dev/api/paymentCards/addToAppleWallet \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"paymentCardId": "card_a1b2c3d4e5f6g7h8",
"sertificates": [
"MIICxDCCAaygAwIBAgIIVqpBMEGKfmwwDQYJKoZIhvcNAQELBQAwIzEhMB8GA1UE...",
"MIIBwjCCAWigAwIBAgIIR5VqBNEGKfmwwCgYIKoZIzj0EAwIwIzEhMB8GA1UE..."
],
"nonce": "bm9uY2VWYWx1ZUhlcmU=",
"nonceSignature": "c2lnbmF0dXJlVmFsdWVIZXJl"
}' 200Success
