---
updatedAt: 2026-07-28T19:19:05.000Z
agentTools:
  projectIndex: https://docs.coinme.com/llms.txt
---

# Adding a New Payment Method

<br />

<Callout icon="ℹ️" theme="info">
  ### Note:

  The webSessionID should be passed in Payment Methods API Request for Debit Transactions that need Sardine SDK integration.

  Ex: "webSessionId": "3680c9c4-af43-4fcf-aa80-984cd82080a8"
</Callout>

Method for adding a new card for the customer

Staging and Production environment URLs:

| Environment | API Host                                   |
| :---------- | :----------------------------------------- |
| Staging     | <https://secure.payments-stage.coinme.com> |
| Production  | <https://secure.payments.coinme.com>       |

Test cards for the staging environment [can be found here](https://docs.coinme.com/update/docs/cross-river-bank-supported-test-cards#/versions). 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'
'x-device-fingerprint: 56452672'
Request body:
{
    "providerId": "654987321",//required
    "customerId": "987987987", //required
    "card": {
        "cardNumber": "1234534324234567", //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": "123453******4567",
            "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

<Table align={["left","left"]}>
  <thead>
    <tr>
      <th>
        Error Code
      </th>

      <th>
        Error Message
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        231-500-313-000
      </td>

      <td>
        Unexpected internal error
      </td>
    </tr>

    <tr>
      <td>
        231-400-313-600
      </td>

      <td>
        Card already added and verified by another user
      </td>
    </tr>

    <tr>
      <td>
        231-400-313-601
      </td>

      <td>
        Card type is not supported
      </td>
    </tr>

    <tr>
      <td>
        231-400-313-602
      </td>

      <td>
        Invalid account id
      </td>
    </tr>

    <tr>
      <td>
        231-400-313-603
      </td>

      <td>
        Invalid partner id
      </td>
    </tr>

    <tr>
      <td>
        231-400-313-644
      </td>

      <td>
        Input data is not properly encrypted
      </td>
    </tr>

    <tr>
      <td>
        231-400-313-667
      </td>

      <td>
        REST request validation error, such as missing parameter<br />(header, query param, field in request body)

        or invalid param format
      </td>
    </tr>

    <tr>
      <td>
        231-400-313-666
      </td>

      <td>
        General REST request malformed error
      </td>
    </tr>
  </tbody>
</Table>

<br />

<br />