> 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.

# Process Payments

POST https://payments.bigcommerce.com/stores/{store_hash}/payments
Content-Type: application/json

Process payments for an order. See [Payment Processing](/developer/docs/admin/checkout-and-cart/payments) for more information.

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/admin/payments/processing/payments-post

## Authentication

- `Authorization` header (bearer token, required) — ### OAuth scopes The required scopes are granted to the `payment_access_token` upon generation. ### Authentication header | Header | Argument | Description | | :-------------- | :----------------------------- | :----------------------------------------------- | | `Authorization` | `PAT {{PAYMENT_ACCESS_TOKEN}}` | Obtained using the Create Access Token endpoint. | ### Further reading For an outline of the Process Payment API call flow and more information about authenticating, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#bigcommerce-generated-jwts). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

## Request

### Path parameters

- `store_hash` (string, required) — Permanent ID of the BigCommerce store.

### Headers

- `Accept` (enum, required, default: application/vnd.bc.v1+json) — This required value must be `application/vnd.bc.v1+json`.
  - Allowed values: `application/vnd.bc.v1+json`

### Body (application/json)

This endpoint expects an object.

- `payment` (PaymentsPostRequestBodyContentApplicationJsonSchemaPayment, required)

## Response

### 202

Payment has been successfully processed

- `id` (string, optional) — Identifier for this transaction
- `transaction_type` (enum, optional) — Transaction type for this payment
  - Allowed values: `authorization`, `purchase`
- `status` (enum, optional) — Status to indicate a success response
  - Allowed values: `success`, `pending`

## Errors

### 400 Bad Request Error

Payment request has been rejected due to malformed request

- `status` (integer, required) — HTTP status code
- `title` (string, required) — Short summary describing the particular error
- `type` (string, required) — Reference that identifies the particular error
- `detail` (string, optional) — Detailed summary describing the particular error
- `code` (integer, optional) — BigCommerce payment error code. See Error codes.
- `errors` (PaymentsPostResponsesContentApplicationJsonSchemaErrors, optional)

### 401 Unauthorized Error

Valid authentication required

- `status` (integer, required) — HTTP status code
- `title` (string, required) — Short summary describing the particular error
- `type` (string, required) — Reference that identifies the particular error
- `detail` (string, optional) — Detailed summary describing the particular error
- `code` (integer, optional) — BigCommerce payment error code. See Error codes.
- `errors` (PaymentsPostResponsesContentApplicationJsonSchemaErrors, optional)

### 422 Unprocessable Entity Error

Payment request has been rejected due to missing, invalid data or declined by payment provider

- `status` (integer, required) — HTTP status code
- `title` (string, required) — Short summary describing the particular error
- `type` (string, required) — Reference that identifies the particular error
- `detail` (string, optional) — Detailed summary describing the particular error
- `code` (integer, optional) — BigCommerce payment error code. See Error codes.
- `errors` (PaymentsPostResponsesContentApplicationJsonSchemaErrors, optional)

## Types

### PaymentsPostRequestBodyContentApplicationJsonSchemaPayment

- `instrument` (PaymentsPostRequestBodyContentApplicationJsonSchemaPaymentInstrument, required)
- `payment_method_id` (string, required) — Identifier for payment method that will be used for this payment and `id` from the Get Accepted Payment Methods API
- `save_instrument` (boolean, optional) — To use `save_instrument`, configure the payment gateway to accept stored cards.

### PaymentsPostResponsesContentApplicationJsonSchemaErrors

### PaymentsPostRequestBodyContentApplicationJsonSchemaPaymentInstrument

### Card

- `type` (string, optional, default: card) — Type to classify this payment instrument (required)
- `cardholder_name` (string, optional) — Cardholderʼs full name (required)
- `number` (string, optional) — Credit card number (required)
- `expiry_month` (integer, optional) — Expiry month of this card (required)
- `expiry_year` (integer, optional) — Expiry year of this card (required)
- `verification_value` (string, optional) — Verification value of this card (CVV)
- `issue_month` (integer, optional) — Issue month of this card
- `issue_year` (integer, optional) — Issue year of this card
- `issue_number` (integer, optional) — Issue number of this card

