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

# Attach Instrument to Customer

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

Adds an instrument to customer.

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/admin/payments/attach-instrument-to-customer/create-instrument

## Request

### Path parameters

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

### Headers

- `Accept` (string, required, default: application/vnd.bc+json) — The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body.

### Body (application/json)

This endpoint expects a create_instrument_request.

- `payment_method_id` (string, required) — Identifier for payment method that will be used for this instrument obtained from Payment Methods API.
- `currency_code` (string, required) — The instrument currency.
- `customer_id` (string, required) — The ID of the customer to add instrument for.
- `instrument` (CreateInstrumentRequestInstrument, required)
- `billing_address` (BillingAddressCreateParam, required)
- `default_instrument` (boolean, optional) — Set this instrument as default for customer?
- `trusted_shipping_addresses` (list of AddressCreateParams, optional) — Trusted shipping address for instrument.

## Response

### 201

Created instrument

- `data` (CreateInstrumentResponseBodyData, optional)
- `meta` (meta_empty, optional) — Response metadata.

## Errors

### 401 Unauthorized Error

Invalid X-Auth-Token

- `status` (integer, optional) — The HTTP status code.
- `title` (string, optional) — The error title describing the particular error.
- `type` (string, optional)
- `errors` (detailed_error, optional)

### 422 Unprocessable Entity Error

Created

- `status` (integer, optional) — The HTTP status code.
- `title` (string, optional) — The error title describing the particular error.
- `type` (string, optional)
- `errors` (detailed_error, optional)

## Types

### CreateInstrumentRequestInstrument

- RawCardCreateParams: RawCardCreateParams
- TokenizedCardCreateParams: TokenizedCardCreateParams
- TokenizedPayPalAccountCreateParams: TokenizedPayPalAccountCreateParams

### BillingAddressCreateParam

- `first_name` (string, required) — The first name of the card holder.
- `email` (string, required)
- `street_1` (string, required)
- `city` (string, required) — City
- `country_code` (string, required) — The ISO-3166-1 2 letter country code.
- `last_name` (string, optional) — The last name of the card holder.
- `company` (string, optional) — The company of the card holder.
- `street_2` (string, optional)
- `state_or_province_code` (string, optional) — The state or province code.
- `phone` (string, optional)
- `postal_code` (string, optional) — postal code

### AddressCreateParams

- `first_name` (string, required) — The first name of the card holder.
- `street_1` (string, required)
- `city` (string, required) — City
- `country_code` (string, required) — The ISO-3166-1 2 letter country code.
- `last_name` (string, optional) — The last name of the card holder.
- `email` (string, optional)
- `company` (string, optional) — The company of the card holder.
- `street_2` (string, optional)
- `state_or_province_code` (string, optional) — The state or province code.
- `phone` (string, optional)
- `postal_code` (string, optional) — postal code

### CreateInstrumentResponseBodyData

- `customer_id` (string, optional) — The ID of the shopper to add instrument for.
- `token` (string, optional) — The BigCommerce instrument token.
- `type` (string, optional) — The instrument type.
- `is_default` (boolean, optional) — Identifies whether this stored instrument is default for the customer.
- `brand` (string, optional) — The card brand.
- `expiry_month` (integer, optional) — The expiry month for this card.
- `expiry_year` (integer, optional) — The expiry year for this card.
- `bin` (string, optional) — The bank identification number.
- `last_4` (string, optional) — The last four digits of this card.
- `billing_address` (BillingAddress, optional)
- `email` (string, optional) — Paypal email address

### meta_empty

Response metadata.

### detailed_error

### RawCardCreateParams

The credit card instrument with raw card data.

- `number` (string, required) — The raw card number.
- `expiration_year` (integer, required) — The expiration year.
- `expiration_month` (integer, required) — The expiration day.
- `verification_value` (string, required) — The security code.
- `cardholder_name` (string, required) — The cardholder name.
- `type` (enum, required) — The type of instrument. For this case "raw_card".
  - Allowed values: `raw_card`, `tokenized_card`, `tokenized_paypal_account`

### TokenizedCardCreateParams

The card creation params with tokenized card number.

- `card_token` (string, required) — The tokenized card data.
- `expiration_year` (integer, required) — The expiration year.
- `expiration_month` (integer, required) — The expiration month.
- `cardholder_name` (string, required) — The cardholder name.
- `type` (enum, required) — The type of instrument. For this case "tokenized_card".
  - Allowed values: `raw_card`, `tokenized_card`, `tokenized_paypal_account`
- `brand` (string, required) — card brand
- `verification_value` (string, optional) — The card verification value.
- `iin` (string, optional) — The issuer identification number or bin.

### TokenizedPayPalAccountCreateParams

A PayPal account stored instrument.

- `token` (string, required) — The PayPal token for instrument.
- `email` (string, required) — The Paypal email address.
- `type` (enum, required) — The type of instrument. For this case "tokenized_paypal_account".
  - Allowed values: `raw_card`, `tokenized_card`, `tokenized_paypal_account`

### BillingAddress

- `first_name` (string, optional) — The first name of the card holder.
- `last_name` (string, optional) — The last name of the card holder.
- `email` (string, optional)
- `company` (string, optional) — The company of the card holder.
- `street_1` (string, optional)
- `street_2` (string, optional)
- `city` (string, optional)
- `state_or_province_code` (string, optional) — Represents the state or province code.
- `country_code` (string, optional) — The ISO-3166-1 2 letter country code.
- `phone` (string, optional)
- `postal_code` (string, optional) — postal code

## Examples

### paypal_instrument

**Request**

```json
{
  "payment_method_id": "braintree.paypal",
  "currency_code": "USD",
  "customer_id": "1",
  "instrument": {
    "cardholder_name": "test name",
    "expiration_month": 12,
    "expiration_year": 2024,
    "number": "4111111111111111",
    "type": "raw_card",
    "verification_value": "123"
  },
  "billing_address": {
    "first_name": "Tester",
    "email": "example@email.com",
    "street_1": "1 Sample Street",
    "city": "Tampa",
    "country_code": "US",
    "last_name": "Tester",
    "company": "",
    "street_2": "",
    "state_or_province_code": "NV",
    "phone": "101-192-0293",
    "postal_code": "55555"
  }
}
```

**Response**

```json
{
  "data": {
    "customer_id": "1",
    "token": "e4e43db4454391cee7608673d530d91fc87ea3d5c75315601bd939d1281f70e2",
    "type": "paypal_account",
    "is_default": true,
    "billing_address": {
      "first_name": "Tester",
      "last_name": "Tester",
      "email": "example@email.com",
      "company": "",
      "street_1": "1 Sample Street",
      "street_2": "",
      "city": "",
      "state_or_province_code": "NV",
      "country_code": "US",
      "phone": "101-192-0293",
      "postal_code": "55555"
    },
    "email": "bc-buyer-paypal-express@bigcommerce.com"
  },
  "meta": {}
}
```

**SDK Code**

