> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dintero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use a stored card token

> Charge a stored Dintero card token for customer-initiated and merchant-initiated payments, including subscriptions, recurring billing, and one-click checkout.

> [!WARNING]
>
> **Tokenization must be activated on your account before you can create or charge card tokens.**
>
> Contact your Dintero account manager to have it enabled. Until it is activated, requests
> that create or use a card token will fail.

### Customer initiated transactions

To use the token in a new session for the same customer, put the token value in
the session under `customer.tokens.payex.creditcard` or `customer.tokens.bambora.creditcard`. See [create session].

**payex.creditcard**

```json theme={null}
{
  "url": {
    "return_url": "https://example.com/thankyou",
    "callback_url": "https://example.com/callback"
  },
  "order": {
    "amount": 29990,
    "currency": "NOK",
    "merchant_reference": "merchants_order_number"
  },
  "customer": {
    "email": "john.doe@example.com",
    "phone_number": "+4799999999",
    "tokens": {
      "payex.creditcard": {
        "payment_token": "<token previously acquired>"
      }
    }
  },
  "profile_id": "default"
}
```

**bambora.creditcard**

```json theme={null}
{
  "url": {
    "return_url": "https://example.com/thankyou",
    "callback_url": "https://example.com/callback"
  },
  "order": {
    "amount": 29990,
    "currency": "NOK",
    "merchant_reference": "merchants_order_number"
  },
  "customer": {
    "email": "john.doe@example.com",
    "phone_number": "+4799999999",
    "tokens": {
      "bambora.creditcard": {
        "payment_token": "<token previously acquired>"
      }
    }
  },
  "profile_id": "default"
}
```

**dintero\_psp.creditcard**

```json theme={null}
{
  "url": {
    "return_url": "https://example.com/thankyou",
    "callback_url": "https://example.com/callback"
  },
  "order": {
    "amount": 29990,
    "currency": "NOK",
    "merchant_reference": "merchants_order_number"
  },
  "customer": {
    "email": "john.doe@example.com",
    "phone_number": "+4799999999",
    "tokens": {
      "dintero_psp.creditcard": {
        "payment_token": "<token previously acquired>"
      }
    }
  },
  "profile_id": "default"
}
```

The response will look like this:

```json theme={null}
{
    "id": "T11223445.5cyWnV68vzJ1kYjZPrKWWm",
    "url": "https://checkout.test.dintero.com/v1/view/T11223445.5cyWnV68vzJ1kYjZPrKWWm"
}
```

Redirect the customer to the url for them to confirm the payment with `CVC`.

### Recurrence transactions

To perform transactions without involving the customer, using a recurrence token,
use `recurring_purchase` operation when calling the pay endpoint.