### StoredCard

- `type` (string, optional, default: stored_card) — Type to classify this payment instrument (required)
- `token` (string, optional) — Identifier representing this stored card (required)
- `verification_value` (string, optional) — Verification value of this card (CVV)

### StoredPayPalAccount

- `type` (enum, optional) — Type to classify this payment instrument (required)
  - Allowed values: `stored_paypal_account`
- `token` (string, optional) — Identifier representing this stored PayPal account (required)

### GiftCertificate

- `type` (string, optional)
- `gift_certificate_code` (string, optional)

### StoreCredit

- `type` (string, optional)

### TokenizedCard

- `type` (enum, required) — Type to classify this payment instrument (required).
  - Allowed values: `tokenized_card`
- `token` (string, required) — Identifier representing the tokenized card (required).
- `iin` (string, optional) — Issuer identification number.
- `last_four_digits` (string, optional) — Last four numbers of this card.
- `expiration_month` (string, optional) — Expiry month of this card.
- `expiration_year` (string, optional) — Expiry year of this card.

### StoredBankAccount

- `type` (enum, optional) — Type to classify this payment instrument (required)
  - Allowed values: `stored_bank_account`
- `token` (string, optional) — Identifier representing this stored bank account (required)

## Examples

### Card

**Request**

```json
{
  "payment": {
    "instrument": {
      "cardholder_name": "Jane Doe",
      "expiry_month": 12,
      "expiry_year": 2020,
      "number": "4111111111111111",
      "type": "card",
      "verification_value": "411"
    },
    "payment_method_id": "authorizenet.card",
    "save_instrument": true
  }
}
```

**Response**

```json
{
  "id": "227d9e1e-94f8-408c-95a5-f97b30592eb7",
  "transaction_type": "authorization",
  "status": "pending"
}
```

**SDK Code**

```python Card
import requests

url = "https://payments.bigcommerce.com/stores/store_hash/payments"

payload = { "payment": {
        "instrument": {
            "cardholder_name": "Jane Doe",
            "expiry_month": 12,
            "expiry_year": 2020,
            "number": "4111111111111111",
            "type": "card",
            "verification_value": "411"
        },
        "payment_method_id": "authorizenet.card",
        "save_instrument": True
    } }
headers = {
    "Accept": "application/vnd.bc.v1+json",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Card
const url = 'https://payments.bigcommerce.com/stores/store_hash/payments';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/vnd.bc.v1+json',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"payment":{"instrument":{"cardholder_name":"Jane Doe","expiry_month":12,"expiry_year":2020,"number":"4111111111111111","type":"card","verification_value":"411"},"payment_method_id":"authorizenet.card","save_instrument":true}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Card
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://payments.bigcommerce.com/stores/store_hash/payments"

	payload := strings.NewReader("{\n  \"payment\": {\n    \"instrument\": {\n      \"cardholder_name\": \"Jane Doe\",\n      \"expiry_month\": 12,\n      \"expiry_year\": 2020,\n      \"number\": \"4111111111111111\",\n      \"type\": \"card\",\n      \"verification_value\": \"411\"\n    },\n    \"payment_method_id\": \"authorizenet.card\",\n    \"save_instrument\": true\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/vnd.bc.v1+json")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Card
require 'uri'
require 'net/http'

url = URI("https://payments.bigcommerce.com/stores/store_hash/payments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/vnd.bc.v1+json'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payment\": {\n    \"instrument\": {\n      \"cardholder_name\": \"Jane Doe\",\n      \"expiry_month\": 12,\n      \"expiry_year\": 2020,\n      \"number\": \"4111111111111111\",\n      \"type\": \"card\",\n      \"verification_value\": \"411\"\n    },\n    \"payment_method_id\": \"authorizenet.card\",\n    \"save_instrument\": true\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Card
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://payments.bigcommerce.com/stores/store_hash/payments")
  .header("Accept", "application/vnd.bc.v1+json")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payment\": {\n    \"instrument\": {\n      \"cardholder_name\": \"Jane Doe\",\n      \"expiry_month\": 12,\n      \"expiry_year\": 2020,\n      \"number\": \"4111111111111111\",\n      \"type\": \"card\",\n      \"verification_value\": \"411\"\n    },\n    \"payment_method_id\": \"authorizenet.card\",\n    \"save_instrument\": true\n  }\n}")
  .asString();
```

