---
title: "Create payment details"
method: POST
path: "/payment_details"
---

# Create payment details

`POST /payment_details`

## Request

- Base URL: `https://api.sandbox.cleeng.com/3.1`
- URL: `https://api.sandbox.cleeng.com/3.1/payment_details`
- Auth: API key in header `X-Publisher-Token`

Creates payment details (e.g. if a user adds a card). 

If the status `active` of the new payment details is `true`, they are used for making payments (for example in a recurring process). If the status `active` is `false`, these new payment details, though created, are not used for making payments.

## Headers

- `X-Publisher-Token` string

## Request body

- object
  - `customerId` integer, required: Customer identifier at Cleeng, e.g. 316720888
  - `token` string, required: A token from a remote payment gateway that is used for charging a remote payment gateway in a recurring process
  - `paymentMethodId` integer, required: An identifier of payment method, provided by Cleeng. </br> Must be a positive integer (greater that 0).
  - `paymentMethodSpecificParams` object: Specific parameters of a payment method
    - `holderName` string
    - `lastCardFourDigits` string
    - `variant` string
    - `cardExpirationDate` string
  - `active` boolean: If true, then specified payment details will be used for a recurring process.

## Response `200`

200

- object
  - `success` boolean
  - `data` object
    - `id` integer
    - `customerId` integer
    - `token` string
    - `paymentGateway` string
    - `paymentMethod` string
    - `paymentMethodSpecificParams` object
      - `payerId` string
      - `holderName` string
    - `paymentMethodId` integer
    - `active` boolean
  - `message` string

## Other responses

- `400`: 400
- `401`: 401
- `404`: 404
- `422`: 422

---

[API](https://skmtc.dev/cleeng/apis/api-31.md) - [All operations](https://skmtc.dev/cleeng/apis/api-31/llms.txt) - [OpenAPI document](https://skmtc.dev/cleeng/apis/api-31/revisions/df55396cda4f?raw)
