> ## Documentation Index
> Fetch the complete documentation index at: https://wpay-feat-edp-guide.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Vault a transaction's payment method

> Create a transaction and vaulted a payment method at the same time.

It is possible to vault (store) a card or any other payment method that supports
vaulting by setting the `store` field in the request body to `true`.

<CodeGroup>
  ```bash cURL
  curl -i -X POST "https://api.example.gr4vy.app/transactions" \
      -H "Authorization: Bearer [JWT_TOKEN]" \
      -H "Content-Type: application/json" \
      -d '{
            "amount": 1299,
            "currency": "AUD",
            "store": true
            "payment_method": {
              "method": "card",
              "number": "4111111111111111",
              "expiration_date": "11/25",
              "security_code": "123"
            }
          }'
  ```

  ```js Node
  {12}
  var fetch = require("node-fetch");

  fetch("https://api.example.gr4vy.app/transactions", {
    method: "POST",
    headers: {
      Authorization: "Bearer [JWT_TOKEN]",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      amount: 1299,
      currency: "AUD",
      store: true,
      payment_method: {
        method: "card",
        number: "4111111111111111",
        expiration_date: "11/21",
        security_code: "123",
      },
    }),
  });
  ```
</CodeGroup>

This eliminates the need to separately vault the payment method and then use it
to create a transaction.

<Tip>
  Learn more about [payment method vaulting](/guides/api/resources/payment-methods/overview) as well as linking
  payment methods to registered [buyers](/guides/api/resources/buyers/overview).
</Tip>

<Warning>
  Storing a redirect payment method requires us to redirect the user only once. This
  would vault the payment method and process the transaction.
</Warning>