```python paypal_instrument
import requests

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

payload = {
    "payment_method_id": "braintree.paypal",
    "currency_code": "USD",
    "customer_id": "1",
    "instrument": {
        "cardholder_name": "test name",
        "expiration_month": 12,
        "expiration_year": 2024,
        "number": "4111111111111111",
        "type": "raw_card",
        "verification_value": "123"
    },
    "billing_address": {
        "first_name": "Tester",
        "email": "example@email.com",
        "street_1": "1 Sample Street",
        "city": "Tampa",
        "country_code": "US",
        "last_name": "Tester",
        "company": "",
        "street_2": "",
        "state_or_province_code": "NV",
        "phone": "101-192-0293",
        "postal_code": "55555"
    }
}
headers = {
    "Accept": "application/vnd.bc+json",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript paypal_instrument
const url = 'https://payments.bigcommerce.com/stores/store_hash/stored-instruments';
const options = {
  method: 'POST',
  headers: {Accept: 'application/vnd.bc+json', 'Content-Type': 'application/json'},
  body: '{"payment_method_id":"braintree.paypal","currency_code":"USD","customer_id":"1","instrument":{"cardholder_name":"test name","expiration_month":12,"expiration_year":2024,"number":"4111111111111111","type":"raw_card","verification_value":"123"},"billing_address":{"first_name":"Tester","email":"example@email.com","street_1":"1 Sample Street","city":"Tampa","country_code":"US","last_name":"Tester","company":"","street_2":"","state_or_province_code":"NV","phone":"101-192-0293","postal_code":"55555"}}'
};

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

```go paypal_instrument
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"payment_method_id\": \"braintree.paypal\",\n  \"currency_code\": \"USD\",\n  \"customer_id\": \"1\",\n  \"instrument\": {\n    \"cardholder_name\": \"test name\",\n    \"expiration_month\": 12,\n    \"expiration_year\": 2024,\n    \"number\": \"4111111111111111\",\n    \"type\": \"raw_card\",\n    \"verification_value\": \"123\"\n  },\n  \"billing_address\": {\n    \"first_name\": \"Tester\",\n    \"email\": \"example@email.com\",\n    \"street_1\": \"1 Sample Street\",\n    \"city\": \"Tampa\",\n    \"country_code\": \"US\",\n    \"last_name\": \"Tester\",\n    \"company\": \"\",\n    \"street_2\": \"\",\n    \"state_or_province_code\": \"NV\",\n    \"phone\": \"101-192-0293\",\n    \"postal_code\": \"55555\"\n  }\n}")

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

	req.Header.Add("Accept", "application/vnd.bc+json")
	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 paypal_instrument
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/vnd.bc+json'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payment_method_id\": \"braintree.paypal\",\n  \"currency_code\": \"USD\",\n  \"customer_id\": \"1\",\n  \"instrument\": {\n    \"cardholder_name\": \"test name\",\n    \"expiration_month\": 12,\n    \"expiration_year\": 2024,\n    \"number\": \"4111111111111111\",\n    \"type\": \"raw_card\",\n    \"verification_value\": \"123\"\n  },\n  \"billing_address\": {\n    \"first_name\": \"Tester\",\n    \"email\": \"example@email.com\",\n    \"street_1\": \"1 Sample Street\",\n    \"city\": \"Tampa\",\n    \"country_code\": \"US\",\n    \"last_name\": \"Tester\",\n    \"company\": \"\",\n    \"street_2\": \"\",\n    \"state_or_province_code\": \"NV\",\n    \"phone\": \"101-192-0293\",\n    \"postal_code\": \"55555\"\n  }\n}"

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

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