```php Card
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://payments.bigcommerce.com/stores/store_hash/payments', [
  'body' => '{
  "payment": {
    "instrument": {
      "cardholder_name": "Jane Doe",
      "expiry_month": 12,
      "expiry_year": 2020,
      "number": "4111111111111111",
      "type": "card",
      "verification_value": "411"
    },
    "payment_method_id": "authorizenet.card",
    "save_instrument": true
  }
}',
  'headers' => [
    'Accept' => 'application/vnd.bc.v1+json',
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Card
using RestSharp;

var client = new RestClient("https://payments.bigcommerce.com/stores/store_hash/payments");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/vnd.bc.v1+json");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payment\": {\n    \"instrument\": {\n      \"cardholder_name\": \"Jane Doe\",\n      \"expiry_month\": 12,\n      \"expiry_year\": 2020,\n      \"number\": \"4111111111111111\",\n      \"type\": \"card\",\n      \"verification_value\": \"411\"\n    },\n    \"payment_method_id\": \"authorizenet.card\",\n    \"save_instrument\": true\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Card
import Foundation

let headers = [
  "Accept": "application/vnd.bc.v1+json",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["payment": [
    "instrument": [
      "cardholder_name": "Jane Doe",
      "expiry_month": 12,
      "expiry_year": 2020,
      "number": "4111111111111111",
      "type": "card",
      "verification_value": "411"
    ],
    "payment_method_id": "authorizenet.card",
    "save_instrument": true
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://payments.bigcommerce.com/stores/store_hash/payments")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Stored Card

**Request**

```json
{
  "payment": {
    "instrument": {
      "token": "8cdf7b6ea1b27119463bf9e5106639618cc77a9adc49f0069ca8b756cc15caee",
      "type": "stored_card",
      "verification_value": "1142"
    },
    "payment_method_id": "adyenv2.scheme",
    "save_instrument": true
  }
}
```

**Response**

```json
{
  "id": "227d9e1e-94f8-408c-95a5-f97b30592eb7",
  "transaction_type": "authorization",
  "status": "pending"
}
```

**SDK Code**

```python Stored Card
import requests

url = "https://payments.bigcommerce.com/stores/store_hash/payments"

payload = { "payment": {
        "instrument": {
            "token": "8cdf7b6ea1b27119463bf9e5106639618cc77a9adc49f0069ca8b756cc15caee",
            "type": "stored_card",
            "verification_value": "1142"
        },
        "payment_method_id": "adyenv2.scheme",
        "save_instrument": True
    } }
