# Overview (/docs/reference/card)

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

<Cards>
<Card href="/docs/../../purchases/post-purchases-" title="Create a purchase – the main request for any e-commerce integration." description={"To run payments in your application use `POST /purchases/`, request to register payments and receive the checkout link (`checkout_url`). After the payment is processed, gateway will redirect the client back to your website (take note of `success_redirect`, `failure_redirect`).\n\nYou have three options to check payment status: 1) use `success_callback` parameter of `Purchase` object; 2) use `GET /purchases/<purchase_id>/` request; 3) set up a Webhook using the UI or Webhook API to listen to `purchase.paid` or `purchase.payment_failure` event on your server.\n\nUsing `skip_capture` flag allows you to separate the authentication and payment execution steps, allowing you to reserve funds on payer’s card account for some time. This flag can also enable preauthorization capability, allowing you to save the card without a financial transaction, if available.\n\nIn case making a purchase client agrees to store his card for the upcoming purchases, next time he will be able to pay in a single click.\n\nInstead of a redirect you can also utilize Direct Post checkout: you can create an HTML `<form>` on your website with `method=\"POST\"` and `action` pointing to `direct_post_url` of a created Purchase. You will also need to saturate form with `<input>`-s for card data fields. As a result, when a payer submits their card data, it will be posted straight to our system, allowing you to customize the checkout as you wish while your PCI DSS requirement is only raised to SAQ A-EP, as your system doesn't receive or process card data. For more details, see the documentation on Purchase's `direct_post_url` field.\n\nTo pay for test Purchases, use `4444 3333 2222 1111` as the card number, `123` as CVC, any date/month greater than now as expiry and any (Latin) cardholder name. Any other card number/CVC/expiry not greater or equal than the current month will all fail a test payment. "} />
<Card href="/docs/../../purchases/get-purchases-id-" title="Retrieve an object by ID." />
<Card href="/docs/../../purchases/post-purchases-id-cancel-" title="Cancel a pending purchase." description="If you have a Purchase that payment is possible for, using this request you can guarantee that it won't be paid." />
<Card href="/docs/../../purchases/post-purchases-id-release-" title="Release funds on hold." description="Release funds reserved for a Purchase (`status == hold`). You can place a `hold` (authenticate the payment) using `skip_capture == true` when creating the Purchase and ensuring your client submits the payment form.

If this operation takes too long to be processed on the acquirer side - you will get a response with status code 200 and a Purchase object having `status` = `pending_release` in body (you will receive a corresponding Webhook callback too for a `purchase.pending_release` event). To be notified of a successful operation completion, please subscribe to `purchase.released` callback event - it will deliver an updated Purchase with `status` = `released`.

If fund release fails due to payment processing error, you will receive HTTP response code 400 with error code `purchase_release_error`. In this case, to get more details about the error, you should perform a `GET /purchase/` request for the Purchase you tried to release funds for. In `transaction_data.attempts[]` array (newest element first) you'll find the corresponding attempt with error code and description in `.error` parameter." />
<Card href="/docs/../../purchases/post-purchases-id-capture-" title="Capture a previously authorized payment." description="Capture funds reserved for a Purchase (`status == hold`). You can place a `hold` (authenticate the payment) using `skip_capture == true` when creating the Purchase and ensuring your client submits the payment form.

If this operation takes too long to be processed on the acquirer side - you will get a response with status code 200 and a Purchase object having `status` = `pending_capture` in body (you will receive a corresponding Webhook callback too for a `purchase.pending_capture` event). To be notified of a successful operation completion, please subscribe to `purchase.captured` callback event - it will deliver an updated Purchase with `status` = `paid`.

If capture fails due to payment processing error, you will receive HTTP response code 400 with error code `purchase_capture_error`. In this case, to get more details about the error, you should perform a `GET /purchase/` request for the Purchase you tried to capture. In `transaction_data.attempts[]` array (newest element first) you'll find the corresponding attempt with error code and description in `.error` parameter. By default the full amount is captured, the `amount` body param is optional." />
<Card href="/docs/../../purchases/post-purchases-id-charge-" title="Charge or Hold a purchase using a saved token." description="Charge or Hold a purchase using a `recurring_token` provided in the request body. Its value should be an `id` of a Purchase that has `is_recurring_token == true`. This purchase will be paid using the same method (e.g. same card) as the one used to pay the `recurring_token` purchase. The Hold will be performed if the Purchase this method is used on has `skip_capture`: `true`.

If this operation takes too long to be processed on the acquirer side - you will get a response with status code 200 and a Purchase object having `status` = `pending_charge` in body (you will receive a corresponding Webhook callback too for a `purchase.pending_charge` event). To be notified of a successful operation completion, please subscribe to `purchase.paid` (or `purchase.hold`) callback event - it will deliver an updated Purchase with `status` = `paid` or `hold` respectively. Alternatively, if charge fails, you will receive a `purchase.payment_failure` callback event.

