Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Prepaid Payments

Create Prepaid Session

post

Open a Customer Session for the Payment Element.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
organization_idstring · uuidRequired
Responses
200

Successful Response

application/json

Return the Customer Session secret, fee and limits.

customer_session_client_secretstringRequired
card_fee_ratenumberRequired
min_credit_centsintegerRequired
max_credit_centsintegerRequired
post/v2/organizations/{organization_id}/prepaid-payments/session
POST /v2/organizations/{organization_id}/prepaid-payments/session HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "customer_session_client_secret": "text",
  "card_fee_rate": 1,
  "min_credit_cents": 1,
  "max_credit_cents": 1,
  "billing_address": {
    "name": "text",
    "country": "text",
    "line1": "text",
    "line2": "text",
    "city": "text",
    "state": "text",
    "postal_code": "text"
  }
}

List Prepaid Payments

get

List pending payments and recent failures.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
organization_idstring · uuidRequired
Responses
200

Successful Response

application/json

Return one payment for the Credits page.

payment_intent_idstringRequired
statusstring · enumRequiredPossible values:
payment_methodstring · enumRequiredPossible values:
credit_centsintegerRequired
fee_centsintegerRequired
brandstring · nullableRequired
bank_namestring · nullableRequired
last4string · nullableRequired
expected_settlement_atstring · datetime · nullableRequiredExample: 2024-01-01T00:00:00Z
settled_atstring · datetime · nullableRequiredExample: 2024-01-01T00:00:00Z
created_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
updated_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
get/v2/organizations/{organization_id}/prepaid-payments
GET /v2/organizations/{organization_id}/prepaid-payments HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
  {
    "payment_intent_id": "text",
    "status": "processing",
    "payment_method": "ach",
    "credit_cents": 1,
    "fee_cents": 1,
    "brand": "text",
    "bank_name": "text",
    "last4": "text",
    "expected_settlement_at": "2024-01-01T00:00:00Z",
    "settled_at": "2024-01-01T00:00:00Z",
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-01T00:00:00Z"
  }
]

Create Prepaid Payment

post

Charge the confirmation token and record the payment.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
organization_idstring · uuidRequired
Body

Buy credit with a confirmation token.

credit_centsinteger · min: 1000Required
confirmation_tokenstring · min: 1Required
idempotency_keystring · uuidRequired
billing_addressanyOptional
Responses
200

Successful Response

application/json

Return the new payment and any browser action.

payment_intent_idstringRequired
statusstring · enumRequiredPossible values:
payment_methodstring · enumRequiredPossible values:
credit_centsintegerRequired
fee_centsintegerRequired
client_secretstring · nullableOptional
brandstring · nullableOptional
bank_namestring · nullableOptional
last4string · nullableOptional
post/v2/organizations/{organization_id}/prepaid-payments
POST /v2/organizations/{organization_id}/prepaid-payments HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 126

{
  "credit_cents": 1,
  "confirmation_token": "text",
  "idempotency_key": "123e4567-e89b-12d3-a456-426614174000",
  "billing_address": null
}
{
  "payment_intent_id": "text",
  "status": "processing",
  "payment_method": "ach",
  "credit_cents": 1,
  "fee_cents": 1,
  "client_secret": "text",
  "brand": "text",
  "bank_name": "text",
  "last4": "text"
}

Get Prepaid Payment

get

Return one payment for polling.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
organization_idstring · uuidRequired
payment_intent_idstringRequired
Responses
200

Successful Response

application/json

Return one payment with its receipt.

payment_intent_idstringRequired
statusstring · enumRequiredPossible values:
payment_methodstring · enumRequiredPossible values:
credit_centsintegerRequired
fee_centsintegerRequired
brandstring · nullableRequired
bank_namestring · nullableRequired
last4string · nullableRequired
expected_settlement_atstring · datetime · nullableRequiredExample: 2024-01-01T00:00:00Z
settled_atstring · datetime · nullableRequiredExample: 2024-01-01T00:00:00Z
created_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
updated_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
receipt_urlstring · nullableRequired
failure_reasonstring · nullableRequired
get/v2/organizations/{organization_id}/prepaid-payments/{payment_intent_id}
GET /v2/organizations/{organization_id}/prepaid-payments/{payment_intent_id} HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "payment_intent_id": "text",
  "status": "processing",
  "payment_method": "ach",
  "credit_cents": 1,
  "fee_cents": 1,
  "brand": "text",
  "bank_name": "text",
  "last4": "text",
  "expected_settlement_at": "2024-01-01T00:00:00Z",
  "settled_at": "2024-01-01T00:00:00Z",
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-01T00:00:00Z",
  "receipt_url": "text",
  "failure_reason": "text"
}

Last updated