Transfers

Transfer funds while managing the entities to transfer money to recoup funds from a seller, return money from a refund or to make up the difference when running a promotion.

Initiate a transfer of funds

Initiate a transfer of funds from source entity to destination entity.

SecurityOAuth2: OAuth or API Key: ApiSecretKey
Request
header Parameters
Cko-Idempotency-Key
required
string

An idempotency key for safely retrying transfer requests

Request Body schema: application/json
required

The details of the transfer.

transfer_type
required
string (Transfer type)

The type of transfer

Enum: "commission" "promotion" "refund"
required
object (Transfer source)

The object representing the source of the funds involved in the transfer.

required
object (Transfer destination)

The object representing the destination of the funds involved in the transfer.

reference
string <= 50 characters

A reference you can use later to identify this transfer

Responses
201

Transfer successfully created.

400

Bad Request

401

Unauthorized

422

Invalid data was sent

post/transfers
Request samples
application/json
{
  • "reference": "superhero1234",
  • "transfer_type": "commission",
  • "source": {
    },
  • "destination": {
    }
}
Response samples
application/json
{}

Retrieve a transfer

Retrieve transfer details using the transfer identifier.

SecurityOAuth2: OAuth or API Key: ApiSecretKey
Request
path Parameters
id
required
string

The transfer identifier

Example: tra_y3oqhf46pyzuxjbcn2giaqnb4
Responses
200

Transfer found

400

Bad Request

401

Unauthorized

404

Transfer not found

422

Invalid data was sent

get/transfers/{id}
Request samples
// For more information please refer to https://github.com/checkout/checkout-sdk-net
using Checkout.Transfers;

ICheckoutApi api = CheckoutSdk.Builder().OAuth()
    .ClientCredentials("client_id", "client_secret")
    .Scopes(OAuthScope.Transfers)
    .Environment(Environment.Sandbox)
    .EnvironmentSubdomain("{prefix}") // Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see https://www.checkout.com/docs/developer-resources/api/api-endpoints.
    .HttpClientFactory(new DefaultHttpClientFactory())
    .Build();

CreateTransferRequest createTransferRequest =
    new CreateTransferRequest
    {
        Source = new TransferSourceRequest {Amount = 100, Id = "entity_source_id"},
        Destination = new TransferDestinationRequest {Id = "entity_destination_id"},
        TransferType = TransferType.Commission
    };

try
{
    TransferDetailsResponse transferDetailsResponse = await api.TransfersClient().RetrieveATransfer("transfer_id");
}
catch (CheckoutApiException e)
{
    // API error
    string requestId = e.RequestId;
    var statusCode = e.HttpStatusCode;
    IDictionary<string, object> errorDetails = e.ErrorDetails;
}
catch (CheckoutArgumentException e)
{
    // Bad arguments
}
catch (CheckoutAuthorizationException e)
{
    // Invalid authorization
}
Response samples
application/json
{
  • "id": "tra_y3oqhf46pyzuxjbcn2giaqnb4",
  • "reference": "superhero1234",
  • "status": "rejected",
  • "transfer_type": "commission",
  • "requested_on": "2021-12-15T09:15:02.3845763Z",
  • "reason_codes": [
    ],
  • "source": {
    },
  • "destination": {
    },
}