Payment

Payment object

NameTypeDescription

object

string

The type of object, which is "payment" in this case.

id

string

The unique identifier of the payment transaction.

livemode

boolean

Indicates whether the transaction is in live mode (false) or test mode (true).

provider

string

The payment provider used for the transaction (e.g., "invoice").

method

string

The payment method used for the transaction (e.g., "invoice").

status

string

The status of the payment (e.g., "ok" for successful).

policy_id

string

The ID of the policy associated with this payment.

charge_id

string

The ID of the charge, if applicable.

fee

number

The fee amount for the transaction (usually 0 for no fee).

reference

string

A reference ID for the payment, if applicable.

token

string

A token representing the payment transaction.

reason

string

The reason for the payment, if applicable.

processed_at

string

The timestamp when the payment was processed, if applicable.

error_code

string

The error code, if there was an error during the payment process.

metadata

string

An array containing additional metadata about the payment.

transaction_metadata

string

An array containing additional metadata related to the transaction.

customer_id

string

The ID of the customer associated with this payment.

refunds

string

An array of refund objects associated with the payment (empty in this case).

_links

string

An object containing various links related to the payment (e.g., self-link for accessing the payment).

Depending on the requester permissions, some fields of payment object are restricted.

Payment object example
{
    "object": "payment",
    "id": "t84223322f013e2287210b6295010fc6d",
    "livemode": false,
    "provider": "invoice",
    "method": "invoice",
    "status": "ok",
    "policy_id": "tpol_b1fc636ad446d6cb7144cfb31cae",
    "charge_id": null,
    "fee": 0,
    "reference": null,
    "token": "<PAYMENT-TOKEN>",
    "reason": null,
    "processed_at": null,
    "error_code": null,
    "metadata": [],
    "transaction_metadata": [],
    "customer_id": "eyJpZCI6ImRyMCIsIml2IjoiSmlsRXhkRllQUnljMjdQM0ZJSDk1QT09IiwibWFjIjoiNDM1N2VlNWQ1NzY5MGFhNWNkYTJlYzdlYjZiOTI2MmM2ZDZhZmY2NzdmZjU1NGRmMWM2MjcxZGE3NmQ0MGU4OSIsInZhbHVlIjoiU0ZKdHVXSzhqYURPR3ZkTDI5SlZ5V0d3QmQ1Z2RhemVqWVd1V1RBSGFCT3VSbTk5QlBMYVg0bDNTQmhPejlodnVBV1Jzc3BlcmNabzAzMW5yNEM2ZytxaTRxNytrRzZ6SmJSUkNPWDZrWURqaWF1Y2gxUzh0SlQzd0ZRNmpxeHNUKzh4TEJ1YWR4Z1FoOXM1cnIrNHZ3PT0ifQ__",
    "refunds": [],
    "_links": {
        "_self": {
            "href": "https://api.eu1.kaskocloud.com/payments/t84223322f013e2287210b6295010fc6d"
        }
    }
}

Create a payment

Convert an offer to paid policy.

POST https://api.eu1.kaskocloud.com/payments

Query Parameters

NameTypeDescription

key

String

Public key

Headers

NameTypeDescription

Authorization

String

Bearer: <Secret-key>

Request Body

NameTypeDescription

token

String

Payment token

provider

String

Payment provider

method

String

Payment method

policy_id

String

Policy ID

{
  "object": "payment",
  "id": "t7cc6b1ee53d57056256a991b48e61c67",
  "livemode": false,
  "provider": "payment_provider",
  "method": "payment_method",
  "status": "status",
  "transaction_metadata": [],
  "_links": {
    "_self": {
      "href": "https://api.eu1.kaskocloud.com/payments/t7cc6b1ee53d57056256a991b48e61c67"
    }
  }
}
Payment creation request example
curl --location 'https://api.eu1.kaskocloud.com/payments?key=pk_test_2jngq6d7GRmxQ58w0yVKW3PBrJXbEvoM' \
--header 'Content-Type: application/json' \
--data '{
    "token": "<PAYMENT-TOKEN>",
    "method": "invoice",
    "provider": "invoice",
    "policy_id": "tpol_b1fc636ad446d6cb7144cfb31cae"
}'

View payment

View payment

GET https://api.eu1.kaskocloud.com/payments/{paymentId}

Path Parameters

NameTypeDescription

paymentId*

String

Payment ID

Headers

NameTypeDescription

Authorization

String

Bearer: <Secret-key>

{
    "object": "payment",
    "id": "t84223322f013e2287210b6295010fc6d",
    "livemode": false,
    "provider": "invoice",
    "method": "invoice",
    "status": "ok",
    "policy_id": "tpol_b1fc636ad446d6cb7144cfb31cae",
    "charge_id": null,
    "fee": 0,
    "reference": null,
    "token": "<PAYMENT-TOKEN>",
    "reason": null,
    "processed_at": null,
    "error_code": null,
    "metadata": [],
    "transaction_metadata": [],
    "customer_id": "eyJpZCI6ImRyMCIsIml2IjoiSmlsRXhkRllQUnljMjdQM0ZJSDk1QT09IiwibWFjIjoiNDM1N2VlNWQ1NzY5MGFhNWNkYTJlYzdlYjZiOTI2MmM2ZDZhZmY2NzdmZjU1NGRmMWM2MjcxZGE3NmQ0MGU4OSIsInZhbHVlIjoiU0ZKdHVXSzhqYURPR3ZkTDI5SlZ5V0d3QmQ1Z2RhemVqWVd1V1RBSGFCT3VSbTk5QlBMYVg0bDNTQmhPejlodnVBV1Jzc3BlcmNabzAzMW5yNEM2ZytxaTRxNytrRzZ6SmJSUkNPWDZrWURqaWF1Y2gxUzh0SlQzd0ZRNmpxeHNUKzh4TEJ1YWR4Z1FoOXM1cnIrNHZ3PT0ifQ__",
    "refunds": [],
    "_links": {
        "_self": {
            "href": "https://api.eu1.kaskocloud.com/payments/t84223322f013e2287210b6295010fc6d"
        }
    }
}
View payment request example
curl --location 'https://api.eu1.kaskocloud.com/payments/t84223322f013e2287210b6295010fc6a' \
--header 'Accept: application/vnd.kasko.v2+json' \
--header 'Authorization: Bearer <SECRET-KEY>'

Last updated