> For the complete documentation index, see [llms.txt](https://docs.digitalriver.com/commerce-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalriver.com/commerce-api/shopper-apis/cart/creating-or-updating-a-cart/managing-payment-methods.md).

# Managing payment methods

## Getting the available payment methods for the cart

To offer various payment options for customers, it's crucial to retrieve the available payment methods for the cart. This guide will walk you through accessing these methods using the Commerce API. By following the instructions below, you can easily integrate this functionality into your application and enhance the checkout experience for your users.

To get the available payment methods for your cart, send a [`GET /v1/shoppers/me/carts/active/payment-methods`](https://docs.digitalriver.com/commerce-api-references/shopper-apis/cart/payment-methods#v1-shoppers-me-carts-active-payment-methods) request and include `{Your_API_Key}` in the header. Here's an example using cURL:

{% tabs %}
{% tab title="cURL" %}

```http
curl --location -g --request GET ' https://api.digitalriver.com/v1/shoppers/me/carts/active/payment-methods' \
--header 'Authorization: Basic {Your_API_Key}' \
...
```

{% endtab %}

{% tab title="200 OK response" %}

```json
{
  "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/payment-methods",
  "applyPaymentMethod": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/apply-payment-method"
  },
  "paymentMethod": [
    {
      "type": "americanExpress",
      "displayName": "American Express",
      "description": "American Express"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

A successful response will return a JSON object with the available payment methods and related information. See the [query parameters](https://docs.digitalriver.com/commerce-api-references/shopper-apis/cart/payment-methods#v1-shoppers-me-carts-active-payment-methods) for more information.

To add an organization identifier to a cart, send a [`POST /shoppers/me/carts/active`](https://docs.digitalriver.com/commerce-api-references/shopper-apis/cart/carts#v1-shoppers-me-carts-active-1) request. Include `{Your_API_Key}` in the header and the `organizationId` field in the request payload. The `organizationId` will be passed to the payment session to make specific payment methods available. Here's an example using cURL:

{% tabs %}
{% tab title="cURL" %}

```json
curl --location --request POST 'https://api.digitalriver.com/shoppers/me/carts/active' \
--header 'Content-Type:  application/json' \
--header 'authorization: Basic  {Your_API_Key}\
--data-raw '{
	"cart": {
			"organizationId": "Acme_Inc",
			"lineItems": {
					"lineItem":
							{
									"quantity": "1",
									"product": {
											"id": "5326162000"
									}
							}
			}
		}
}'
```

{% endtab %}

{% tab title="200 OK response" %}
A successful request returns a `200 OK` response.

```json
{
  "cart": {
    ...
    "organizationId": "Acme_Inc"
  }
}
```

{% endtab %}
{% endtabs %}

A successful request returns a `200 OK` response with the updated `organizationId` in the cart. See the [Update the current cart](https://docs.digitalriver.com/commerce-api-references/shopper-apis/cart/carts#v1-shoppers-me-carts-active-1) for more information.

To remove an organization identifier from the cart, send a [`POST /shoppers/me/carts/active`](https://docs.digitalriver.com/commerce-api-references/shopper-apis/cart/carts#v1-shoppers-me-carts-active-1) request. Include `{Your_API_Key}` in the header. Set the `organizationId` field to an empty string in the request payload. This will delete the organization identifier from the cart, resulting in a `200 OK` response if successful. Here's an example using cURL:
