# Buy Plaque API

The Buy Plaque API allows a user to buy a plaque by providing payment information and personal details. The API uses the HTTP POST method to send a request to the server and HTTP response codes to return the status of the request.

### Buy Plaque API

<mark style="color:green;">`POST`</mark> `https://api.stagemeta.dev/plaques/buy`

#### Headers

| Name          | Type   | Description           |
| ------------- | ------ | --------------------- |
| Authorization | String | `Bearer ACCESS_TOKEN` |

#### Request Body

| Name                                            | Type      | Description |
| ----------------------------------------------- | --------- | ----------- |
| names<mark style="color:red;">\*</mark>         | \[String] |             |
| card\_number<mark style="color:red;">\*</mark>  | String    |             |
| expire\_month<mark style="color:red;">\*</mark> | Number    |             |
| expire\_year<mark style="color:red;">\*</mark>  | Number    |             |
| cvv<mark style="color:red;">\*</mark>           | String    |             |
| country<mark style="color:red;">\*</mark>       | String    |             |
| city<mark style="color:red;">\*</mark>          | String    |             |
| state<mark style="color:red;">\*</mark>         | String    |             |
| postal\_code<mark style="color:red;">\*</mark>  | String    |             |
| first\_name<mark style="color:red;">\*</mark>   | String    |             |
| last\_name<mark style="color:red;">\*</mark>    | String    |             |
| line1<mark style="color:red;">\*</mark>         | String    |             |
| line2                                           | String    |             |
| username                                        | String    |             |
| email                                           | String    |             |
| walletAddress                                   | String    |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "hash": "0x0000000000000000000000000000000000000000000000000"
}
```

{% endtab %}

{% tab title="500: Internal Server Error There was an error in preparing the plaque. Please contact Stagemeta support." %}

{% endtab %}

{% tab title="401: Unauthorized The access token provided in the Authorization header is invalid." %}

{% endtab %}

{% tab title="404: Not Found The plaque specified in the endpoint does not exist" %}

{% endtab %}
{% endtabs %}

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

```bash
curl -X 'POST' \
  'https://api.stagemeta.dev/plaques/buy' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "names": [
    "TPA-000"
  ],
  "card_number": "1234567890123456",
  "expire_month": 10,
  "expire_year": 25,
  "cvv": "123",
  "country": "US",
  "city": "New York",
  "state": "NY",
  "postal_code": "10001",
  "first_name": "John",
  "last_name": "Doe",
  "line1": "123 Main St.",
  "line2": "",
  "username": "johndoe",
  "email": "johndoe@example.com",
  "walletAddress": "0x1234567890abcdef"
}'
```

{% endtab %}

{% tab title="Node" %}
{% code overflow="wrap" %}

```javascript
fetch('https://api.stagemeta.dev/plaques/buy', {
  method: 'POST',
  headers: {
    'Accept': 'application/json',
    'Authorization': 'Bearer ACCESS_TOKEN',
    'Content-Type': 'application/json'
  },
  body:{
    "names": [
      "TPA-000"
    ],
    "card_number": "1234567890123456",
    "expire_month": 10,
    "expire_year": 25,
    "cvv": "123",
    "country": "US",
    "city": "New York",
    "state": "NY",
    "postal_code": "10001",
    "first_name": "John",
    "last_name": "Doe",
    "line1": "123 Main St.",
    "line2": "",
    "username": "johndoe",
    "email": "johndoe@example.com",
    "walletAddress": "0x1234567890abcdef"
  }
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));
```

{% endcode %}
{% endtab %}
{% endtabs %}
