Create Payment Method
POST/api/portal/payment-methods
Save a card on the active account. opaque_data (required) is the single-use {data_descriptor, data_value} token from Authorize.net's hosted card form; consent (required, must be true) records the buyer's authorization (with their IP); is_default (optional) makes it the default card; cardholder_name optional. Only available when Get Payment Config returns can_save_cards: true. Throttled to 10 per minute.
Called by a B2B portal buyer with the bearer token POST /api/portal/auth/login returns (or the buyer's feed key) — not with a staff Personal Access Token.
Returns 201 with the saved card (same fields as List Payment Methods). Returns 422 for validation errors, and 422 with {error, message, reason, context} when the card can't be saved: reason is consent_required, cannot_save_cards (saving cards is off for this account), card_required (no card form data) or card_not_saved (the card was declined during verification, the card form timed out, or the processor could not be reached).
Request
Responses
- 201
- 401
- 403
- 422
- 429
Created
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.