headers = {
    "Accept": "application/vnd.bc.v1+json",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Stored Card
const url = 'https://payments.bigcommerce.com/stores/store_hash/payments';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/vnd.bc.v1+json',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"payment":{"instrument":{"token":"8cdf7b6ea1b27119463bf9e5106639618cc77a9adc49f0069ca8b756cc15caee","type":"stored_card","verification_value":"1142"},"payment_method_id":"adyenv2.scheme","save_instrument":true}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Stored Card
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://payments.bigcommerce.com/stores/store_hash/payments"

	payload := strings.NewReader("{\n  \"payment\": {\n    \"instrument\": {\n      \"token\": \"8cdf7b6ea1b27119463bf9e5106639618cc77a9adc49f0069ca8b756cc15caee\",\n      \"type\": \"stored_card\",\n      \"verification_value\": \"1142\"\n    },\n    \"payment_method_id\": \"adyenv2.scheme\",\n    \"save_instrument\": true\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/vnd.bc.v1+json")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Stored Card
require 'uri'
require 'net/http'

url = URI("https://payments.bigcommerce.com/stores/store_hash/payments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/vnd.bc.v1+json'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payment\": {\n    \"instrument\": {\n      \"token\": \"8cdf7b6ea1b27119463bf9e5106639618cc77a9adc49f0069ca8b756cc15caee\",\n      \"type\": \"stored_card\",\n      \"verification_value\": \"1142\"\n    },\n    \"payment_method_id\": \"adyenv2.scheme\",\n    \"save_instrument\": true\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Stored Card
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://payments.bigcommerce.com/stores/store_hash/payments")
  .header("Accept", "application/vnd.bc.v1+json")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payment\": {\n    \"instrument\": {\n      \"token\": \"8cdf7b6ea1b27119463bf9e5106639618cc77a9adc49f0069ca8b756cc15caee\",\n      \"type\": \"stored_card\",\n      \"verification_value\": \"1142\"\n    },\n    \"payment_method_id\": \"adyenv2.scheme\",\n    \"save_instrument\": true\n  }\n}")
  .asString();
```

```php Stored Card
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://payments.bigcommerce.com/stores/store_hash/payments', [
  'body' => '{
  "payment": {
    "instrument": {
      "token": "8cdf7b6ea1b27119463bf9e5106639618cc77a9adc49f0069ca8b756cc15caee",
      "type": "stored_card",
      "verification_value": "1142"
    },
    "payment_method_id": "adyenv2.scheme",
    "save_instrument": true
  }
}',
  'headers' => [
    'Accept' => 'application/vnd.bc.v1+json',
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Stored Card
using RestSharp;

var client = new RestClient("https://payments.bigcommerce.com/stores/store_hash/payments");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/vnd.bc.v1+json");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payment\": {\n    \"instrument\": {\n      \"token\": \"8cdf7b6ea1b27119463bf9e5106639618cc77a9adc49f0069ca8b756cc15caee\",\n      \"type\": \"stored_card\",\n      \"verification_value\": \"1142\"\n    },\n    \"payment_method_id\": \"adyenv2.scheme\",\n    \"save_instrument\": true\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Stored Card
import Foundation

let headers = [
  "Accept": "application/vnd.bc.v1+json",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["payment": [
    "instrument": [
      "token": "8cdf7b6ea1b27119463bf9e5106639618cc77a9adc49f0069ca8b756cc15caee",
      "type": "stored_card",
      "verification_value": "1142"
    ],
    "payment_method_id": "adyenv2.scheme",
    "save_instrument": true
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://payments.bigcommerce.com/stores/store_hash/payments")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Stored PayPal Account

**Request**

```json
{
  "payment": {
    "instrument": {
      "token": "2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91",
      "type": "stored_paypal_account"
    },
    "payment_method_id": "braintree.paypal"
  }
}
```

**Response**

```json
{
  "id": "227d9e1e-94f8-408c-95a5-f97b30592eb7",
  "transaction_type": "authorization",
  "status": "pending"
}
```

**SDK Code**

```python Stored PayPal Account
import requests

url = "https://payments.bigcommerce.com/stores/store_hash/payments"

payload = { "payment": {
        "instrument": {
            "token": "2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91",
            "type": "stored_paypal_account"
        },
        "payment_method_id": "braintree.paypal"
    } }
headers = {
    "Accept": "application/vnd.bc.v1+json",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Stored PayPal Account
const url = 'https://payments.bigcommerce.com/stores/store_hash/payments';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/vnd.bc.v1+json',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"payment":{"instrument":{"token":"2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91","type":"stored_paypal_account"},"payment_method_id":"braintree.paypal"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Stored PayPal Account
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://payments.bigcommerce.com/stores/store_hash/payments"

	payload := strings.NewReader("{\n  \"payment\": {\n    \"instrument\": {\n      \"token\": \"2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91\",\n      \"type\": \"stored_paypal_account\"\n    },\n    \"payment_method_id\": \"braintree.paypal\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/vnd.bc.v1+json")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Stored PayPal Account
require 'uri'
require 'net/http'

url = URI("https://payments.bigcommerce.com/stores/store_hash/payments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/vnd.bc.v1+json'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payment\": {\n    \"instrument\": {\n      \"token\": \"2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91\",\n      \"type\": \"stored_paypal_account\"\n    },\n    \"payment_method_id\": \"braintree.paypal\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Stored PayPal Account
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://payments.bigcommerce.com/stores/store_hash/payments")
  .header("Accept", "application/vnd.bc.v1+json")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payment\": {\n    \"instrument\": {\n      \"token\": \"2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91\",\n      \"type\": \"stored_paypal_account\"\n    },\n    \"payment_method_id\": \"braintree.paypal\"\n  }\n}")
  .asString();
```

```php Stored PayPal Account
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://payments.bigcommerce.com/stores/store_hash/payments', [
  'body' => '{
  "payment": {
    "instrument": {
      "token": "2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91",
      "type": "stored_paypal_account"
    },
    "payment_method_id": "braintree.paypal"
  }
}',
  'headers' => [
    'Accept' => 'application/vnd.bc.v1+json',
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Stored PayPal Account
using RestSharp;

var client = new RestClient("https://payments.bigcommerce.com/stores/store_hash/payments");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/vnd.bc.v1+json");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payment\": {\n    \"instrument\": {\n      \"token\": \"2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91\",\n      \"type\": \"stored_paypal_account\"\n    },\n    \"payment_method_id\": \"braintree.paypal\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Stored PayPal Account
import Foundation

let headers = [
  "Accept": "application/vnd.bc.v1+json",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["payment": [
    "instrument": [
      "token": "2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91",
      "type": "stored_paypal_account"
    ],
    "payment_method_id": "braintree.paypal"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://payments.bigcommerce.com/stores/store_hash/payments")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Stored Bank Account

**Request**

```json
{
  "payment": {
    "instrument": {
      "token": "2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91",
      "type": "stored_bank_account"
    },
    "payment_method_id": "braintree.ach"
  }
}
```

**Response**

```json
{
  "id": "227d9e1e-94f8-408c-95a5-f97b30592eb7",
  "transaction_type": "authorization",
  "status": "pending"
}
```

**SDK Code**

```python Stored Bank Account
import requests

url = "https://payments.bigcommerce.com/stores/store_hash/payments"

payload = { "payment": {
        "instrument": {
            "token": "2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91",
            "type": "stored_bank_account"
        },
        "payment_method_id": "braintree.ach"
    } }
headers = {
    "Accept": "application/vnd.bc.v1+json",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Stored Bank Account
const url = 'https://payments.bigcommerce.com/stores/store_hash/payments';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/vnd.bc.v1+json',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"payment":{"instrument":{"token":"2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91","type":"stored_bank_account"},"payment_method_id":"braintree.ach"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Stored Bank Account
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://payments.bigcommerce.com/stores/store_hash/payments"

	payload := strings.NewReader("{\n  \"payment\": {\n    \"instrument\": {\n      \"token\": \"2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91\",\n      \"type\": \"stored_bank_account\"\n    },\n    \"payment_method_id\": \"braintree.ach\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/vnd.bc.v1+json")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Stored Bank Account
require 'uri'
require 'net/http'

url = URI("https://payments.bigcommerce.com/stores/store_hash/payments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/vnd.bc.v1+json'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payment\": {\n    \"instrument\": {\n      \"token\": \"2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91\",\n      \"type\": \"stored_bank_account\"\n    },\n    \"payment_method_id\": \"braintree.ach\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Stored Bank Account
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://payments.bigcommerce.com/stores/store_hash/payments")
  .header("Accept", "application/vnd.bc.v1+json")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payment\": {\n    \"instrument\": {\n      \"token\": \"2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91\",\n      \"type\": \"stored_bank_account\"\n    },\n    \"payment_method_id\": \"braintree.ach\"\n  }\n}")
  .asString();
```

```php Stored Bank Account
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://payments.bigcommerce.com/stores/store_hash/payments', [
  'body' => '{
  "payment": {
    "instrument": {
      "token": "2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91",
      "type": "stored_bank_account"
    },
    "payment_method_id": "braintree.ach"
  }
}',
  'headers' => [
    'Accept' => 'application/vnd.bc.v1+json',
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Stored Bank Account
using RestSharp;

var client = new RestClient("https://payments.bigcommerce.com/stores/store_hash/payments");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/vnd.bc.v1+json");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payment\": {\n    \"instrument\": {\n      \"token\": \"2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91\",\n      \"type\": \"stored_bank_account\"\n    },\n    \"payment_method_id\": \"braintree.ach\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Stored Bank Account
import Foundation

let headers = [
  "Accept": "application/vnd.bc.v1+json",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["payment": [
    "instrument": [
      "token": "2c129313bcffe4501ec5fa2764c8c16320e38c7ba9e8cdf95583b541bb05ad91",
      "type": "stored_bank_account"
    ],
    "payment_method_id": "braintree.ach"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://payments.bigcommerce.com/stores/store_hash/payments")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Gift Certificate

**Request**

```json
{
  "payment": {
    "instrument": {
      "gift_certificate_code": "ABC-DEF-GXX",
      "type": "gift_certificate"
    },
    "payment_method_id": "bigcommerce.gift_certificate"
  }
}
```

**Response**

```json
{
  "id": "227d9e1e-94f8-408c-95a5-f97b30592eb7",
  "transaction_type": "authorization",
  "status": "pending"
}
```

**SDK Code**

```python Gift Certificate
import requests

url = "https://payments.bigcommerce.com/stores/store_hash/payments"

payload = { "payment": {
        "instrument": {
            "gift_certificate_code": "ABC-DEF-GXX",
            "type": "gift_certificate"
        },
        "payment_method_id": "bigcommerce.gift_certificate"
    } }
headers = {
    "Accept": "application/vnd.bc.v1+json",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Gift Certificate
const url = 'https://payments.bigcommerce.com/stores/store_hash/payments';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/vnd.bc.v1+json',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"payment":{"instrument":{"gift_certificate_code":"ABC-DEF-GXX","type":"gift_certificate"},"payment_method_id":"bigcommerce.gift_certificate"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Gift Certificate
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://payments.bigcommerce.com/stores/store_hash/payments"

	payload := strings.NewReader("{\n  \"payment\": {\n    \"instrument\": {\n      \"gift_certificate_code\": \"ABC-DEF-GXX\",\n      \"type\": \"gift_certificate\"\n    },\n    \"payment_method_id\": \"bigcommerce.gift_certificate\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/vnd.bc.v1+json")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Gift Certificate
require 'uri'
require 'net/http'

url = URI("https://payments.bigcommerce.com/stores/store_hash/payments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/vnd.bc.v1+json'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payment\": {\n    \"instrument\": {\n      \"gift_certificate_code\": \"ABC-DEF-GXX\",\n      \"type\": \"gift_certificate\"\n    },\n    \"payment_method_id\": \"bigcommerce.gift_certificate\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Gift Certificate
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://payments.bigcommerce.com/stores/store_hash/payments")
  .header("Accept", "application/vnd.bc.v1+json")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payment\": {\n    \"instrument\": {\n      \"gift_certificate_code\": \"ABC-DEF-GXX\",\n      \"type\": \"gift_certificate\"\n    },\n    \"payment_method_id\": \"bigcommerce.gift_certificate\"\n  }\n}")
  .asString();
```

```php Gift Certificate
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://payments.bigcommerce.com/stores/store_hash/payments', [
  'body' => '{
  "payment": {
    "instrument": {
      "gift_certificate_code": "ABC-DEF-GXX",
      "type": "gift_certificate"
    },
    "payment_method_id": "bigcommerce.gift_certificate"
  }
}',
  'headers' => [
    'Accept' => 'application/vnd.bc.v1+json',
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Gift Certificate
using RestSharp;

var client = new RestClient("https://payments.bigcommerce.com/stores/store_hash/payments");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/vnd.bc.v1+json");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payment\": {\n    \"instrument\": {\n      \"gift_certificate_code\": \"ABC-DEF-GXX\",\n      \"type\": \"gift_certificate\"\n    },\n    \"payment_method_id\": \"bigcommerce.gift_certificate\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Gift Certificate
import Foundation

let headers = [
  "Accept": "application/vnd.bc.v1+json",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["payment": [
    "instrument": [
      "gift_certificate_code": "ABC-DEF-GXX",
      "type": "gift_certificate"
    ],
    "payment_method_id": "bigcommerce.gift_certificate"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://payments.bigcommerce.com/stores/store_hash/payments")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Store Credit

**Request**

```json
{
  "payment": {
    "instrument": {
      "type": "store_credit"
    },
    "payment_method_id": "bigcommerce.store_credit"
  }
}
```

**Response**

```json
{
  "id": "227d9e1e-94f8-408c-95a5-f97b30592eb7",
  "transaction_type": "authorization",
  "status": "pending"
}
```

**SDK Code**

```python Store Credit
import requests

url = "https://payments.bigcommerce.com/stores/store_hash/payments"

payload = { "payment": {
        "instrument": { "type": "store_credit" },
        "payment_method_id": "bigcommerce.store_credit"
    } }
headers = {
    "Accept": "application/vnd.bc.v1+json",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Store Credit
const url = 'https://payments.bigcommerce.com/stores/store_hash/payments';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/vnd.bc.v1+json',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"payment":{"instrument":{"type":"store_credit"},"payment_method_id":"bigcommerce.store_credit"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Store Credit
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://payments.bigcommerce.com/stores/store_hash/payments"

	payload := strings.NewReader("{\n  \"payment\": {\n    \"instrument\": {\n      \"type\": \"store_credit\"\n    },\n    \"payment_method_id\": \"bigcommerce.store_credit\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/vnd.bc.v1+json")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Store Credit
require 'uri'
require 'net/http'

url = URI("https://payments.bigcommerce.com/stores/store_hash/payments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/vnd.bc.v1+json'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payment\": {\n    \"instrument\": {\n      \"type\": \"store_credit\"\n    },\n    \"payment_method_id\": \"bigcommerce.store_credit\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Store Credit
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://payments.bigcommerce.com/stores/store_hash/payments")
  .header("Accept", "application/vnd.bc.v1+json")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payment\": {\n    \"instrument\": {\n      \"type\": \"store_credit\"\n    },\n    \"payment_method_id\": \"bigcommerce.store_credit\"\n  }\n}")
  .asString();
```

```php Store Credit
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://payments.bigcommerce.com/stores/store_hash/payments', [
  'body' => '{
  "payment": {
    "instrument": {
      "type": "store_credit"
    },
    "payment_method_id": "bigcommerce.store_credit"
  }
}',
  'headers' => [
    'Accept' => 'application/vnd.bc.v1+json',
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Store Credit
using RestSharp;

var client = new RestClient("https://payments.bigcommerce.com/stores/store_hash/payments");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/vnd.bc.v1+json");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payment\": {\n    \"instrument\": {\n      \"type\": \"store_credit\"\n    },\n    \"payment_method_id\": \"bigcommerce.store_credit\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Store Credit
import Foundation

let headers = [
  "Accept": "application/vnd.bc.v1+json",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["payment": [
    "instrument": ["type": "store_credit"],
    "payment_method_id": "bigcommerce.store_credit"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://payments.bigcommerce.com/stores/store_hash/payments")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Tokenized Card

**Request**

```json
{
  "payment": {
    "instrument": {
      "expiration_month": 12,
      "expiration_year": 2030,
      "iin": 4111111,
      "last_four_digits": 1111,
      "token": "K7KW-M9GX-6PQ3",
      "type": "tokenized_card"
    },
    "payment_method_id": "bolt.card"
  }
}
```

**Response**

```json
{
  "id": "227d9e1e-94f8-408c-95a5-f97b30592eb7",
  "transaction_type": "authorization",
  "status": "pending"
}
```

**SDK Code**

```python Tokenized Card
import requests

url = "https://payments.bigcommerce.com/stores/store_hash/payments"

payload = { "payment": {
        "instrument": {
            "expiration_month": 12,
            "expiration_year": 2030,
            "iin": 4111111,
            "last_four_digits": 1111,
            "token": "K7KW-M9GX-6PQ3",
            "type": "tokenized_card"
        },
        "payment_method_id": "bolt.card"
    } }
headers = {
    "Accept": "application/vnd.bc.v1+json",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Tokenized Card
const url = 'https://payments.bigcommerce.com/stores/store_hash/payments';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/vnd.bc.v1+json',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"payment":{"instrument":{"expiration_month":12,"expiration_year":2030,"iin":4111111,"last_four_digits":1111,"token":"K7KW-M9GX-6PQ3","type":"tokenized_card"},"payment_method_id":"bolt.card"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Tokenized Card
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://payments.bigcommerce.com/stores/store_hash/payments"

	payload := strings.NewReader("{\n  \"payment\": {\n    \"instrument\": {\n      \"expiration_month\": 12,\n      \"expiration_year\": 2030,\n      \"iin\": 4111111,\n      \"last_four_digits\": 1111,\n      \"token\": \"K7KW-M9GX-6PQ3\",\n      \"type\": \"tokenized_card\"\n    },\n    \"payment_method_id\": \"bolt.card\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/vnd.bc.v1+json")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Tokenized Card
require 'uri'
require 'net/http'

url = URI("https://payments.bigcommerce.com/stores/store_hash/payments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/vnd.bc.v1+json'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payment\": {\n    \"instrument\": {\n      \"expiration_month\": 12,\n      \"expiration_year\": 2030,\n      \"iin\": 4111111,\n      \"last_four_digits\": 1111,\n      \"token\": \"K7KW-M9GX-6PQ3\",\n      \"type\": \"tokenized_card\"\n    },\n    \"payment_method_id\": \"bolt.card\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Tokenized Card
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://payments.bigcommerce.com/stores/store_hash/payments")
  .header("Accept", "application/vnd.bc.v1+json")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payment\": {\n    \"instrument\": {\n      \"expiration_month\": 12,\n      \"expiration_year\": 2030,\n      \"iin\": 4111111,\n      \"last_four_digits\": 1111,\n      \"token\": \"K7KW-M9GX-6PQ3\",\n      \"type\": \"tokenized_card\"\n    },\n    \"payment_method_id\": \"bolt.card\"\n  }\n}")
  .asString();
```

```php Tokenized Card
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://payments.bigcommerce.com/stores/store_hash/payments', [
  'body' => '{
  "payment": {
    "instrument": {
      "expiration_month": 12,
      "expiration_year": 2030,
      "iin": 4111111,
      "last_four_digits": 1111,
      "token": "K7KW-M9GX-6PQ3",
      "type": "tokenized_card"
    },
    "payment_method_id": "bolt.card"
  }
}',
  'headers' => [
    'Accept' => 'application/vnd.bc.v1+json',
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Tokenized Card
using RestSharp;

var client = new RestClient("https://payments.bigcommerce.com/stores/store_hash/payments");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/vnd.bc.v1+json");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payment\": {\n    \"instrument\": {\n      \"expiration_month\": 12,\n      \"expiration_year\": 2030,\n      \"iin\": 4111111,\n      \"last_four_digits\": 1111,\n      \"token\": \"K7KW-M9GX-6PQ3\",\n      \"type\": \"tokenized_card\"\n    },\n    \"payment_method_id\": \"bolt.card\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Tokenized Card
import Foundation

let headers = [
  "Accept": "application/vnd.bc.v1+json",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["payment": [
    "instrument": [
      "expiration_month": 12,
      "expiration_year": 2030,
      "iin": 4111111,
      "last_four_digits": 1111,
      "token": "K7KW-M9GX-6PQ3",
      "type": "tokenized_card"
    ],
    "payment_method_id": "bolt.card"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://payments.bigcommerce.com/stores/store_hash/payments")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```