Swedbank Pay uses a `recurrence_token` for these charges. Bambora and Dintero PSP do not
issue recurrence tokens, so pass the `payment_token` instead. See
[Token types](https://docs.dintero.com/docs/checkout/tokenization.md#token-types).

With the access token, call [Create and pay merchant initiated session][post session pay]
with the following body:

**payex.creditcard**

```json theme={null}
{
  "session": {
    "url": {
      "callback_url": "https://example.com/callback?method=GET"
    },
    "customer": {
      "email": "john.doe@example.com",
      "phone_number": "+4799999999",
      "tokens": {
        "payex.creditcard": {
          "recurrence_token": "<token previously acquired>"
        }
      }
    },
    "order": {
      "amount": 29990,
      "currency": "NOK",
      "vat_amount": 6000,
      "items": [
        {
          "line_id": "1",
          "description": "Stablestol",
          "quantity": 1,
          "amount": 29990,
          "vat_amount": 6000,
          "vat": 25
        }
      ],
      "merchant_reference": "order-1"
    },
    "configuration": {
      "auto_capture": false
    }
  },
  "payment": {
    "payment_product_type": "payex.creditcard",
    "operation": "recurring_purchase"
  }
}
```

**bambora.creditcard**

```json theme={null}
{
  "session": {
    "url": {
      "callback_url": "https://example.com/callback?method=GET"
    },
    "customer": {
      "email": "john.doe@example.com",
      "phone_number": "+4799999999",
      "tokens": {
        "bambora.creditcard": {
          "payment_token": "<token previously acquired>"
        }
      }
    },
    "order": {
      "amount": 29990,
      "currency": "NOK",
      "vat_amount": 6000,
      "items": [
        {
          "line_id": "1",
          "description": "Stablestol",
          "quantity": 1,
          "amount": 29990,
          "vat_amount": 6000,
          "vat": 25
        }
      ],
      "merchant_reference": "order-1"
    },
    "configuration": {
      "auto_capture": false
    }
  },
  "payment": {
    "payment_product_type": "bambora.creditcard",
    "operation": "recurring_purchase"
  }
}
```

**dintero\_psp.creditcard**

```json theme={null}
{
  "session": {
    "url": {
      "callback_url": "https://example.com/callback?method=GET"
    },
    "customer": {
      "email": "john.doe@example.com",
      "phone_number": "+4799999999",
      "tokens": {
        "dintero_psp.creditcard": {
          "payment_token": "<token previously acquired>"
        }
      }
    },
    "order": {
      "amount": 29990,
      "currency": "NOK",
      "vat_amount": 6000,
      "items": [
        {
          "line_id": "1",
          "description": "Stablestol",
          "quantity": 1,
          "amount": 29990,
          "vat_amount": 6000,
          "vat": 25
        }
      ],
      "merchant_reference": "order-1"
    },
    "configuration": {
      "auto_capture": false
    }
  },
  "payment": {
    "payment_product_type": "dintero_psp.creditcard",
    "operation": "recurring_purchase"
  }
}
```

### Unscheduled transactions

To perform transactions without involving the customer, MIT (merchant initiated)
transactions use `unscheduled_purchase` operation when calling the pay endpoint.

With the access token, call [Create and pay merchant initiated session][post session pay]
with the following body:

**payex.creditcard**

```json theme={null}
{
  "session": {
    "url": {
      "callback_url": "https://example.com/callback?method=GET"
    },
    "customer": {
      "email": "john.doe@example.com",
      "phone_number": "+4799999999",
      "tokens": {
        "payex.creditcard": {
          "payment_token": "<token previously acquired>"
        }
      }
    },
    "order": {
      "amount": 29990,
      "currency": "NOK",
      "vat_amount": 6000,
      "items": [
        {
          "line_id": "1",
          "description": "Stablestol",
          "quantity": 1,
          "amount": 29990,
          "vat_amount": 6000,
          "vat": 25
        }
      ],
      "merchant_reference": "order-1"
    },
    "configuration": {
      "auto_capture": false
    }
  },
  "payment": {
    "payment_product_type": "payex.creditcard",
    "operation": "unscheduled_purchase"
  }
}
```

**bambora.creditcard**

```json theme={null}
{
  "session": {
    "url": {
      "callback_url": "https://example.com/callback?method=GET"
    },
    "customer": {
      "email": "john.doe@example.com",
      "phone_number": "+4799999999",
      "tokens": {
        "bambora.creditcard": {
          "payment_token": "<token previously acquired>"
        }
      }
    },
    "order": {
      "amount": 29990,
      "currency": "NOK",
      "vat_amount": 6000,
      "items": [
        {
          "line_id": "1",
          "description": "Stablestol",
          "quantity": 1,
          "amount": 29990,
          "vat_amount": 6000,
          "vat": 25
        }
      ],
      "merchant_reference": "order-1"
    },
    "configuration": {
      "auto_capture": false
    }
  },
  "payment": {
    "payment_product_type": "bambora.creditcard",
    "operation": "unscheduled_purchase"
  }
}
```

**dintero\_psp.creditcard**

```json theme={null}
{
  "session": {
    "url": {
      "callback_url": "https://example.com/callback?method=GET"
    },
    "customer": {
      "email": "john.doe@example.com",
      "phone_number": "+4799999999",
      "tokens": {
        "dintero_psp.creditcard": {
          "payment_token": "<token previously acquired>"
        }
      }
    },
    "order": {
      "amount": 29990,
      "currency": "NOK",
      "vat_amount": 6000,
      "items": [
        {
          "line_id": "1",
          "description": "Stablestol",
          "quantity": 1,
          "amount": 29990,
          "vat_amount": 6000,
          "vat": 25
        }
      ],
      "merchant_reference": "order-1"
    },
    "configuration": {
      "auto_capture": false
    }
  },
  "payment": {
    "payment_product_type": "dintero_psp.creditcard",
    "operation": "unscheduled_purchase"
  }
}
```

[post session pay]: https://docs.dintero.com/api-reference/payment/checkout_session_pay_post.md

[create session]: https://docs.dintero.com/api-reference/session/checkout_session_profile_post.md


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.