If recurring charge fails due to payment processing error, you will receive HTTP response code 400 with error code `purchase_charge_error`. In this case, to get more details about the error, you should perform a `GET /purchase/` request for the Purchase you tried to charge. In `transaction_data.attempts[]` array (newest element first) you'll find the corresponding attempt with error code and description in `.error` parameter." />
<Card href="/docs/../../purchases/post-purchases-id-delete-recurring-token-" title="Delete a recurring token associated with a purchase." description="Will set `is_recurring_token` to `false`. You won't be able to use this Purchase's ID as a `recurring_token` anymore. The respective ClientRecurringToken, if any, will also be deleted.

If this operation takes too long to be processed on the acquirer side - you will get a response with status code 200 a corresponding Webhook callback for a `purchase.pending_recurring_token_delete` event. To be notified of a successful operation completion, please subscribe to `purchase.recurring_token_deleted` callback event." />
<Card href="/docs/../../purchases/post-purchases-id-refund-" title="Refund a paid purchase." description="Will generate a Payment object and return it as a successful response. 

Optional `amount` argument can be included in the request body to request a partial refund.

Consult `refund_availability` field on Purchase on details whether this Purchase can be refunded or not.

If this operation takes too long to be processed on the acquirer side - you will get a response with status code 200 and a Purchase object having `status` = `pending_refund` in body (you will receive a corresponding Webhook callback too for a `purchase.pending_refund` event). To be notified of a successful operation completion, please subscribe to `payment.refunded` callback event - it will deliver a Payment generated by this refund.

If refund fails due to payment processing error, you will receive HTTP response code 400 with error code `purchase_refund_error`. In this case, to get more details about the error, you should perform a `GET /purchase/` request for the Purchase you tried to refund. In `transaction_data.attempts[]` array (newest element first) you'll find the corresponding attempt with error code and description in `.error` parameter." />
<Card href="/docs/../../purchases/post-purchases-id-mark-as-paid-" title="Mark a purchase as paid." description="Will set the purchase's status to `paid`. `purchase.marked_as_paid` field will also be set to true to distinguish this purchase." />
<Card href="/docs/../../purchases/post-purchases-id-resend-invoice-" title="Re-sends invoice" description="Will re-send the invoice." />
<Card href="/docs/../../payment-methods/get-payment-methods-" title="Get the list of payment methods available for your purchase." description="Send this request providing, at the very least, the `brand_id` and `currency` query parameters having the same values you'd use to create your Purchase. Be sure to use the same API key you'll create your Purchase with; it will define the test_mode setting used in the lookup.

In the response body you'll receive an object with `available_payment_methods` property containing the list of payment method names available to use with your Purchase (e.g. those codes can be used in `payment_method_whitelist` field or with `?preferred={payment_method}` option of `checkout_url`).

Please note that all lookup arguments must be provided via query parameters after the endpoint, e.g. the minimal call would be similar to: `GET /api/v1/payment_methods/?brand_id=75a76529-91c7-4d98-90a9-8a641d70ee52&currency=EUR`" />
<Card href="/docs/../../payout-methods/get-payout-methods-" title="Get the list of payout methods available for your payout." description="Send this request providing, at the very least, the `brand_id` and `currency` query parameters having the same values you'd use to create your Payout. Be sure to use the same API key you'll create your Payout with; it will define the test_mode setting used in the lookup.

In the response body you'll receive an object with `available_payout_methods` property containing the list of payout method names available to use with your Payout (e.g. those codes can be used in `payout_method_whitelist` field).

Please note that all lookup arguments must be provided via query parameters after the endpoint, e.g. the minimal call would be similar to: `GET /api/v1/payout_methods/?brand_id=75a76529-91c7-4d98-90a9-8a641d70ee52&currency=EUR`" />
<Card href="/docs/../../payouts/post-payouts-" title="Create an unprocessed payout object. A separate request is needed to execute the payout." description="To issue payouts in your application use `POST /payouts/` request to register a payout. Response will contain the payout execution url - `execution_url`. For card payouts send a POST request to `execution_url` with a JSON payload containing recipient's card details: 

`expiry_month`: string; 1-2 digits

`expiry_year`: string; 1-2 digits, 

`card_number`: string; 16-19 chars, 

`cardholder_name`: string; 1-30 chars. <br><br>For wallet payouts, please contact support to get specific details on how to send a POST request to execution_url.<br><br>  You need to do the 2nd request within 15 minutes of creating the Payout object. Response will have a response code of 200 in case of payout initiation success (`status` attribute will be `executed` or `pending`) or an error code/message with a 400 error response code and `status` of `error`.

