Adding a New Payment Method

Method for adding a new card for the customer

Staging and Production environment URLs:

Test cards for the staging environment can be found here. Test card expiration dates and CVVs can have any value

firstName and lastName are marked as optional since if they are not provided, the user’s first and last name are taken from the user’s profile.

The cardNumber and cvv must be sent unencrypted. The endpoint provided will proxy the call through a 3rd party encryption service and Coinme will receive an encrypted cardNumber and cvv. When Coinme calls the payment provier, the call is again proxied through the 3rd party encryption service, this time to decrypt the cardNumber and cvv as they are being sent to the payment provider. Coinme will never obtain, store or posses the unencrypted cardNumber or cvv.

In addition, the "paymentProcessAssociation" is used to indicate if the initial transaction the user wants to perform with this card is a buy or a sell. This is done so that Coinme can immediatelly check if the card the user provided actually supports the desired transaction. Please note, if the request specifies "paymentProcessAssociation" : "SELL", that card can still be used for buys (if a "push" to the card is supported by the card provider). This parameter is only used to check against the first desired transaction so the process of adding a card can be skipped if the user would like to execute a SELL with a card that only supports "push" actions.

Sample API Request: POST

URL: https://secure.payments-stage.coinme.com/services/paymentmethods
headers:
"Authorization":"asdfghj", //authorization token, required
'User-Agent: partnerapi' //required
'Content-Type: application/json'
Request body:
{
    "providerId": "654987321",//required
    "customerId": "987987987", //required
    "card": {
        "cardNumber": "12345343242", //required
        "month": "01", //required
        "year": "2024", //required
        "cvv": "123" //required
    }, //required
    "billingAddress": {
        "firstName": "John", //optional
        "lastName": "Doe", //optional
        "country": "US", //required
        "addressLine1": "11 Creekside St.", //required
        "addressLine2": "Additional line", //optional
        "zipCode": "33414", //required
        "city": "West Palm Beach", //required
        "state": "FL" //required
    }, //required
    "paymentProcessAssociation": "SELL" // enum, could be BUY or SELL
}

Sample API Response:

Successful Response:
{
  "data": 
  {
    "customerId":"34567890",
    "partnerId":"30157493212106",
    "paymentMethod": {
        "paymentMethodId": "123456",
        "providerId": "654987321",
        "providerName": "Provider Name",
        "type": "DEBIT", // currently can only be DEBIT. CREDIT and PREPAID will be available in the future 
        "cardProvider": "Visa",
        "card": {
            "cardNumber": "123412321",
            "month": "03",
            "year": "2024"
        },
        "billingAddress": {
            "firstName": "John",
            "lastName": "Doe",
            "country": "US",
            "addressLine1": "11 Creekside St.",
            "addressLine2": "Additional line",
            "zipCode": "33414",
            "city": "West Palm Beach",
            "state": "FL"
        },
        "status": "VERIFIED", //enum, could be [CREATED, VERIFIED, DECLINED, STAGED, DELETED]
        "buySupported": false, 
        "sellSupported": true,
        "createdAt": 1714560970 //timestamp in millis
    }
  },
  "errorResponse": null
}
Failure Response:
{
  "data": null,
  "errorResponse": {
    "httpStatus":"200",
    "timestamp":"2022-02-01T18:59:28.297Z",//UTC
    "path":"/external/partners/v1/payment-method",
    "errorData": [
      {
        "errorCode":"123-123-123-123", //The error code is just a sample showing the structure of the error code.
        "message":"Invalid customer id"
      }
    ]
  }
}

Error Codes

Error Code

Error Message

231-500-313-000

Unexpected internal error

231-400-313-600

Card already added and verified by another user

231-400-313-601

Card type is not supported

231-400-313-602

Invalid account id

231-400-313-603

Invalid partner id

231-400-313-667

REST request validation error, such as missing parameter
(header, query param, field in request body)

or invalid param format

231-400-313-666

General REST request malformed error