DocumentationPOST Import existing Sudo cards
Cards API
POST
/card-programmes/imported/importImport existing Sudo cards
Adopts the cardholders and cards already on your Sudo account. Only cards on the programme's funding source move; the rest are listed with the reason. Run with `dry_run: true` first.
Use your sandbox environment to start. Understand error codes and payment statuses before handling a live payment.
Import existing Sudo cards
curl --request POST "https://api.veyqo.org/api/v1/card-programmes/imported/import" \
--header "Authorization: Bearer $VEYQO_SECRET_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{
"dry_run": true
}'{
"success": true,
"data": {
"object": "card_import",
"dry_run": true,
"cardholders": {
"adopted": 120,
"existing": 0
},
"cards": {
"adopted": 118,
"existing": 0,
"skipped": [
{
"id": "6559f1a2c3d4e5f60718293c",
"reason": "It is on another funding source. Point that funding source at Veyqo, then import again."
}
]
}
}
}Illustrative examples. Replace IDs and environment variables with your own values. Keep secret keys on your server.
Headers
Authorizationstringrequired- Bearer <secret-key>. This key determines your project environment and must stay on your server.
Content-Typestringrequired- application/json
Acceptstringoptional- application/json
Endpoint
POST https://api.veyqo.org/api/v1/card-programmes/imported/import
Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted.
Request body
dry_runbooleanrequired- True reports only; false adopts.
Response fields
objectstringoptional- Always card_import.
dry_runbooleanoptional- See the JSON example.
cardholdersobjectoptional- adopted and existing counts.
cardsobjectoptional- adopted, existing, and skipped with a reason each.
Errors and recovery
| Code | HTTP | Recovery | Retry policy |
|---|---|---|---|
| INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. |
| INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. |
| RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. |
| METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. |
| INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. |
| VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. |
| CARDS_NOT_ENABLED | 403 | Ask Veyqo to turn cards on, set up a programme, or name one with `programme`. | No. |
| PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. |