For response to the second request having a code of 200, status = `success` means that payout was already executed.

 Second request returning status of `pending` means the payout was accepted for processing but not executed yet. In this case, transaction processing can take up to 3-5 days depending on the payout provider. Once the processing will finish, `Payout.status` will change accordingly.

It's advised to subscribe to `payout.failed` and `payout.success` webhook events.

To test card Payouts, use `card_number` of 4444 3333 2222 1111, any `cardholder_name` and `expiry_month`/`expiry_year` equal or larger to the current ones." />
<Card href="/docs/../../payouts/get-payouts-id-" title="Retrieve an object by ID." />
<Card href="/docs/../../billing/post-billing-" title="Send an invoice to one or several clients." description="Use this endpoint to send a one time invoice(-s). Provide all data of a `BillingTemplate` (see Schemas below) and, additionally, an array of one or more BillingTemplateClients in `clients`. Purchases will be created and invoices sent, one for every Client you have specified. 

A BillingTemplate won't be created; if you need to be able to issue repeated, similar invoices, see `POST /billing_templates/` and `POST /billing_templates/{id}/send_invoice/`. 

Note that unlike for other requests where you can send BillingTemplate data (like `POST /billing_templates/`), `title` and `is_subscription` are read-only for `POST /billing/`." />
<Card href="/docs/../../billing/get-billing-templates-" title="List all billing templates." />
<Card href="/docs/../../billing/post-billing-templates-" title="Create a template to issue repeated invoices from in the future, with or without a subscription." description="BillingTemplate generates Purchase objects, either to issue one-time invoices or in a subscription.

It does so by copying over its' `PurchaseDetails`, one of its `BillingTemplateClient`-s and generating other fields from BillingTemplate's fields as necessary into a new `Purchase` object.

If `is_subscription` is `true`, it is considered to be a subscription's BillingTemplate. You will need to specify `subscription_*` fields like `subscription_period` when creating it and add BillingTemplateClient objects to its billing cycle (`POST /billing_templates/{id}/add_subscriber/`). After that the clients will receive recurring invoices (that will be paid for automatically if client saves their card) according to the BillingTemplate settings you have specified.

If `is_subscription` is `false`, this BillingTemplate is used to send one-time invoices. After creating it and specifying `invoice_*` fields, use `POST /billing_templates/{id}/send_invoice/` request to send the actual invoices. BillingTemplateClients for non-subscription BillingTemplates are not saved." />
<Card href="/docs/../../billing/get-billing-templates-id-" title="Retrieve a billing template by ID." />
<Card href="/docs/../../billing/delete-billing-templates-id-" title="Delete a billing template by ID." />
<Card href="/docs/../../billing/put-billing-templates-id-" title="Update a billing template by ID." />
<Card href="/docs/../../billing/post-billing-templates-id-send-invoice-" title="Send an invoice, generating a purchase from billing template data." description="Use this request with a BillingTemplate having `is_subscription == false`. Specify the BillingTemplateClient data (only `client_id` field is needed) in the request body. The request will issue a Purchase by combining data of `BillingTemplate.purchase` and `BillingTemplateClient.client` and will send an invoice to your Client. Response will contain data of a created Purchase. The BillingTemplateClient will not be saved." />
<Card href="/docs/../../billing/post-billing-templates-id-add-subscriber-" title="Add a billing template client and activate recurring billing (is_subscription: true)." description="Use this request with a BillingTemplate having `is_subscription == true`. Two scenarios are possible: 

• If `subscription_charge_period_end == true` and/or `subscription_trial_periods > 0` (first billing should happen after 1 or more billing periods, not today), the request will create a BillingTemplateClient and start trial/schedule billing for it (as required by subscription settings). Successful response will be of form `{billing_template_client: <BillingTemplateClient object created>, purchase: null}`: no Purchase is created, `BillingTemplateClient.status` is `active` immediately. 

• If `subscription_charge_period_end == false` and `subscription_trial_periods == 0` (first billing should occur today), the request will create a BillingTemplateClient with `status == pending` and create a Purchase. When such a Purchase is paid, the respective BillingTemplateClient will have its' subscription activated (starting from the day of payment), with its `status` changing to `active`. Successful response will be of form `{billing_template_client: <BillingTemplateClient object created>, purchase: <Purchase object created>}`: you should redirect your client to `purchase.checkout_url` for him to pay immediately (as you do with `POST /purchases/`)." />
<Card href="/docs/../../billing/get-billing-templates-id-clients-" title="List all billing template clients for this billing template." />
<Card href="/docs/../../billing/get-billing-templates-id-clients-id-" title="Retrieve a billing template client by client's ID." />
<Card href="/docs/../../billing/patch-billing-templates-id-clients-id-" title="Partially update a billing template client by client's ID." />
<Card href="/docs/../../billing/get-billing-templates-id-clients-id-feed-" title="Retrieve a list of Purchases and Refunds for a Client." />
<Card href="/docs/../../clients/get-clients-" title="List all clients." />
<Card href="/docs/../../clients/post-clients-" title="Create a new client." description="Client is a record of a single customer of your business. Create one for each of your clients; you will be able to issue invoices/subscriptions for them later easily using `/billing_templates/` API.

