Add card payment method

View as Markdown
Adds a new card payment method for a payee. Supports push-to-card payments with card number and expiry details. **Path Parameters** | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `payee_id` | UUID | Yes | ID of the payee to add the payment method to | **Request Body** | Field | Type | Required | Description | Validation Rules | |-------|------|----------|-------------|-----------------| | `card_number` | String | Yes | Card number | Must contain only digits (0-9). Must pass Luhn check | | `card_expiry_date` | String | Yes | Card expiry date in YYMM format | Must be 4 digits. Must be a future date | **Response Body** | Field | Type | Description | |-------|------|-------------| | `id` | UUID | Unique identifier for the payment method | | `payee_id` | UUID | ID of the payee associated with the payment method | | `card_last_four` | String | Last four digits of the card number (for cards) | | `card_expiry_date` | String | Expiry date of the card in YYMM format (for cards) | | `currency_code` | String | ISO 4217 currency code. Always `USD` — card payments are US-only. | | `country_code` | String | ISO 3166-1 alpha-2 country code. Always `US` — card payments are US-only. | | `verification_status` | String | Current verification status | | `is_default` | Boolean | Whether this is the default payment method for the payee | | `supported_rails` | Array | List of supported payment rails for this payment method | | `created_at` | DateTime | Timestamp when the payment method was created | | `updated_at` | DateTime | Timestamp when the payment method was last updated | | `warning` | String | Optional. Present on 207 responses when the payment method was created but not set as default | **Success Responses** | Status Code | Description | |-------------|-------------| | 201 | Created - The payment method was successfully added and set as default (if requested) | | 207 | Multi-Status - The payment method was created but not set as default because verification is pending or failed. Check `warning` for details. Clients may retry setting as default after verification completes. | **Error Responses** | Status Code | Error Code | Description | |-------------|------------|-------------| | 400 | CARD_VERIFICATION_FAILED | Card type not supported (e.g. credit instead of debit). User should provide a debit card. | | 400 | VALIDATION_ERROR | The provided data failed validation | | 401 | AUTHENTICATION_ERROR | Authentication credentials are invalid or missing | | 403 | AUTHORIZATION_ERROR | You do not have permission to perform this action | | 404 | NOT_FOUND | The specified payee was not found | | 409 | DUPLICATE_RESOURCE | A payment method with these details already exists | | 422 | INVALID_PAYMENT_DETAILS | The payment details are invalid or incomplete | | 503 | CARD_VERIFICATION_SERVICE_ERROR | Card verification service (tokenization, lookup) temporarily unavailable. **Retry with exponential backoff.** |

Authentication

x-api-keystring

RootPay API key sent in the x-api-key header. Keys are environment-scoped: live_* for production, test_* for sandbox.

Path parameters

payee_idstringRequiredformat: "uuid"

Query parameters

is_defaultbooleanOptionalDefaults to true
Whether to set this payment method as default

Request

This endpoint expects an object.
card_numberstringRequired<=16 characters
card_expiry_datestringRequired=4 characters
country_codeenumOptional

Country associated with this card payment method (ISO 3166-1 alpha-2)

Response

Card payment method created successfully
dataobject
warningstring or null