Payments.AddCreditCard

Try it in Swagger

Endpoint

Contacts created through Contact/Create or Registration/AddCustomer are granted Payments permission automatically. Existing contacts still need a Central DB APIUserPermissions row (PermissionId 4 for their own account, or 2 for another account).

Request Schema

Headers

Header Required Notes
X-Api-Key Required when tenant is not resolved by subdomain Resolves the tenant/customer database.
Authorization: Bearer {token} Required for authorized endpoints Get a token from Auth/Token or Session/Create.

JSON Body

Body type: AddCreditCardRequestDto

Field Type Required Max Length Notes
customerCode string Yes
cardNumber string Yes
expiration string Yes
cardType string Yes
billingZipCode string Yes
isDefault bool No
nickName string Yes

Request Sample

{
  "customerCode": "string",
  "cardNumber": "string",
  "expiration": "string",
  "cardType": "string",
  "billingZipCode": "string",
  "isDefault": false,
  "nickName": "string"
}

Expected Response Schema

Status Codes

Status Notes
200 OK Returned by the controller for this operation.
401 Unauthorized The caller lacks payment permission for the requested customer. Body is a plain string message: "You do not have permissions to add a payment".

Success Body

Response type: AddCreditCardResultDto

Field Type Max Length Notes
isSuccess bool
newCCId int
error string

When Customer Web Options has Disable Add Credit Card Payment Type enabled, isSuccess is false and error is "Adding Credit Card payment types is disabled for this organization."

Response Sample

{
  "isSuccess": false,
  "newCCId": 123,
  "error": "Card was declined."
}