Appearance
/payment
Add a payment method to a user.
HTTP Request
POST https://api.q2open.io/v1/payment
Arguments
Parameter | Description |
---|---|
clientId | ID of the client to add a payment method to. |
paymentType | Type of payment. Possible values are card , bank . |
identifier | Optional - custom identifier for external system correlation. |
cardNumber | Credit card number. |
cardCode | Credit card CVV. |
expMonth | Credit card expiration month formatted as XX . |
expYear | Credit card expiration year formatted as XXXX . |
zipcode | Credit card zipcode. |
name | The name as it appears on the payment account. |
routingNumber | Bank routing number. |
accountNumber | Bank account number. |
accountType | Type of bank account. Possible values are checking , savings . |
setAsDefault | Set this payment method as the default. |
customLabel | Used for letting the user set a custom display name for this account. |
Returns
Returns an object with a paymentMethodId
property if the payment method was successfully added. Returns an error otherwise.
Example Card Request
shell
curl "https://api.q2open.io/v1/payment" \
-H "Authorization: Bearer dc220490-e6ee-11e5-8a94-e7385a8d929e" \
-H "Content-Type: application/json" \
-d '{
"clientId": "56e1ddbd1a05319bc198d36f",
"paymentType": "card",
"identifier": "optional_custom_identifier",
"cardNumber": "378282246310005",
"cardCode": "218",
"expMonth": "10",
"expYear": "2017",
"zipcode": "12345",
"name": "Demo User",
"setAsDefault": true,
"customLabel": "Entertainment Rewards Card"
}'
Example Bank Request
shell
curl "https://api.q2open.io/v1/payment" \
-H "Authorization: Bearer dc220490-e6ee-11e5-8a94-e7385a8d929e" \
-H "Content-Type: application/json" \
-d '{
"clientId": "56e1ddbd1a05319bc198d36f",
"paymentType": "bank",
"identifier": "optional_custom_identifier",
"routingNumber": "021000021",
"accountNumber": "9900000002",
"accountType": "checking",
"name": "Demo User",
"customLabel": "For Utilities"
}'
Example Response
json
{
"paymentMethodId": "56e1ddbd1a05319bc198d36f"
}