> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Payments API - Hands-on Lab

Lesson 9 of 26 · 30 min

## Payments API

The Payments API enables you to process payments through the store's connected payment gateway. A payment can be taken for an order that is created using either the Server to Server Checkout API Orders endpoint or creating an order using V3 orders endpoint.

### **In this lab, you will:**

* Create a payment access token
* Get payment methods
* Process payment for an order
* Get all store payment methods

### Prerequisites

* BigCommerce store (sandbox or live)
* API credentials for the store
* REST client (Postman)
* Configure a payment gateway in your store's payment settings, such as Braintree, PayPal, or Stripe.

> **Info**
>
> If you are unable to configure a payment gateway, you can follow all steps in this lab except the final payment processing step.

## Get Payment Methods for an Order

1. **Copy** and **paste** the request below into Postman

```http showLineNumbers={false}
https://api.bigcommerce.com/stores/{{store_hash}}/v3/payments/methods?order_id={order_id}
```

2. **Replace** `{order_id}` with an order ID
3. **Select** GET next to the request url
4. **Click** the Send button
5. **Observe** response and a list of payment methods

![Image](/_fern-img/f9aa510ecf4f4d94ddd9c5ed923909a7bdb6c34c518246268167910514e9c5f9.webp)

## Create a Payment Access Token

1. **Copy** and **paste** the request below into Postman

```http showLineNumbers={false}
https://api.bigcommerce.com/stores/{{store_hash}}/v3/payments/access_tokens
```

2. **Copy** and **paste** the code below into the body section of Postman

```json showLineNumbers={false}
{
    "order": {
    "id": {order_id}
    }
}
```

3. **Replace** `{order_id}` with an order ID
4. **Select** POST next to the request url
5. **Click** the Send button
6. **Observe** response and copy the payment access token

![Image](/_fern-img/5728d7644c2ada6e605f2aed3b6e6b524cf177b5309f151f7bb27c7225336bef.webp)

## Process a Credit Card Payment for an Order

1. **Copy** and **paste** the request below into Postman

```http showLineNumbers={false}
https://payments.bigcommerce.com/stores/{{store_hash}}/payments
```

2. **Add** the following request headers

| Field         | Value                                                                   |
| ------------- | ----------------------------------------------------------------------- |
| Accept        | application/vnd.bc.v1+json                                              |
| Content-Type  | application/json                                                        |
| Authorization | PAT (then paste the payment access token) ex. PAT `{your-access-token}` |

3. **Copy** and **paste** the code below into the body section of Postman

```json showLineNumbers={false}
{
    "payment": {
        "instrument": {
            "type": "card",
            "number": "4111111111111111",
            "cardholder_name": "Jane",
            "expiry_month": 12,
            "expiry_year": 2024,
            "verification_value": "411"
        },
        "payment_method_id": "testgateway.card"
    }
}
```

4. **Select** POST next to the request URL
5. **Click** the Send button
6. **Observe** response