Skip to main content

Take a Card Deposit

Players can deposit with a credit card. A charge collects funds into your merchant balance; you then credit the player's wallet with an internal transfer (see Pay out winnings — the same wallet→wallet mechanic).

This page summarizes the card flow in the casino context. For the full card lifecycle — tokenization, 3DS authentication, fingerprinting — follow the dedicated Create charge guide.

1. Add the card as a payment method

curl -i -X POST \
https://sandbox-api.pathly.io/payment-methods/cards \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "<CUSTOMER_ID>",
"number": "4111111111111111",
"cvv": "123",
"exp_month": "12",
"exp_year": "2028",
"billing_details": { "name": "Peter Griffin", "address": { "country": "US" } }
}'

The response returns a payment method id of type: "card". For the full request and response, see the Create a card API reference.

2. Create the charge

curl -i -X POST \
https://sandbox-api.pathly.io/charges \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "<CUSTOMER_ID>",
"payment_method_id": "<CARD_PAYMENT_METHOD_ID>",
"amount": { "value": 5000, "currency": "USD" },
"description": "Wallet deposit"
}'

amount.value is in the smallest currency unit (cents). The charge resolves to succeeded, failed, or pending (e.g. while 3DS or the acquirer completes). Subscribe to charge.updated (see webhooks) to learn the outcome. For the full request and response, see the Create a charge API reference.

3. Credit the player's wallet

Once the charge succeeded, move the deposited amount from your merchant wallet to the player's wallet with an internal transfer — see Pay out winnings. The mechanics are identical; only the reference differs (e.g. "deposit").

Bank deposits

To let players top up directly from a bank account instead of a card, use a pull transfer — see Fund a wallet from a bank account.