bitcain docs
API Reference

Fiat On Ramp

Fiat currency on-ramp - buy cryptocurrency with credit card or bank transfer

Estimate Purchase Fees

POST
/api/v1/fiat/estimate

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

fiat_currency?string

Fiat currency code

Default"USD"
Length3 <= length <= 10
fiat_amount*|

Amount in fiat currency

crypto_currency*string

Cryptocurrency symbol

Length2 <= length <= 10
payment_method_type*string

Payment method type for fee calculation

Value in"credit_card" | "debit_card" | "bank_account" | "ach"

Response Body

application/json

application/json

curl -X POST "https://loading/api/v1/fiat/estimate" \  -H "Content-Type: application/json" \  -d '{    "fiat_amount": 0,    "crypto_currency": "string",    "payment_method_type": "credit_card"  }'
{
  "fiat_currency": "string",
  "fiat_amount": "string",
  "crypto_currency": "string",
  "payment_method_type": "credit_card",
  "platform_fee": "string",
  "platform_fee_percentage": "string",
  "payment_processor_fee": "string",
  "payment_processor_fee_percentage": "string",
  "network_fee": "string",
  "total_fee": "string",
  "exchange_rate": "string",
  "crypto_amount": "string",
  "net_fiat_amount": "string",
  "rate_expires_at": "2019-08-24T14:15:22Z",
  "estimated_delivery_time": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Purchase Limits

GET
/api/v1/fiat/limits

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/v1/fiat/limits"
{
  "kyc_tier": 3,
  "tier_description": "string",
  "card_daily_limit_usd": "string",
  "card_daily_used_usd": "string",
  "card_daily_remaining_usd": "string",
  "card_monthly_limit_usd": "string",
  "card_monthly_used_usd": "string",
  "card_monthly_remaining_usd": "string",
  "bank_daily_limit_usd": "string",
  "bank_daily_used_usd": "string",
  "bank_daily_remaining_usd": "string",
  "bank_monthly_limit_usd": "string",
  "bank_monthly_used_usd": "string",
  "bank_monthly_remaining_usd": "string",
  "min_transaction_usd": "string",
  "max_transaction_usd": "string",
  "next_tier": 0,
  "next_tier_card_daily_limit": "string",
  "next_tier_bank_daily_limit": "string",
  "upgrade_available": false
}

Initiate Purchase

POST
/api/v1/fiat/purchase

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

fiat_currency?string

Fiat currency code (ISO 4217)

Default"USD"
Length3 <= length <= 10
fiat_amount*|

Amount in fiat currency to spend

crypto_currency*string

Cryptocurrency symbol to purchase (e.g., BTC, ETH)

Length2 <= length <= 10
payment_method_id?|

UUID of saved payment method (optional, uses default if not provided)

idempotency_key?|

Client-provided idempotency key to prevent duplicate transactions

Response Body

application/json

application/json

curl -X POST "https://loading/api/v1/fiat/purchase" \  -H "Content-Type: application/json" \  -d '{    "fiat_amount": 0,    "crypto_currency": "string"  }'
{
  "id": "string",
  "user_id": "string",
  "transaction_reference": "string",
  "transaction_type": "purchase",
  "status": "pending",
  "fiat_currency": "string",
  "fiat_amount": "string",
  "crypto_currency": "string",
  "crypto_amount": "string",
  "exchange_rate": "string",
  "platform_fee": "string",
  "payment_processor_fee": "string",
  "network_fee": "string",
  "total_fee": "string",
  "payment_method_id": "string",
  "payment_method_type": "credit_card",
  "payment_method_last4": "string",
  "provider_name": "string",
  "provider_transaction_id": "string",
  "provider_status": "string",
  "failure_reason": "string",
  "failure_code": "string",
  "initiated_at": "2019-08-24T14:15:22Z",
  "processing_at": "2019-08-24T14:15:22Z",
  "completed_at": "2019-08-24T14:15:22Z",
  "failed_at": "2019-08-24T14:15:22Z",
  "cancelled_at": "2019-08-24T14:15:22Z",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

List Transactions

GET
/api/v1/fiat/transactions

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

page?integer

Page number (1-indexed)

Default1
Range1 <= value
per_page?integer

Items per page

Default50
Range1 <= value <= 100
status_filter?|

Filter by status

Response Body

application/json

application/json

curl -X GET "https://loading/api/v1/fiat/transactions"
{
  "transactions": [
    {
      "id": "string",
      "transaction_reference": "string",
      "status": "pending",
      "fiat_currency": "string",
      "fiat_amount": "string",
      "crypto_currency": "string",
      "crypto_amount": "string",
      "total_fee": "string",
      "payment_method_type": "credit_card",
      "payment_method_last4": "string",
      "initiated_at": "2019-08-24T14:15:22Z",
      "completed_at": "2019-08-24T14:15:22Z"
    }
  ],
  "total_count": 0,
  "page": 1,
  "per_page": 50
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Transaction

GET
/api/v1/fiat/transactions/{transaction_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

transaction_id*string

Response Body

application/json

application/json

curl -X GET "https://loading/api/v1/fiat/transactions/string"
{
  "id": "string",
  "user_id": "string",
  "transaction_reference": "string",
  "transaction_type": "purchase",
  "status": "pending",
  "fiat_currency": "string",
  "fiat_amount": "string",
  "crypto_currency": "string",
  "crypto_amount": "string",
  "exchange_rate": "string",
  "platform_fee": "string",
  "payment_processor_fee": "string",
  "network_fee": "string",
  "total_fee": "string",
  "payment_method_id": "string",
  "payment_method_type": "credit_card",
  "payment_method_last4": "string",
  "provider_name": "string",
  "provider_transaction_id": "string",
  "provider_status": "string",
  "failure_reason": "string",
  "failure_code": "string",
  "initiated_at": "2019-08-24T14:15:22Z",
  "processing_at": "2019-08-24T14:15:22Z",
  "completed_at": "2019-08-24T14:15:22Z",
  "failed_at": "2019-08-24T14:15:22Z",
  "cancelled_at": "2019-08-24T14:15:22Z",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

List Payment Methods

GET
/api/v1/fiat/payment-methods

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/v1/fiat/payment-methods"
{
  "payment_methods": [
    {
      "id": "string",
      "user_id": "string",
      "method_type": "credit_card",
      "card_brand": "string",
      "card_last4": "string",
      "card_exp_month": 0,
      "card_exp_year": 0,
      "bank_name": "string",
      "bank_account_type": "checking",
      "bank_account_last4": "string",
      "billing_name": "string",
      "billing_email": "string",
      "billing_city": "string",
      "billing_state": "string",
      "billing_country": "string",
      "is_default": true,
      "is_verified": true,
      "is_active": true,
      "nickname": "string",
      "provider_name": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z",
      "last_used_at": "2019-08-24T14:15:22Z",
      "verified_at": "2019-08-24T14:15:22Z"
    }
  ],
  "total_count": 0
}

Add Payment Method

POST
/api/v1/fiat/payment-methods

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

method_type*string

Payment method type

Value in"credit_card" | "debit_card" | "bank_account" | "ach"
card_brand?|

Card brand (Visa, Mastercard, etc.)

card_last4?|

Last 4 digits of card

card_exp_month?|

Card expiration month (1-12)

card_exp_year?|

Card expiration year

bank_name?|

Bank name

bank_account_type?|

Bank account type

bank_account_last4?|

Last 4 digits of account

bank_routing_number_last4?|

Last 4 digits of routing number

provider_name?|

Payment provider name

provider_payment_method_id*string

Provider payment method token

Lengthlength <= 200
provider_customer_id?|

Provider customer ID

billing_name*string

Billing name

Lengthlength <= 200
billing_email?|

Billing email

billing_address_line1*string

Billing address line 1

Lengthlength <= 255
billing_address_line2?|

Billing address line 2

billing_city*string

Billing city

Lengthlength <= 100
billing_state?|

Billing state/province

billing_postal_code*string

Billing postal code

Lengthlength <= 20
billing_country*string

Billing country (ISO 3166-1 alpha-2)

Length2 <= length <= 2
nickname?|

User-friendly nickname

is_default?boolean

Set as default payment method

Defaultfalse

Response Body

application/json

application/json

curl -X POST "https://loading/api/v1/fiat/payment-methods" \  -H "Content-Type: application/json" \  -d '{    "method_type": "credit_card",    "provider_payment_method_id": "string",    "billing_name": "string",    "billing_address_line1": "string",    "billing_city": "string",    "billing_postal_code": "string",    "billing_country": "st"  }'
{
  "id": "string",
  "user_id": "string",
  "method_type": "credit_card",
  "card_brand": "string",
  "card_last4": "string",
  "card_exp_month": 0,
  "card_exp_year": 0,
  "bank_name": "string",
  "bank_account_type": "checking",
  "bank_account_last4": "string",
  "billing_name": "string",
  "billing_email": "string",
  "billing_city": "string",
  "billing_state": "string",
  "billing_country": "string",
  "is_default": true,
  "is_verified": true,
  "is_active": true,
  "nickname": "string",
  "provider_name": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "last_used_at": "2019-08-24T14:15:22Z",
  "verified_at": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Remove Payment Method

DELETE
/api/v1/fiat/payment-methods/{payment_method_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

payment_method_id*string

Response Body

application/json

application/json

curl -X DELETE "https://loading/api/v1/fiat/payment-methods/string"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}