HttpResponse<String> response = Unirest.post("https://payments.bigcommerce.com/stores/store_hash/stored-instruments")
  .header("Accept", "application/vnd.bc+json")
  .header("Content-Type", "application/json")
  .body("{\n  \"payment_method_id\": \"braintree.paypal\",\n  \"currency_code\": \"USD\",\n  \"customer_id\": \"1\",\n  \"instrument\": {\n    \"cardholder_name\": \"test name\",\n    \"expiration_month\": 12,\n    \"expiration_year\": 2024,\n    \"number\": \"4111111111111111\",\n    \"type\": \"raw_card\",\n    \"verification_value\": \"123\"\n  },\n  \"billing_address\": {\n    \"first_name\": \"Tester\",\n    \"email\": \"example@email.com\",\n    \"street_1\": \"1 Sample Street\",\n    \"city\": \"Tampa\",\n    \"country_code\": \"US\",\n    \"last_name\": \"Tester\",\n    \"company\": \"\",\n    \"street_2\": \"\",\n    \"state_or_province_code\": \"NV\",\n    \"phone\": \"101-192-0293\",\n    \"postal_code\": \"55555\"\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://payments.bigcommerce.com/stores/store_hash/stored-instruments', [
  'body' => '{
  "payment_method_id": "braintree.paypal",
  "currency_code": "USD",
  "customer_id": "1",
  "instrument": {
    "cardholder_name": "test name",
    "expiration_month": 12,
    "expiration_year": 2024,
    "number": "4111111111111111",
    "type": "raw_card",
    "verification_value": "123"
  },
  "billing_address": {
    "first_name": "Tester",
    "email": "example@email.com",
    "street_1": "1 Sample Street",
    "city": "Tampa",
    "country_code": "US",
    "last_name": "Tester",
    "company": "",
    "street_2": "",
    "state_or_province_code": "NV",
    "phone": "101-192-0293",
    "postal_code": "55555"
  }
}',
  'headers' => [
    'Accept' => 'application/vnd.bc+json',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp paypal_instrument
using RestSharp;

var client = new RestClient("https://payments.bigcommerce.com/stores/store_hash/stored-instruments");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/vnd.bc+json");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payment_method_id\": \"braintree.paypal\",\n  \"currency_code\": \"USD\",\n  \"customer_id\": \"1\",\n  \"instrument\": {\n    \"cardholder_name\": \"test name\",\n    \"expiration_month\": 12,\n    \"expiration_year\": 2024,\n    \"number\": \"4111111111111111\",\n    \"type\": \"raw_card\",\n    \"verification_value\": \"123\"\n  },\n  \"billing_address\": {\n    \"first_name\": \"Tester\",\n    \"email\": \"example@email.com\",\n    \"street_1\": \"1 Sample Street\",\n    \"city\": \"Tampa\",\n    \"country_code\": \"US\",\n    \"last_name\": \"Tester\",\n    \"company\": \"\",\n    \"street_2\": \"\",\n    \"state_or_province_code\": \"NV\",\n    \"phone\": \"101-192-0293\",\n    \"postal_code\": \"55555\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift paypal_instrument
import Foundation

let headers = [
  "Accept": "application/vnd.bc+json",
  "Content-Type": "application/json"
]
let parameters = [
  "payment_method_id": "braintree.paypal",
  "currency_code": "USD",
  "customer_id": "1",
  "instrument": [
    "cardholder_name": "test name",
    "expiration_month": 12,
    "expiration_year": 2024,
    "number": "4111111111111111",
    "type": "raw_card",
    "verification_value": "123"
  ],
  "billing_address": [
    "first_name": "Tester",
    "email": "example@email.com",
    "street_1": "1 Sample Street",
    "city": "Tampa",
    "country_code": "US",
    "last_name": "Tester",
    "company": "",
    "street_2": "",
    "state_or_province_code": "NV",
    "phone": "101-192-0293",
    "postal_code": "55555"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://payments.bigcommerce.com/stores/store_hash/stored-instruments")! 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()
```

### credit_card_instrument

**Request**

```json
{
  "payment_method_id": "braintree.paypal",
  "currency_code": "USD",
  "customer_id": "1",
  "instrument": {
    "cardholder_name": "test name",
    "expiration_month": 12,
    "expiration_year": 2024,
    "number": "4111111111111111",
    "type": "raw_card",
    "verification_value": "123"
  },
  "billing_address": {
    "first_name": "Tester",
    "email": "example@email.com",
    "street_1": "1 Sample Street",
    "city": "Tampa",
    "country_code": "US",
    "last_name": "Tester",
    "company": "",
    "street_2": "",
    "state_or_province_code": "NV",
    "phone": "101-192-0293",
    "postal_code": "55555"
  }
}
```

**Response**

```json
{
  "data": {
    "customer_id": "1",
    "token": "e4e43db4454391cee7608673d530d91fc87ea3d5c75315601bd939d1281f70e2",
    "type": "credit_card",
    "is_default": true,
    "brand": "visa",
    "expiry_month": 1,
    "expiry_year": 1,
    "bin": "411111",
    "last_4": "1111",
    "billing_address": {
      "first_name": "Tester",
      "last_name": "Tester",
      "email": "example@email.com",
      "street_1": "1 Sample Street",
      "street_2": "",
      "city": "",
      "state_or_province_code": "NV",
      "country_code": "US",
      "phone": "101-192-0293",
      "postal_code": "55555",
      "company\"": ""
    }
  },
  "meta": {}
}
```

**SDK Code**

```python credit_card_instrument
import requests

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

payload = {
    "payment_method_id": "braintree.paypal",
    "currency_code": "USD",
    "customer_id": "1",
    "instrument": {
        "cardholder_name": "test name",
        "expiration_month": 12,
        "expiration_year": 2024,
        "number": "4111111111111111",
        "type": "raw_card",
        "verification_value": "123"
    },
    "billing_address": {
        "first_name": "Tester",
        "email": "example@email.com",
        "street_1": "1 Sample Street",
        "city": "Tampa",
        "country_code": "US",
        "last_name": "Tester",
        "company": "",
        "street_2": "",
        "state_or_province_code": "NV",
        "phone": "101-192-0293",
        "postal_code": "55555"
    }
}
headers = {
    "Accept": "application/vnd.bc+json",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript credit_card_instrument
const url = 'https://payments.bigcommerce.com/stores/store_hash/stored-instruments';
const options = {
  method: 'POST',
  headers: {Accept: 'application/vnd.bc+json', 'Content-Type': 'application/json'},
  body: '{"payment_method_id":"braintree.paypal","currency_code":"USD","customer_id":"1","instrument":{"cardholder_name":"test name","expiration_month":12,"expiration_year":2024,"number":"4111111111111111","type":"raw_card","verification_value":"123"},"billing_address":{"first_name":"Tester","email":"example@email.com","street_1":"1 Sample Street","city":"Tampa","country_code":"US","last_name":"Tester","company":"","street_2":"","state_or_province_code":"NV","phone":"101-192-0293","postal_code":"55555"}}'
};

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

```go credit_card_instrument
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"payment_method_id\": \"braintree.paypal\",\n  \"currency_code\": \"USD\",\n  \"customer_id\": \"1\",\n  \"instrument\": {\n    \"cardholder_name\": \"test name\",\n    \"expiration_month\": 12,\n    \"expiration_year\": 2024,\n    \"number\": \"4111111111111111\",\n    \"type\": \"raw_card\",\n    \"verification_value\": \"123\"\n  },\n  \"billing_address\": {\n    \"first_name\": \"Tester\",\n    \"email\": \"example@email.com\",\n    \"street_1\": \"1 Sample Street\",\n    \"city\": \"Tampa\",\n    \"country_code\": \"US\",\n    \"last_name\": \"Tester\",\n    \"company\": \"\",\n    \"street_2\": \"\",\n    \"state_or_province_code\": \"NV\",\n    \"phone\": \"101-192-0293\",\n    \"postal_code\": \"55555\"\n  }\n}")

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

	req.Header.Add("Accept", "application/vnd.bc+json")
	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 credit_card_instrument
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/vnd.bc+json'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payment_method_id\": \"braintree.paypal\",\n  \"currency_code\": \"USD\",\n  \"customer_id\": \"1\",\n  \"instrument\": {\n    \"cardholder_name\": \"test name\",\n    \"expiration_month\": 12,\n    \"expiration_year\": 2024,\n    \"number\": \"4111111111111111\",\n    \"type\": \"raw_card\",\n    \"verification_value\": \"123\"\n  },\n  \"billing_address\": {\n    \"first_name\": \"Tester\",\n    \"email\": \"example@email.com\",\n    \"street_1\": \"1 Sample Street\",\n    \"city\": \"Tampa\",\n    \"country_code\": \"US\",\n    \"last_name\": \"Tester\",\n    \"company\": \"\",\n    \"street_2\": \"\",\n    \"state_or_province_code\": \"NV\",\n    \"phone\": \"101-192-0293\",\n    \"postal_code\": \"55555\"\n  }\n}"

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

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

HttpResponse<String> response = Unirest.post("https://payments.bigcommerce.com/stores/store_hash/stored-instruments")
  .header("Accept", "application/vnd.bc+json")
  .header("Content-Type", "application/json")
  .body("{\n  \"payment_method_id\": \"braintree.paypal\",\n  \"currency_code\": \"USD\",\n  \"customer_id\": \"1\",\n  \"instrument\": {\n    \"cardholder_name\": \"test name\",\n    \"expiration_month\": 12,\n    \"expiration_year\": 2024,\n    \"number\": \"4111111111111111\",\n    \"type\": \"raw_card\",\n    \"verification_value\": \"123\"\n  },\n  \"billing_address\": {\n    \"first_name\": \"Tester\",\n    \"email\": \"example@email.com\",\n    \"street_1\": \"1 Sample Street\",\n    \"city\": \"Tampa\",\n    \"country_code\": \"US\",\n    \"last_name\": \"Tester\",\n    \"company\": \"\",\n    \"street_2\": \"\",\n    \"state_or_province_code\": \"NV\",\n    \"phone\": \"101-192-0293\",\n    \"postal_code\": \"55555\"\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://payments.bigcommerce.com/stores/store_hash/stored-instruments', [
  'body' => '{
  "payment_method_id": "braintree.paypal",
  "currency_code": "USD",
  "customer_id": "1",
  "instrument": {
    "cardholder_name": "test name",
    "expiration_month": 12,
    "expiration_year": 2024,
    "number": "4111111111111111",
    "type": "raw_card",
    "verification_value": "123"
  },
  "billing_address": {
    "first_name": "Tester",
    "email": "example@email.com",
    "street_1": "1 Sample Street",
    "city": "Tampa",
    "country_code": "US",
    "last_name": "Tester",
    "company": "",
    "street_2": "",
    "state_or_province_code": "NV",
    "phone": "101-192-0293",
    "postal_code": "55555"
  }
}',
  'headers' => [
    'Accept' => 'application/vnd.bc+json',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp credit_card_instrument
using RestSharp;

var client = new RestClient("https://payments.bigcommerce.com/stores/store_hash/stored-instruments");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/vnd.bc+json");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payment_method_id\": \"braintree.paypal\",\n  \"currency_code\": \"USD\",\n  \"customer_id\": \"1\",\n  \"instrument\": {\n    \"cardholder_name\": \"test name\",\n    \"expiration_month\": 12,\n    \"expiration_year\": 2024,\n    \"number\": \"4111111111111111\",\n    \"type\": \"raw_card\",\n    \"verification_value\": \"123\"\n  },\n  \"billing_address\": {\n    \"first_name\": \"Tester\",\n    \"email\": \"example@email.com\",\n    \"street_1\": \"1 Sample Street\",\n    \"city\": \"Tampa\",\n    \"country_code\": \"US\",\n    \"last_name\": \"Tester\",\n    \"company\": \"\",\n    \"street_2\": \"\",\n    \"state_or_province_code\": \"NV\",\n    \"phone\": \"101-192-0293\",\n    \"postal_code\": \"55555\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift credit_card_instrument
import Foundation

let headers = [
  "Accept": "application/vnd.bc+json",
  "Content-Type": "application/json"
]
let parameters = [
  "payment_method_id": "braintree.paypal",
  "currency_code": "USD",
  "customer_id": "1",
  "instrument": [
    "cardholder_name": "test name",
    "expiration_month": 12,
    "expiration_year": 2024,
    "number": "4111111111111111",
    "type": "raw_card",
    "verification_value": "123"
  ],
  "billing_address": [
    "first_name": "Tester",
    "email": "example@email.com",
    "street_1": "1 Sample Street",
    "city": "Tampa",
    "country_code": "US",
    "last_name": "Tester",
    "company": "",
    "street_2": "",
    "state_or_province_code": "NV",
    "phone": "101-192-0293",
    "postal_code": "55555"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://payments.bigcommerce.com/stores/store_hash/stored-instruments")! 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()
```