Each BillingTemplateClient (there can be many attached to a single BillingTemplate) will bind a single Client to a BillingTemplate." />
<Card href="/docs/../../clients/get-clients-id-" title="Retrieve an object by ID." />
<Card href="/docs/../../clients/patch-clients-id-" title="Partially update a client by ID." />
<Card href="/docs/../../clients/delete-clients-id-" title="Delete a client by ID." />
<Card href="/docs/../../clients/put-clients-id-" title="Update a client by ID." />
<Card href="/docs/../../clients/get-clients-id-feed-" title="Retrieve a list of Purchases and Refunds for a Client." />
<Card href="/docs/../../clients/get-clients-id-recurring-tokens-" title="List recurring tokens saved for a client." description="All of these tokens will be available in a checkout (see `Purchase.checkout_url`) if you create a Purchase with this client's ID in `client_id` field. 

You can use one in `POST /purchases/{id}/charge/`, too. Note that you can use one client's `recurring_token` to pay a Purchase created for a different `client_id` or created with no `client_id` at all; it's not recommended to do this." />
<Card href="/docs/../../clients/get-clients-id-recurring-tokens-id-" title="Retrieve an object by ID." />
<Card href="/docs/../../clients/delete-clients-id-recurring-tokens-id-" title="Delete a client recurring token by ID." description="If you create the Purchase with the respective Client's ID (in `.client_id`), he won't see this token as available on checkout page anymore. 

You also won't be able to use the ID of this object as a `recurring_token` in `POST /purchases/{id}/charge/`. The respective Purchase will have `is_recurring_token` set to `false` (as if `POST /purchases/{recurring_token}/delete_recurring_token/` was issued)." />
<Card href="/docs/../../webhooks/get-webhooks-" title="List all webhooks." />
<Card href="/docs/../../webhooks/post-webhooks-" title="Create a new webhook." />
<Card href="/docs/../../webhooks/get-webhooks-id-" title="Retrieve an object by ID." />
<Card href="/docs/../../webhooks/patch-webhooks-id-" title="Partially update a webhook by ID." />
<Card href="/docs/../../webhooks/delete-webhooks-id-" title="Delete a webhook by ID." />
<Card href="/docs/../../webhooks/put-webhooks-id-" title="Update a webhook by ID." />
<Card href="/docs/../../webhooks/get-webhooks-deliveries-" title="List webhook deliveries for a specific object." description="Returns a paginated list of webhook deliveries for a specific source object (Purchase, Payment, Payout, or BillingTemplateClient).

You must provide both `id` and `source_type` query parameters to identify the object whose webhook deliveries you want to retrieve.

Deliveries show the complete history of webhook attempts for the specified object, including successful deliveries, failures, and retries." />
<Card href="/docs/../../public-key/get-public-key-" title="Get a callback public key." description="Returns public key for authenticating company callback payloads" />
<Card href="/docs/../../account/get-account-json-balance-" title="Get company balance." description="Returns the company balance according to the provided query string filters. Multiple values can be provided for all filters except `from` and `to`, including all results matching any of these values." />
<Card href="/docs/../../account/get-account-json-turnover-" title="Get company turnover." description="Fetches the company turnover according to the provided query string filters. Must provide exactly one `currency` filter. Multiple values can be provided for all filters except `currency`, `from` and `to`, including all results matching any of these values." />
<Card href="/docs/../../balance/get-balance-" title="Get balance data." description="Returns balance data, including ecommerce and bank accounts." />
<Card href="/docs/../../company-statements/get-company-statements-" title="List all generated statements." />
<Card href="/docs/../../company-statements/post-company-statements-" title="Schedule a statement generation." description="With this request, you can schedule a statement generation for a company. 

In a response, you will get an object with the following structure. Main fields to look out for here are `id`, `status` and `download_url`." />
<Card href="/docs/../../company-statements/get-company-statements-id-" title="Retrieve a statement by ID." />
<Card href="/docs/../../company-statements/post-company-statements-id-cancel-" title="Cancel a statement generation by ID." />
</Cards>
