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

# Store a credit card

Stores card details and returns a token to use in place of the card on later charges (pass it as `card_token`). Returns HTTP `200` on v4 and `201 Created` on v5; the body is the same. `merchant_guid` is returned at the top level, outside `card`.

Tokens expire after first use unless [attached to a customer](https://developers.paychoice.com.au/billing/payment-methods.md).

```json 201 theme={null}
{
  "card": {
    "token": "c629ac3b-682b-41e4-9a81-9445960843cf",
    "card_name": "John Citizen",
    "masked_number": "411111XXXXXX1111",
    "expiry_month": "12",
    "expiry_year": "28",
    "card_type": "Visa",
    "key_id": 1,
    "link": { "href": "/api/v5/token/c629ac3b-682b-41e4-9a81-9445960843cf", "rel": "self" }
  },
  "object_type": "card",
  "merchant_guid": "315564b9-b863-4016-8c53-02c9d8cc80b7",
  "from_item": 0,
  "to_item": 0,
  "total_count": 0
}
```

**card.token** `uuid`

The card token.

**card.card\_type** `string`

`Visa`, `MasterCard`, `AmericanExpress`, `DinersClub`, `Jcb`, `Discover`, `BankCard` or `Unknown`.

**card.masked\_number** `string`

Middle digits masked.


## OpenAPI

````yaml POST /api/v5/Token
openapi: 3.0.1
info:
  title: Paychoice
  version: v5
servers: []
security:
  - basic: []
paths:
  /api/v5/Token:
    post:
      tags:
        - Token
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenDto'
          text/json:
            schema:
              $ref: '#/components/schemas/TokenDto'
          application/*+json:
            schema:
              $ref: '#/components/schemas/TokenDto'
      responses:
        '200':
          description: OK
components:
  schemas:
    TokenDto:
      type: object
      properties:
        card[name]:
          type: string
          nullable: true
        card[number]:
          type: string
          nullable: true
        card[expiry_month]:
          type: integer
          format: int32
        card[expiry_year]:
          type: integer
          format: int32
        merchant_guid:
          type: string
          nullable: true
        card_token:
          type: string
          format: uuid
          nullable: true
        key_id:
          type: integer
          format: int32
        card_type:
          type: integer
          format: int32
          nullable: true
      additionalProperties: false
  securitySchemes:
    basic:
      type: http
      description: Basic Authorization header using the Bearer scheme.
      scheme: basic

````

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