Flex docs
NAV
cURL Java PHP Python Ruby

Topics

API Endpoints

We provide two distinct base urls for making API requests depending on whether you would like to utilize the sandbox or live environments. These two environments are completely separate and share no information, including API credentials. For testing please use the Sandbox API and when you are ready to process live transactions use the Live endpoint.

Authentication

# With CURL, just supply your username as basic auth (-u) in the header of each request as follows:

curl https://flex.sandbox-payments-api.com/ \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7

/*
Add the following to your pom.xml (Maven file):

<dependency>
  <groupId>io.finix.payments.processing.client</groupId>
  <artifactId>finix</artifactId>
  <version>1.0.6</version>
</dependency>

...

<repositories>
  <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/</url>
      <snapshots>
          <enabled>true</enabled>
      </snapshots>
  </repository>
</repositories>

*/

import io.finix.payments.ApiClient;
import io.finix.payments.views.*;
import io.finix.payments.forms.*;

//...

public static void main(String[] args) {

  ApiClient api = ApiClient.builder()
                  .url("https://flex.sandbox-payments-api.com")
                  .user("USdCBTiL4BwY9jJ6Mq12ymrW")
                  .password("d294d534-b1f7-473b-bc56-7f76ccb011e7")
                  .build();
//...

<?php
// Download the PHP Client here: https://github.com/finix-payments/processing-php-client

require_once('vendor/autoload.php');
require(__DIR__ . '/src/Finix/Settings.php');

Finix\Settings::configure([
    "root_url" => 'https://flex.sandbox-payments-api.com',
    "username" => 'USdCBTiL4BwY9jJ6Mq12ymrW',
    "password" => 'd294d534-b1f7-473b-bc56-7f76ccb011e7']
    );

require(__DIR__ . '/src/Finix/Bootstrap.php');
Finix\Bootstrap::init();



# To install the python client run the command below from your terminal:
# pip install finix

import finix

from finix.config import configure
configure(root_url="https://flex.sandbox-payments-api.com", auth=("USdCBTiL4BwY9jJ6Mq12ymrW", "d294d534-b1f7-473b-bc56-7f76ccb011e7"))

# To download the Ruby gem:
# gem install finix

require 'finix'

Finix.configure(
    :root_url => 'https://flex.sandbox-payments-api.com',
    :user=>'USdCBTiL4BwY9jJ6Mq12ymrW',
    :password => 'd294d534-b1f7-473b-bc56-7f76ccb011e7'
)

To communicate with the Finix API you’ll need to authenticate your requests via http basic access authentication with a username and password, which you can locate in your dashboard. If you do not have a dashboard feel free to test the API with the credentials below:

Your Application is a resource that represents your web app. In other words, any web service that connects buyers (i.e. customers) and sellers (i.e. merchants).

Errors

HTTP Code Meaning
400 Bad Request – You’ve attemped an invalid request
401 Unauthorized – You have used the incorrect API key
402 Upstream Processor Error – Errors caused by 3rd party service
404 Not Found – The specified resource could not be found
422 Unprocessable Entity – The parameters were valid but the request failed. The error is usually some misunderstanding of various steps that have to be executed in order (e.g. attempting to initiate a transfer on behalf of a merchant that has not yet been approved)
500 Internal Server Error – We had a problem with our server. Try again later.

Below are the different error values that the messages attribute will return for Push to Card. Error Code | Messages ———————————————————|——————————————————————————————————————– REFER_TO_CARD_ISSUER | Please contact card issuer for more information. INVALID_MERCHANT | Merchant not permitted for this transaction type PICK_UP_CARD_NO_FRAUD | Please contact card issuer for more information. DO_NOT_HONOR | Please contact card issuer for more information. ERROR | Please attempt transaction again but if it still cannot be processed try again at a later time PICK_UP_CARD_FRAUD_ACCOUNT | Please contact card issuer for more information. INVALID_TRANSACTION | Issuing bank does not support this transaction type on this card. Please contact card issuer for more information. INVALID_AMOUNT_OR_CURRENCY | Transaction violates network amount limit. INVALID_ACCOUNT_NUMBER | The account number does not exist. Please make sure the account number is correct or contact your issuer. NO_SUCH_ISSUER | The issuer can not be found. Please check card number to ensure it is valid. RE_ENTER_TRANSACTION | Please attempt transaction again and contact card issuer if it still cannot be processed. NO_ACTION_TAKEN | Please contact card issuer for more information. UNABLE_TO_LOCATE_RECORD | The account number does not exist. Please make sure the account number is correct or contact your issuer. FILE_TEMPORARILY_NOT_AVAILABLE | Please contact card issuer for more information. NO_CREDIT_ACCOUNT | Issuer has declined the transaction because the card is not a credit account. Please try another card. LOST_CARD_PICK_UP_FRAUD_ACCOUNT | Please contact card issuer for more information. STOLEN_CARD_PICK_UP_FRAUD_ACCOUNT | Please contact card issuer for more information. NOT_SUFFICIENT_FUNDS | Card issuer has declined the transaction as it does not have sufficient funds. NO_CHECKING_ACCOUNT | The card is not tied to a checking account and thus cannot be processed. Please try another card. NO_SAVINGS_ACCOUNT | The card is not tied to a savings account and thus cannot be processed. Please try another card. EXPIRED_CARD | The expiration date is expired or missing. Please correct and try again. INCORRECT_PIN | The PIN is invalid or missing. Please try again with the correct PIN. TRANSACTION_NOT_PERMITTED | Transaction not permitted to cardholder. Please contact card issuer for more information. SUSPECTED_FRAUD | Please contact card issuer for more information. EXCEEDS_APPROVAL_AMOUNT_LIMIT | Transaction violates issuer amount limit. Please contact card issuer for more information or try with another card. RESTRICTED_CARD | Card not supported in this region or country. Please contact card issuer for more information. TRANSACTION_DOES_NOT_FULFILL_AML_REQUIREMENT | This transaction does not fulfill compliance requirements and cannot be processed. EXCEEDS_WITHDRAWAL_FREQUENCY_LIMIT | Please attempt with another card or contact card issuer for more information. ALLOWABLE_NUMBER_OF_PIN_ENTRY_TRIES_EXCEEDED | The maximum permitted number of PIN entry attempts has been exceeded. Please use another payment method. CRYPTOGRAPHIC_ERROR_FOUND_IN_PIN | The supplied PIN is invalid. NEGATIVE_RESULTS | Invalid security code. CANNOT_VERIFY_PIN | The PIN is invalid or missing. Please try again with the correct PIN. ISSUER_INOPERATIVE | Please attempt transaction again and contact card issuer if it still cannot be processed. FINANCIAL_INSTITUTION_NOT_FOUND | The issuer can not be found. Please check card number to ensure it is valid. TRANSACTION_NOT_COMPLETED_LAW_VIOLATION | The transaction cannot be completed because it violates a law. SURCHARGE_AMOUNT_NOT_SUPPORTED | The supplied surcharge amount is not supported by the issuer. TRANSACTION_AMOUNT_EXCEEDS_PREAUTHORIZED_APPROVAL_AMOUNT | Transaction violates amount limit. CARD_AUTHENTICATION_FAILED | Please contact card issuer for more information. STOP_PAYMENT_ORDER | Please contact card issuer for more information.

Idempotency Requests

You’ll notice the authorization and transfer object have a field named idempotency_id which ensures the API request is only performed once. Why is this important? We’ve all experienced a hanging request while on a checkout page and feared that if we refresh or submit the payment again we’ll be charged twice. With Finix, we remove the ambiguity by having the user generate a unique idempotency_id and sending it with the normal payload. If the user attempts a request with the same idempotency_id, the response will raise an exception. Now you can rest assured that when you create an authorization or debit a bank account that the user will be protected from potential network issues by simply passing idempotency_id in body of the request.

Tags

All Finix objects (i.e. Authorization, Application, Identity, Merchant, Payment Instrument, Settlement, Transfer) include a tags attribute that allows the user to include key-value metadata to their object. For example, when creating a Payment Instrument, you may want to include more data about the card. Simply pass a custom key and value, such as “card-type”: “business card”. Or when creating an Authorization, you may want to include specific information about the transaction, such as a unique ID or additional information about the transaction.

Guides

Overview

These guides provide a collection of resources for utilizing the Finix API and its client libraries. We offer a number of client libraries for interfacing with the API, and you can view example code snippets for each in the dark area to the right.

  1. Authentication: Learn how to properly authenticate and interface with the API.

  2. Getting Started: A step-by-step guide demonstrating the basic workflow of charging a card. This guide will walk you through provisioning merchant accounts, tokenizing cards, charging those cards, and finally settling (i.e. payout) those funds out to your merchants.

  3. Tokenization with Hosted Fields: This guide explains how to properly tokenize cards in live via hosted fields.

Getting Started

Step 1: Create an Identity for a Merchant

curl https://flex.sandbox-payments-api.com/identities \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
    {
        "tags": {
          "Studio Rating": "4.7"
        }, 
        "entity": {
          "last_name": "Sunkhronos", 
          "max_transaction_amount": 12000000, 
          "has_accepted_credit_cards_previously": true, 
          "default_statement_descriptor": "Pollos Hermanos", 
          "personal_address": {
              "city": "San Mateo", 
              "country": "USA", 
              "region": "CA", 
              "line2": "Apartment 7", 
              "line1": "741 Douglass St", 
              "postal_code": "94114"
          }, 
          "incorporation_date": {
              "year": 1978, 
              "day": 27, 
              "month": 6
          }, 
          "business_address": {
              "city": "San Mateo", 
              "country": "USA", 
              "region": "CA", 
              "line2": "Apartment 8", 
              "line1": "741 Douglass St", 
              "postal_code": "94114"
          }, 
          "ownership_type": "PRIVATE", 
          "first_name": "dwayne", 
          "title": "CEO", 
          "business_tax_id": "123456789", 
          "doing_business_as": "Pollos Hermanos", 
          "principal_percentage_ownership": 50, 
          "email": "user@example.org", 
          "mcc": "0742", 
          "phone": "1234567890", 
          "business_name": "Pollos Hermanos", 
          "tax_id": "123456789", 
          "business_type": "INDIVIDUAL_SOLE_PROPRIETORSHIP", 
          "business_phone": "+1 (408) 756-4497", 
          "dob": {
              "year": 1978, 
              "day": 27, 
              "month": 6
          }, 
          "url": "www.PollosHermanos.com", 
          "annual_card_volume": 12000000
        },
        "additional_underwriting_data":{
          "average_card_transfer_amount":200000,
          "average_ach_transfer_amount":200000,
          "annual_ach_volume":200000,
          "business_description":"SB3 vegan cafe",
          "credit_check_ip_address":"42.1.1.113",
          "credit_check_timestamp":"2021-04-28T16:42:55Z",
          "credit_check_allowed":true,
          "credit_check_user_agent":"Mozilla 5.0(Macintosh; IntelMac OS X 10 _14_6)",
          "merchant_agreement_accepted":true,
          "merchant_agreement_ip_address":"42.1.1.113",
          "merchant_agreement_timestamp":"2021-04-28T16:42:55Z",
          "merchant_agreement_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6)",
          "refund_policy":"MERCHANDISE_EXCHANGE_ONLY",
          "card_volume_distribution":{
              "card_present_percentage":30,
              "ecommerce_percentage":60,
              "mail_order_telephone_order_percentage":10
          },
          "volume_distribution_by_business_type": {
              "business_to_business_volume_percentage": 100,
              "business_to_consumer_volume_percentage": 0,
              "person_to_person_volume_percentage": 0,
              "consumer_to_consumer_volume_percentage": 0
          }
        }
    }'

import io.finix.payments.ApiClient;
import io.finix.payments.enums.BusinessType;
import io.finix.payments.forms.Address;
import io.finix.payments.forms.Date;
import io.finix.payments.forms.IdentityEntityForm;
import io.finix.payments.forms.IdentityForm;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.views.Identity;


IdentityForm form = IdentityForm.builder()
  .entity(IdentityEntityForm.builder()
  .firstName("dwayne")
  .lastName("Sunkhronos")
  .email("user@example.org")
  .businessName("business inc")
  .businessType(BusinessType.LIMITED_LIABILITY_COMPANY)
  .doingBusinessAs("doingBusinessAs")
  .phone("1234567890")
  .businessPhone("+1 (408) 756-4497")
  .taxId("123456789")
  .businessTaxId("123456789")
  .personalAddress(Address.builder()
  .line1("741 Douglass St")
  .line2("Apartment 7")
  .city("San Mateo")
  .region("CA")
  .postalCode("94114")
  .country("USA")
  .build())
  .businessAddress(Address.builder()
  .line1("741 Douglass St")
  .line2("Apartment 7")
  .city("San Mateo")
  .region("CA")
  .postalCode("94114")
  .country("USA")
  .build())
  .dob(Date.builder().day(Integer.valueOf(27)).month(Integer.valueOf(5)).year(Integer.valueOf(1978)).build())
  .maxTransactionAmount(Long.valueOf(1000L))
  .mcc("7399").url("http://sample-entity.com")
  .annualCardVolume(Long.valueOf(100L))
  .defaultStatementDescriptor("Business Inc")
  .incorporationDate(Date.builder().day(Integer.valueOf(1)).month(Integer.valueOf(12)).year(Integer.valueOf(2012)).build())
  .principalPercentageOwnership(Integer.valueOf(51)).build()).build();

Maybe<Identity> response = api.identities.post(form);
if(! response.succeeded().booleanValue()) {
    ApiError error = response.error();
    System.out.println(error.getCode());
    throw new RuntimeException("API error attempting to create Identity");
}
    Identity identity = (Identity)response.view();
    identity.getId();

<?php
use Finix\Resources\Identity;

$identity = new Identity(
    array(
        "tags"=> array(
            "Studio Rating"=> "4.7"
        ),
        "entity"=> array(
            "last_name"=> "Sunkhronos",
            "max_transaction_amount"=> 12000000,
            "has_accepted_credit_cards_previously"=> true,
            "default_statement_descriptor"=> "Pawny City Hall",
            "personal_address"=> array(
                "city"=> "San Mateo",
                "country"=> "USA",
                "region"=> "CA",
                "line2"=> "Apartment 7",
                "line1"=> "741 Douglass St",
                "postal_code"=> "94114"
            ),
            "incorporation_date"=> array(
                "year"=> 1978,
                "day"=> 27,
                "month"=> 6
            ),
            "business_address"=> array(
                "city"=> "San Mateo",
                "country"=> "USA",
                "region"=> "CA",
                "line2"=> "Apartment 8",
                "line1"=> "741 Douglass St",
                "postal_code"=> "94114"
            ),
            "ownership_type"=> "PRIVATE",
            "first_name"=> "dwayne",
            "title"=> "CEO",
            "business_tax_id"=> "123456789",
            "doing_business_as"=> "Pawny City Hall",
            "principal_percentage_ownership"=> 50,
            "email"=> "user@example.org",
            "mcc"=> "0742",
            "phone"=> "1234567890",
            "business_name"=> "Pawny City Hall",
            "tax_id"=> "123456789",
            "business_type"=> "INDIVIDUAL_SOLE_PROPRIETORSHIP",
            "business_phone"=> "+1 (408) 756-4497",
            "dob"=> array(
                "year"=> 1978,
                "day"=> 27,
                "month"=> 6
            ),
            "url"=> "www.PawnyCityHall.com",
            "annual_card_volume"=> 12000000
        )
    )
);
$identity = $identity->save();



from finix.resources import Identity

identity = Identity(**
    {
        "tags": {
            "Studio Rating": "4.7"
        },
        "entity": {
            "last_name": "Sunkhronos",
            "max_transaction_amount": 12000000,
            "has_accepted_credit_cards_previously": True,
            "default_statement_descriptor": "Pawny City Hall",
            "personal_address": {
                "city": "San Mateo",
                "country": "USA",
                "region": "CA",
                "line2": "Apartment 7",
                "line1": "741 Douglass St",
                "postal_code": "94114"
            },
            "incorporation_date": {
                "year": 1978,
                "day": 27,
                "month": 6
            },
            "business_address": {
                "city": "San Mateo",
                "country": "USA",
                "region": "CA",
                "line2": "Apartment 8",
                "line1": "741 Douglass St",
                "postal_code": "94114"
            },
            "ownership_type": "PRIVATE",
            "first_name": "dwayne",
            "title": "CEO",
            "business_tax_id": "123456789",
            "doing_business_as": "Pawny City Hall",
            "principal_percentage_ownership": 50,
            "email": "user@example.org",
            "mcc": "0742",
            "phone": "1234567890",
            "business_name": "Pawny City Hall",
            "tax_id": "123456789",
            "business_type": "INDIVIDUAL_SOLE_PROPRIETORSHIP",
            "business_phone": "+1 (408) 756-4497",
            "dob": {
                "year": 1978,
                "day": 27,
                "month": 6
            },
            "url": "www.PawnyCityHall.com",
            "annual_card_volume": 12000000
        }
    }).save()

identity = Finix::Identity.new(
    {
        "tags"=> {
            "Studio Rating"=> "4.7"
        },
        "entity"=> {
            "last_name"=> "Sunkhronos",
            "max_transaction_amount"=> 12000000,
            "has_accepted_credit_cards_previously"=> true,
            "default_statement_descriptor"=> "Pawny City Hall",
            "personal_address"=> {
                "city"=> "San Mateo",
                "country"=> "USA",
                "region"=> "CA",
                "line2"=> "Apartment 7",
                "line1"=> "741 Douglass St",
                "postal_code"=> "94114"
            },
            "incorporation_date"=> {
                "year"=> 1978,
                "day"=> 27,
                "month"=> 6
            },
            "business_address"=> {
                "city"=> "San Mateo",
                "country"=> "USA",
                "region"=> "CA",
                "line2"=> "Apartment 8",
                "line1"=> "741 Douglass St",
                "postal_code"=> "94114"
            },
            "ownership_type"=> "PRIVATE",
            "first_name"=> "dwayne",
            "title"=> "CEO",
            "business_tax_id"=> "123456789",
            "doing_business_as"=> "Pawny City Hall",
            "principal_percentage_ownership"=> 50,
            "email"=> "user@example.org",
            "mcc"=> "0742",
            "phone"=> "1234567890",
            "business_name"=> "Pawny City Hall",
            "tax_id"=> "123456789",
            "business_type"=> "INDIVIDUAL_SOLE_PROPRIETORSHIP",
            "business_phone"=> "+1 (408) 756-4497",
            "dob"=> {
                "year"=> 1978,
                "day"=> 27,
                "month"=> 6
            },
            "url"=> "www.PawnyCityHall.com",
            "annual_card_volume"=> 12000000
        }
    }).save

Example Response:

{
  "id" : "IDjdBo2JNzYe4F6Uhi6rLwr2",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "entity" : {
    "title" : "CEO",
    "first_name" : "dwayne",
    "last_name" : "Sunkhronos",
    "email" : "user@example.org",
    "business_name" : "Pollos Hermanos",
    "business_type" : "INDIVIDUAL_SOLE_PROPRIETORSHIP",
    "doing_business_as" : "Pollos Hermanos",
    "phone" : "1234567890",
    "business_phone" : "+1 (408) 756-4497",
    "personal_address" : {
      "line1" : "741 Douglass St",
      "line2" : "Apartment 7",
      "city" : "San Mateo",
      "region" : "CA",
      "postal_code" : "94114",
      "country" : "USA"
    },
    "business_address" : {
      "line1" : "741 Douglass St",
      "line2" : "Apartment 8",
      "city" : "San Mateo",
      "region" : "CA",
      "postal_code" : "94114",
      "country" : "USA"
    },
    "mcc" : "0742",
    "dob" : {
      "day" : 27,
      "month" : 6,
      "year" : 1978
    },
    "max_transaction_amount" : 12000000,
    "amex_mid" : null,
    "discover_mid" : null,
    "url" : "www.PollosHermanos.com",
    "annual_card_volume" : 12000000,
    "has_accepted_credit_cards_previously" : true,
    "incorporation_date" : {
      "day" : 27,
      "month" : 6,
      "year" : 1978
    },
    "principal_percentage_ownership" : 50,
    "short_business_name" : null,
    "ownership_type" : "PRIVATE",
    "tax_authority" : null,
    "tax_id_provided" : true,
    "business_tax_id_provided" : true,
    "default_statement_descriptor" : "Pollos Hermanos"
  },
  "tags" : {
    "Studio Rating" : "4.7"
  },
  "created_at" : "2021-07-12T04:34:05.07Z",
  "updated_at" : "2021-07-12T04:34:05.07Z",
  "additional_underwriting_data" : {
    "annual_ach_volume" : 200000,
    "average_ach_transfer_amount" : 200000,
    "average_card_transfer_amount" : 200000,
    "business_description" : "SB3 vegan cafe",
    "card_volume_distribution" : {
      "card_present_percentage" : 30,
      "ecommerce_percentage" : 60,
      "mail_order_telephone_order_percentage" : 10
    },
    "credit_check_allowed" : true,
    "credit_check_ip_address" : "42.1.1.113",
    "credit_check_timestamp" : "2021-04-28T16:42:55Z",
    "credit_check_user_agent" : "Mozilla 5.0(Macintosh; IntelMac OS X 10 _14_6)",
    "merchant_agreement_accepted" : true,
    "merchant_agreement_ip_address" : "42.1.1.113",
    "merchant_agreement_timestamp" : "2021-04-28T16:42:55Z",
    "merchant_agreement_user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6)",
    "refund_policy" : "MERCHANDISE_EXCHANGE_ONLY",
    "volume_distribution_by_business_type" : {
      "business_to_business_volume_percentage" : 100,
      "business_to_consumer_volume_percentage" : 0,
      "consumer_to_consumer_volume_percentage" : 0,
      "other_volume_percentage" : 0,
      "person_to_person_volume_percentage" : 0
    }
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDjdBo2JNzYe4F6Uhi6rLwr2"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDjdBo2JNzYe4F6Uhi6rLwr2/verifications"
    },
    "merchants" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDjdBo2JNzYe4F6Uhi6rLwr2/merchants"
    },
    "settlements" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDjdBo2JNzYe4F6Uhi6rLwr2/settlements"
    },
    "authorizations" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDjdBo2JNzYe4F6Uhi6rLwr2/authorizations"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDjdBo2JNzYe4F6Uhi6rLwr2/transfers"
    },
    "payment_instruments" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDjdBo2JNzYe4F6Uhi6rLwr2/payment_instruments"
    },
    "associated_identities" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDjdBo2JNzYe4F6Uhi6rLwr2/associated_identities"
    },
    "disputes" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDjdBo2JNzYe4F6Uhi6rLwr2/disputes"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    }
  }
}

Before we can begin charging cards we’ll need to provision a Merchant account for your seller. This requires 3-steps, which we’ll go into greater detail in the next few sections:

  1. First, create an Identity resource with the merchant’s underwriting and identity verification information

    POST https://flex.sandbox-payments-api.com/identities/

  2. Second, create a Payment Instrument representing the merchant’s bank account where processed funds will be settled (i.e. deposited)

    POST https://flex.sandbox-payments-api.com/payment_instruments/

  3. Finally, provision the Merchant account

    POST https://flex.sandbox-payments-api.com/identities/:IDENTITY_ID/merchants

Let’s start with the first step by creating an Identity resource. Each Identity represents either a person or a business. We use this resource to associate cards and payouts. This structure makes it simple to manage and reconcile payment instruments and payout history. Accounting of funds is done using the Identity so it’s recommended to have an Identity per recipient of funds.

You’ll want to store the ID of the newly created Identity resource for reference later.

HTTP Request

POST https://flex.sandbox-payments-api.com/identities

Business-specific Request Arguments

Field Type Description
business_name string, required Merchant’s full legal business name (If INDIVIDUAL_SOLE_PROPRIETORSHIP, please input first name, Full legal last name and middle initial; max 120 characters)
doing_business_as string, required Alternate name of the business. If no other name is used please use the same value for business_name (max 60 characters)
business_type string, required Please select one of the following values: INDIVIDUAL_SOLE_PROPRIETORSHIP, CORPORATION, LIMITED_LIABILITY_COMPANY, PARTNERSHIP, ASSOCIATION_ESTATE_TRUST, TAX_EXEMPT_ORGANIZATION, INTERNATIONAL_ORGANIZATION, GOVERNMENT_AGENCY
business_tax_id string, required Nine digit Tax Identification Number (TIN), Employer Identification Number (EIN) or if the business_type is INDIVIDUAL_SOLE_PROPRIETORSHIP and a Tax ID is not available, the principal’s Social Security Number (SSN)
url string, required Merchant’s publicly available website (max 100 characters)
business_phone string, required Customer service phone number where the merchant can be reached (max 10 characters)
incorporation_date object, required Date company was founded (See below for a full list of the child attributes)
business_address object, required Primary address for the legal entity (Full description of child attributes below)
ownership_type string, required Values can be either PUBLIC to indicate a publicly traded company or PRIVATE for privately held businesses
amex_mid integer, optional Assigned amexMid value. If provided must be 10 or 11 digits
discover_mid integer, optional Assigned discoverMid value

Principal-specific Request Arguments

(i.e. authorized representative or primary contact responsible for the account)

Field Type Description
first_name string, required Full legal first name of the merchant’s principal representative (max 20 characters)
last_name string, required Full legal last name of the merchant’s principal representative (max 20 characters)
title string, required Principal’s corporate title or role (i.e. Chief Executive Officer, CFO, etc.; max 60 characters)
principal_percentage_ownership integer, required Percentage of company owned by the principal (min 0; max 100)
tax_id string, required Nine digit Social Security Number (SSN) for the principal
dob object, required Principal’s date of birth (Full description of child attributes below)
phone string, required Principal’s phone number (max 10 characters)
email string, required Principal’s email address where they can be reached (max 100 characters)
personal_address object, required Principal’s personal home address. This field is used for identity verification purposes (Full description of child attributes below)

Processing-specific Request Arguments

Field Type Description
default_statement_descriptor string, required Billing descriptor displayed on the buyer’s bank or card statement (Length must be between 1 and 20 characters)
annual_card_volume integer, required Approximate annual credit card sales expected to be processed in cents by this merchant (max 23 characters)
max_transaction_amount integer, required Maximum amount that can be transacted for a single transaction in cents (max 12 characters)
mcc string, required Merchant Category Code (MCC) that this merchant will be classified under
has_accepted_credit_cards_previously boolean, optional Defaults to false if not passed

Address-object Request Arguments

Field Type Description
line1 string, required First line of the address (max 35 characters)
line2 string, optional Second line of the address (max 35 characters)
city string, required City (max 20 characters)
region string, required 2-letter State code
postal_code string, required Zip or Postal code (max 7 characters)
country string, required 3-Letter Country code

Incorporation Date-object Request Arguments

Field Type Description
day integer, required Day business was incorporated (between 1 and 31)
month integer, required Month business was incorporated (between 1 and 12)
year integer, required Year business was incorporated (4-digit)

DOB-object Request Arguments

Field Type Description
day integer, required Day of birth (between 1 and 31)
month integer, required Month of birth (between 1 and 12)
year integer, required Year of birth (4-digit)

Additional Underwriting Request Arguments

Field Type Description
annual _ach_volume integer, required Approximate annual ACH sales expected to be processed in cents by this merchant
average_ach_transfer_amount integer, required Approximate average ACH sale amount in cents for this merchant
average_card_transfer_amount integer, required Approximate average credit card sale amount in cents for this merchant
business_description string, required Description of this merchant’s business (max 100 characters)
card_volume_distribution object, required Merchant’s distribution of credit card volume (See below for a full list of the child attributes)
credit_check_allowed boolean, required Sets whether this merchant has consented and accepted to a credit check
credit_check_ip_address string, required IP address of the merchant when this merchant consented to a credit check (e.g., 42.1.1.113 )
credit_check_timestamp string, required Timestamp of the merchant when this merchant consented to a credit check (e.g., 2021-04-28T16:42:55Z)
credit_check_user_agent string, required The user agent of the browser when this merchant consented to a credit check (e.g., Mozilla 5.0(Macintosh; IntelMac OS X 10 _14_6))
merchant_agreeement_accepted boolean, required Sets whether this merchant has accepted the terms and conditions of the merchant agreement
merchant_agreement_ip_address string, required IP address of the merchant when this merchant accepted the merchant agreement (e.g., 42.1.1.113 )
merchant_agreement_timestamp string, required Timestamp of the merchant when this merchant consented to a credit check (e.g., 2021-04-28T16:42:55Z)
merchant_agreement_user_agent string, required The user agent of the browser when this merchant accepted the merchant agreement (e.g., Mozilla 5.0(Macintosh; IntelMac OS X 10 _14_6))
refund_policy string, required Please select one of the following values: NO_REFUNDS, MERCHANDISE_EXCHANGE_ONLY, WITHIN_30_DAYS, OTHER
volume_distribution_by_business_type object, required Merchant’s distribution of credit card volume by business type (See below for a full list of the child attributes)

Card Volume Distribution-object Request Arguments

Field Type Description
card_present_percentage integer, required Merchant’s percentage of business that is card present (between 0 and 100)
ecommerce_present_percentage integer, required Merchant’s percentage of business that is ecommerce (between 0 and 100)
mail_order_telephone_order_percentage integer, required Merchant’s percentage of business that is mail order or telephone order (between 0 and 100)

Volume Distribution by Business Type-object Request Arguments

Field Type Description
business_to_business_volume_percentage integer, required Merchant’s percentage of volume that is business to business (between 0 and 100)
business_to_consumer_volume_percentage integer, required Merchant’s percentage of volume that is business to consumer (between 0 and 100)
consumer_to_consumer_volume_percentage integer, required Merchant’s percentage of volume that is consumer to consumer (between 0 and 100)
person_to_person_volume_percentage integer, required Merchant’s percentage of volume that is person to person (between 0 and 100)
other_volume_percentage integer, required Merchant’s percentage of volume that is not represented by the previous fields (between 0 and 100)

Step 2: Tokenize a Bank Account for Funding your Merchant

curl https://flex.sandbox-payments-api.com/payment_instruments \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
    {
        "account_type": "SAVINGS",
        "name": "Alice",
        "tags": {
            "Bank Account": "Company Account"
        },
        "country": "USA",
        "bank_code": "123123123",
        "account_number": "123123123",
        "type": "BANK_ACCOUNT",
        "identity": "IDjdBo2JNzYe4F6Uhi6rLwr2"
    }'


import io.finix.payments.ApiClient;
import io.finix.payments.enums.BankAccountType;
import io.finix.payments.forms.BankAccountForm;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.views.BankAccount;
import io.finix.payments.views.Identity;
import java.util.Currency;

BankAccountForm form = BankAccountForm.builder()
        .name("Joe Doe")
        .identity("IDjdBo2JNzYe4F6Uhi6rLwr2")
        .accountNumber("84012312415")
        .bankCode("840123124")
        .accountType(BankAccountType.SAVINGS)
        .companyName("company name")
        .country("USA")
        .currency(Currency.getInstance("USD"))
        .build();

Maybe<BankAccount> request = api.instruments.post(form);

if (! request.succeeded()) {
    ApiError error = request.error();
    System.out.println(error);
    throw new RuntimeException("API error attempting to create bank account");
}
BankAccount bankAccount = request.view();

<?php
use Finix\Resources\Identity;
use Finix\Resources\BankAccount;

$identity = Identity::retrieve('IDjdBo2JNzYe4F6Uhi6rLwr2');
$bank_account = new BankAccount(
    array(
        "account_type"=> "SAVINGS",
        "name"=> "Alice",
        "tags"=> array(
            "Bank Account"=> "Company Account"
        ),
        "country"=> "USA",
        "bank_code"=> "123123123",
        "account_number"=> "123123123",
        "type"=> "BANK_ACCOUNT",
        "identity"=> "IDjdBo2JNzYe4F6Uhi6rLwr2"
    ));
$bank_account = $identity->createBankAccount($bank_account);


from finix.resources import BankAccount

bank_account = BankAccount(**
    {
        "account_type": "SAVINGS",
        "name": "Alice",
        "tags": {
            "Bank Account": "Company Account"
        },
        "country": "USA",
        "bank_code": "123123123",
        "account_number": "123123123",
        "type": "BANK_ACCOUNT",
        "identity": "IDjdBo2JNzYe4F6Uhi6rLwr2"
    }).save()

bank_account = Finix::BankAccount.new(
    {
        "account_type"=> "SAVINGS",
        "name"=> "Alice",
        "tags"=> {
            "Bank Account"=> "Company Account"
        },
        "country"=> "USA",
        "bank_code"=> "123123123",
        "account_number"=> "123123123",
        "type"=> "BANK_ACCOUNT",
        "identity"=> "IDjdBo2JNzYe4F6Uhi6rLwr2"
    }).save

Example Response:

{
  "id" : "PIqJjh3X4mo9qHEWvmjWSrho",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "fingerprint" : "FPRd5moHxL3Ltuvk4cczxetCg",
  "tags" : {
    "Bank Account" : "Company Account"
  },
  "bank_code" : "123123123",
  "country" : "USA",
  "masked_account_number" : "XXXXX3123",
  "name" : "Alice",
  "account_type" : "SAVINGS",
  "created_at" : "2021-06-19T00:49:06.83Z",
  "updated_at" : "2021-06-19T00:49:06.83Z",
  "instrument_type" : "BANK_ACCOUNT",
  "type" : "BANK_ACCOUNT",
  "currency" : "USD",
  "identity" : "IDjdBo2JNzYe4F6Uhi6rLwr2",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho"
    },
    "authorizations" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho/authorizations"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho/transfers"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho/verifications"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDjdBo2JNzYe4F6Uhi6rLwr2"
    }
  }
}

Now that we’ve created an Identity for our merchant, we’ll need to add a bank account where funds will be disbursed (i.e. their funding account).

In the API, bank accounts – as well as credit cards – are represented by the Payment Instrument resource.

To classify the Payment Instrument as a bank account you’ll need to pass BANK_ACCOUNT in the type field of your request, and you’ll also want to pass the ID of the Identity that you created in the last step via the identity field to properly associate it with your merchant.

HTTP Request

POST https://flex.sandbox-payments-api.com/payment_instruments

Request Arguments

Field Type Description
account_number string, required Bank account number
bank_code string, required Bank routing number
type string, required Type of Payment Instrument (for bank accounts use BANK_ACCOUNT)
identity string, required ID for the Identity resource which the account is associated
account_type string, required Either CHECKING or SAVINGS
name string, required Account owner’s full name (max 40 characters)

Step 3: Provision Merchant Account

curl https://flex.sandbox-payments-api.com/identities/IDjdBo2JNzYe4F6Uhi6rLwr2/merchants \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
    {
        "tags": {
            "key_2": "value_2"
        }
    }'

import io.finix.payments.processing.client.model.Merchant;

Merchant merchant = identity.provisionMerchantOn(Merchant.builder().build());

<?php
use Finix\Resources\Identity;
use Finix\Resources\Merchant;

$identity = Identity::retrieve('IDjdBo2JNzYe4F6Uhi6rLwr2');
$merchant = $identity->provisionMerchantOn(new Merchant());


from finix.resources import Identity
from finix.resources import Merchant

identity = Identity.get(id="IDjdBo2JNzYe4F6Uhi6rLwr2")
merchant = identity.provision_merchant_on(Merchant())
identity = Finix::Identity.retrieve(:id=>"IDjdBo2JNzYe4F6Uhi6rLwr2")

merchant = identity.provision_merchant

Example Response:

{
  "id" : "MUg7uTYUGBr2osoonJMECCz4",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "identity" : "IDjdBo2JNzYe4F6Uhi6rLwr2",
  "verification" : "VIb4fFJ3GNzQoYsy4Qp1qR1f",
  "merchant_profile" : "MPkY4BpDY7XX8Pj9sGD4nAMb",
  "processor" : "DUMMY_V1",
  "processing_enabled" : true,
  "settlement_enabled" : true,
  "gross_settlement_enabled" : false,
  "creating_transfer_from_report_enabled" : false,
  "card_expiration_date_required" : true,
  "card_cvv_required" : false,
  "tags" : {
    "key_2" : "value_2"
  },
  "mcc" : "0742",
  "mid" : "FNXrP15xhqWvUNeVJF4uSHj3h",
  "merchant_name" : "Pawny City Hall",
  "settlement_funding_identifier" : "UNSET",
  "ready_to_settle_upon" : "RECONCILIATION",
  "fee_ready_to_settle_upon" : "RECONCILIATION",
  "created_at" : "2021-06-19T00:49:08.24Z",
  "updated_at" : "2021-06-19T00:49:08.46Z",
  "onboarding_state" : "APPROVED",
  "processor_details" : {
    "mid" : "FNXrP15xhqWvUNeVJF4uSHj3h",
    "api_key" : "secretValue"
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4"
    },
    "identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDjdBo2JNzYe4F6Uhi6rLwr2"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4/verifications"
    },
    "merchant_profile" : {
      "href" : "https://flex.sandbox-payments-api.com/merchant_profiles/MPkY4BpDY7XX8Pj9sGD4nAMb"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "verification" : {
      "href" : "https://flex.sandbox-payments-api.com/verifications/VIb4fFJ3GNzQoYsy4Qp1qR1f"
    }
  }
}

For the sandbox environment, merchant provisioning may be performed in order to enable merchant accounts. Make one final POST request, and a Merchant resource is returned. Take a second to inspect this newly created resource, particularly the onboarding_state, which in production can have 3 potential states that indicate its ability to process and settle funds:

  1. PROVISIONING: Request is pending (state will typically change after two minutes)

    • processing_enabled: False
    • settlement_enabled: False
  2. APPROVED: Merchant has been approved and can begin processing

    • processing_enabled: True
    • settlement_enabled: True
  3. REJECTED: Merchant was rejected by the processor either because the information collected was invalid or it failed one of a number of regulatory and/or compliance checks (e.g. KYC, OFAC or MATCH)

    • processing_enabled: False
    • settlement_enabled: False

HTTP Request

POST https://flex.sandbox-payments-api.com/identities/:IDENTITY_ID/merchants

URL Parameters

Parameter Description
:IDENTITY_ID ID of the Identity

Request Arguments

Field Type Description
processor string, required Name of the processor that you’re onboarding the Merchant with (a user can pass either null or DUMMY_V1 for sandbox)

Step 4: Create an Identity for a Buyer


curl https://flex.sandbox-payments-api.com/identities \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
    {
        "tags": {
            "key": "value"
        },
        "entity": {
            "phone": "7145677613",
            "first_name": "Laura",
            "last_name": "Chang",
            "email": "therock@gmail.com",
            "personal_address": {
                "city": "San Mateo",
                "country": "USA",
                "region": "CA",
                "line2": "Apartment 7",
                "line1": "741 Douglass St",
                "postal_code": "94114"
            }
        }
    }'

import io.finix.payments.forms.*;
import io.finix.payments.views.*;
import io.finix.payments.forms.Address;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.forms.Date;


IdentityForm form = IdentityForm.builder()
    .entity(
    IdentityEntityForm.builder()
        .firstName("dwayne")
        .lastName("Sunkhronos")
        .email("user@example.org")
        .personalAddress(
            Address.builder()
                .line1("741 Douglass St")
                .line2("Apartment 7")
                .city("San Mateo")
                .region("CA")
                .postalCode("94114")
                .country("USA")
                .build()
        )
        .build())
      .build();

Maybe<Identity> response = api.identities.post(form);

if (! response.succeeded()) {
    ApiError error = response.error();
    System.out.println(error.getCode());
    throw new RuntimeException("API error attempting to create Identity");
}

Identity identity = response.view();

<?php
use Finix\Resources\Identity;

$identity = new Identity(
    array(
        "tags"=> array(
            "key"=> "value"
        ),
        "entity"=> array(
            "phone"=> "7145677613",
            "first_name"=> "Laura",
            "last_name"=> "Chang",
            "email"=> "therock@gmail.com",
            "personal_address"=> array(
                "city"=> "San Mateo",
                "country"=> "USA",
                "region"=> "CA",
                "line2"=> "Apartment 7",
                "line1"=> "741 Douglass St",
                "postal_code"=> "94114"
            )
        )
    ));
$identity = $identity->save();



from finix.resources import Identity

identity = Identity(**
    {
        "tags": {
            "key": "value"
        },
        "entity": {
            "phone": "7145677613",
            "first_name": "Laura",
            "last_name": "Chang",
            "email": "therock@gmail.com",
            "personal_address": {
                "city": "San Mateo",
                "country": "USA",
                "region": "CA",
                "line2": "Apartment 7",
                "line1": "741 Douglass St",
                "postal_code": "94114"
            }
        }
    }).save()

identity = Finix::Identity.new(
    {
        "tags"=> {
            "key"=> "value"
        },
        "entity"=> {
            "phone"=> "7145677613",
            "first_name"=> "Laura",
            "last_name"=> "Chang",
            "email"=> "therock@gmail.com",
            "personal_address"=> {
                "city"=> "San Mateo",
                "country"=> "USA",
                "region"=> "CA",
                "line2"=> "Apartment 7",
                "line1"=> "741 Douglass St",
                "postal_code"=> "94114"
            }
        }
    }).save

Example Response:

{
  "id" : "IDcPyNBigCcFETtgAwSVBa8p",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "entity" : {
    "title" : null,
    "first_name" : "Laura",
    "last_name" : "Chang",
    "email" : "therock@gmail.com",
    "business_name" : null,
    "business_type" : null,
    "doing_business_as" : null,
    "phone" : "7145677613",
    "business_phone" : null,
    "personal_address" : {
      "line1" : "741 Douglass St",
      "line2" : "Apartment 7",
      "city" : "San Mateo",
      "region" : "CA",
      "postal_code" : "94114",
      "country" : "USA"
    },
    "business_address" : null,
    "mcc" : null,
    "dob" : null,
    "max_transaction_amount" : 0,
    "amex_mid" : null,
    "discover_mid" : null,
    "url" : null,
    "annual_card_volume" : 0,
    "has_accepted_credit_cards_previously" : false,
    "incorporation_date" : null,
    "principal_percentage_ownership" : null,
    "short_business_name" : null,
    "ownership_type" : null,
    "tax_authority" : null,
    "tax_id_provided" : false,
    "business_tax_id_provided" : false,
    "default_statement_descriptor" : null
  },
  "tags" : {
    "key" : "value"
  },
  "created_at" : "2021-06-19T00:49:29.35Z",
  "updated_at" : "2021-06-19T00:49:29.35Z",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/verifications"
    },
    "merchants" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/merchants"
    },
    "settlements" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/settlements"
    },
    "authorizations" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/authorizations"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/transfers"
    },
    "payment_instruments" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/payment_instruments"
    },
    "associated_identities" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/associated_identities"
    },
    "disputes" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/disputes"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    }
  }
}

Now that we have successfully provisioned a Merchant we’ll need to create an Identity that represents your buyer. Don’t worry though you won’t need to capture the same amount of information from your buyer. So long as you don’t pass a business_type field all the fields are optional.

Typically, we suggest at least collecting the buyer’s name and email to help with accounting, reconciliation, and chargebacks.

HTTP Request

POST https://flex.sandbox-payments-api.com/identities

Request Arguments

Field Type Description
first_name string, optional First name
last_name string, optional Last name
email string, optional Email
phone string, optional Phone number
tags object, optional Key value pair for annotating custom meta data (e.g. order numbers)
personal_address object, optional Customers shipping address or billing address (Full description of child attributes below)

Address-object Request Arguments

Field Type Description
line1 string, required First line of the address (max 35 characters)
line2 string, optional Second line of the address (max 35 characters)
city string, required City (max 20 characters)
region string, required 2-letter State code
postal_code string, required Zip or Postal code (max 7 characters)
country string, required 3-Letter Country code

Step 5: Tokenize a Card



curl https://flex.sandbox-payments-api.com/payment_instruments \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
    {
        "name": "Sean Le",
        "expiration_year": 2029,
        "tags": {
            "card_name": "Business Card"
        },
        "number": "4895142232120006",
        "expiration_month": 3,
        "address": {
            "city": "San Francisco",
            "region": "CA",
            "postal_code": "94404",
            "line1": "900 Metro Center Blv",
            "country": "USA"
        },
        "security_code": "022",
        "type": "PAYMENT_CARD",
        "identity": "IDcPyNBigCcFETtgAwSVBa8p"
    }'


import io.finix.payments.forms.*;
import io.finix.payments.views.*;
import io.finix.payments.forms.Address;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import com.google.common.collect.ImmutableMap;

PaymentCardForm form = PaymentCardForm.builder()
        .name("Joe Doe")
        .number("4957030420210454")
        .securityCode("112")
        .expirationYear(2020)
        .identity("ID9Kou1FsvdJFYEjypVGHee9")
        .expirationMonth(12)
        .address(
                Address.builder()
                        .city("San Mateo")
                        .country("USA")
                        .region("CA")
                        .line1("123 Fake St")
                        .line2("#7")
                        .postalCode("90210")
                        .build()
        )
        .tags(ImmutableMap.of("card_name", "Business Card"))
        .build();

Maybe<PaymentCard> response = api.instruments.post(form);
        if (! response.succeeded()) {
            ApiError error = response .error();
            System.out.println(error.getCode());
            throw new RuntimeException("API error attempting to create Payment Card");
        }
PaymentCard card = response.view();

<?php
use Finix\Resources\PaymentCard;
use Finix\Resources\Identity;

$identity = Identity::retrieve('ID9Kou1FsvdJFYEjypVGHee9');
$card = new PaymentCard(
    array(
        "name"=> "Sean Le",
        "expiration_year"=> 2029,
        "tags"=> array(
            "card_name"=> "Business Card"
        ),
        "number"=> "4895142232120006",
        "expiration_month"=> 3,
        "address"=> array(
            "city"=> "San Francisco",
            "region"=> "CA",
            "postal_code"=> "94404",
            "line1"=> "900 Metro Center Blv",
            "country"=> "USA"
        ),
        "security_code"=> "022",
        "type"=> "PAYMENT_CARD",
        "identity"=> "IDcPyNBigCcFETtgAwSVBa8p"
    ));
$card = $identity->createPaymentCard($card);



from finix.resources import PaymentCard

card = PaymentCard(**
    {
        "name": "Sean Le",
        "expiration_year": 2029,
        "tags": {
            "card_name": "Business Card"
        },
        "number": "4895142232120006",
        "expiration_month": 3,
        "address": {
            "city": "San Francisco",
            "region": "CA",
            "postal_code": "94404",
            "line1": "900 Metro Center Blv",
            "country": "USA"
        },
        "security_code": "022",
        "type": "PAYMENT_CARD",
        "identity": "IDcPyNBigCcFETtgAwSVBa8p"
    }).save()
card = Finix::PaymentCard.new(
    {
        "name"=> "Sean Le",
        "expiration_year"=> 2029,
        "tags"=> {
            "card_name"=> "Business Card"
        },
        "number"=> "4895142232120006",
        "expiration_month"=> 3,
        "address"=> {
            "city"=> "San Francisco",
            "region"=> "CA",
            "postal_code"=> "94404",
            "line1"=> "900 Metro Center Blv",
            "country"=> "USA"
        },
        "security_code"=> "022",
        "type"=> "PAYMENT_CARD",
        "identity"=> "IDcPyNBigCcFETtgAwSVBa8p"
    }).save

Example Response:

{
  "id" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "fingerprint" : "FPRogKWsRQks2HGaau5eGR9AF",
  "tags" : {
    "card_name" : "Business Card"
  },
  "expiration_month" : 3,
  "expiration_year" : 2029,
  "bin" : "489514",
  "last_four" : "0006",
  "brand" : "VISA",
  "card_type" : "UNKNOWN",
  "name" : "Sean Le",
  "address" : {
    "line1" : "900 Metro Center Blv",
    "line2" : null,
    "city" : "San Francisco",
    "region" : "CA",
    "postal_code" : "94404",
    "country" : "USA"
  },
  "address_verification" : "UNKNOWN",
  "security_code_verification" : "UNKNOWN",
  "created_at" : "2021-06-19T00:49:29.94Z",
  "updated_at" : "2021-06-19T00:49:29.94Z",
  "instrument_type" : "PAYMENT_CARD",
  "type" : "PAYMENT_CARD",
  "currency" : "USD",
  "identity" : "IDcPyNBigCcFETtgAwSVBa8p",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2"
    },
    "authorizations" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2/authorizations"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2/transfers"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2/verifications"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p"
    },
    "updates" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2/updates"
    }
  }
}

Now that we have an Identity resource representing our buyer, we’ll need to create a Payment Instrument which represents the credit card you’ll be debiting (i.e. charging).

You’ll also need to interpolate your own buyer’s Identity ID from the previous request to properly associate it.

Please review our guide on how to tokenize cards via the embedded tokenization form

HTTP Request

POST https://flex.sandbox-payments-api.com/payment_instruments

Request Arguments

Field Type Description
identity string, required ID of the Identity that the card should be associated
type string, required Type of Payment Instrument (for cards input PAYMENT_CARD)
number string, required Credit card account number
security_code string, optional The 3-4 digit security code for the card (i.e. CVV code)
expiration_month integer, required Expiration month (e.g. 12 for December)
expiration_year integer, required 4-digit expiration year
name string, optional Full name of the registered card holder
address object, optional Billing address (Full description of child attributes below)

Address-object Request Arguments

Field Type Description
line1 string, required First line of the address (max 35 characters)
line2 string, optional Second line of the address (max 35 characters)
city string, required City (max 20 characters)
region string, required 2-letter State code
postal_code string, required Zip or Postal code (max 7 characters)
country string, required 3-Letter Country code

Step 6: Create Sale

curl https://flex.sandbox-payments-api.com/transfers \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
    {
        "merchant": "MU8Ftnfas6dhJobLwGC7e8mp",
        "currency": "USD",
        "amount": 100,
        "source": "PI2Wu2tWFH3NnvVwHiVPPkw2",
        "tags": {
            "test": "sale"
        }
    }'

import io.finix.payments.forms.*;
import io.finix.payments.views.*;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import com.google.common.collect.ImmutableMap;
import java.util.Currency;

TransferForm form = TransferForm.builder()
        .amount(100L)
        .currency(Currency.getInstance("USD"))
        .source("PI2Wu2tWFH3NnvVwHiVPPkw2")
        .merchantIdentity("ID9Kou1FsvdJFYEjypVGHee9")
        .tags(ImmutableMap.of("order_number", "21DFASJSAKAS"))
        .build();

Maybe<Transfer> response = api.transfers.post(form);
if (! response.succeeded()) {
    ApiError error = response.error();
    System.out.println(error.getCode());
    throw new RuntimeException("API error attempting to debit Bank Account");
}
Transfer transfer = response.view();

<?php
use Finix\Resources\Transfer;

$debit = new Transfer(
    array(
        "merchant"=> "MU8Ftnfas6dhJobLwGC7e8mp",
        "currency"=> "USD",
        "amount"=> 100,
        "source"=> "PI2Wu2tWFH3NnvVwHiVPPkw2",
        "tags"=> array(
            "test"=> "sale"
        )
    ));
$debit = $debit->save();



from finix.resources import Transfer

payout = Transfer(**
    {
        "merchant": "MU8Ftnfas6dhJobLwGC7e8mp",
        "currency": "USD",
        "amount": 100,
        "source": "PI2Wu2tWFH3NnvVwHiVPPkw2",
        "tags": {
            "test": "sale"
        }
    }).save()

Finix::Transfer.new(
    array(
        "merchant"=> "MU8Ftnfas6dhJobLwGC7e8mp",
        "currency"=> "USD",
        "amount"=> 100,
        "source"=> "PI2Wu2tWFH3NnvVwHiVPPkw2",
        "tags"=> array(
            "test"=> "sale"
        )
    )).save

Example Response:

{
  "id" : "TR81WeVDoJYhdVRRhRYYjadL",
  "amount" : 100,
  "tags" : {
    "test" : "sale"
  },
  "state" : "PENDING",
  "trace_id" : "6825f422-286c-43ab-9aa1-861719557b6c",
  "currency" : "USD",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "source" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
  "destination" : null,
  "ready_to_settle_at" : null,
  "fee" : 0,
  "statement_descriptor" : "FIN*PETES COFFEE",
  "type" : "DEBIT",
  "messages" : [ ],
  "raw" : null,
  "created_at" : "2021-06-19T00:49:37.17Z",
  "updated_at" : "2021-06-19T00:49:18.03Z",
  "idempotency_id" : null,
  "merchant_identity" : "IDi32Qn43FtNMRNkS7mLwsoq",
  "subtype" : "API",
  "_links" : {
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL"
    },
    "merchant_identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq"
    },
    "payment_instruments" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL/payment_instruments"
    },
    "reversals" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL/reversals"
    },
    "fees" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL/fees"
    },
    "disputes" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL/disputes"
    },
    "source" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2"
    },
    "fee_profile" : {
      "href" : "https://flex.sandbox-payments-api.com/fee_profiles/FPrATYzpomaTRtdo2BssRoGx"
    }
  }
}

At this point we’ve created resources representing the merchant, the buyer, and the buyer’s card.

Next you’ll need to create a Transfer. To generate a Transfer we’ll supply the buyer’s Payment Instrument ID as the source field and the seller’s Merchant ID in the merchant field. Note that the amount field is in cents. These specific Transfers are distinguished by their type which return DEBIT.

Alternatively, a user can create an Authorization and then proceed to capture the Authorization in two API calls. This is useful when you’re looking to capture a specific amount on a card at a later date. You can find more information on Authorization’s flow.

Learn how to prevent duplicate transfers by passing an idempotency ID in the payload.

HTTP Request

POST https://flex.sandbox-payments-api.com/transfers

Request Arguments

Field Type Description
source string, required ID of the Payment Instrument that will be debited
merchant string, required Merchant ID of the merchant whom you’re charging on behalf of
amount integer, required The total amount that will be debited in cents (e.g. 100 cents to debit $1.00)
fee integer, optional The amount of the Transfer you would like to collect as your fee in cents. Defaults to zero (Must be less than or equal to the amount)
currency string, required 3-letter ISO code designating the currency of the Transfers (e.g. USD)processor
idempotency_id string, optional A randomly generated value that you want associated with the request
tags object, optional Key value pair for annotating custom meta data (e.g. order numbers)

Tokenization with Hosted Fields

Library summary

The PaymentForm library is a javascript library that allows you secure your sensitive credit and debit card data. By having the end-user input their data into an iFrame, it prevents third-parties from accessing the information.

Once the fields are initialized the library communicates the state of the fields through a JavaScript callback. The state object includes information about the validity, focused value and if the user has entered information in the field.

For a complete example of how to use the library please refer to this jsFiddle example.

Step 1: Include library and desired HTML elements

 <script type="text/javascript" src="https://forms.finixpymnts.com/finix.js"></script>

First we’ll need to include the library on the webpage where you’re hosting your form. Please include the script as demonstrated to the right.

Step 2: Initialize the payment form

window.PaymentForm.card(function(state, binInformation)-> PaymentForm



const paymentForm = window.PaymentForm.card(function(state, binInformation){
     // Logic for interacting with form's potential states (see jsFiddle for  example)
});

The next step is to configure the library. This “card” method is the single entry point into the library. It initializes and returns a PaymentForm object that contains fields(i.e. name, number, expiration date, & CVV).

Step 3: Define input fields and configure styling

Now that we have a PaymentForm object we’ll want to style it

DefineField Arguments

Field Type Description
elementId string, required Name of HTML id
type string, required API attribute name that will be sent in the payload
placeholder string, required What the user will see in the input field
function defineField(elementId, type, placeholder) {
  // call field method with desired css styling
  const f = form.field(type, {
    placeholder,
    styles: {
      default: {
        color: "black",
      },
      success: {
        color: '#5cb85c',
      },
      error: {
        color: '#d9534f',
      },
    }
  });
  // appends each field wrapper (that contains placeholder and styles) to the appropriate div
  document.getElementById(elementId).appendChild(f);
}

defineField("field-wrapper-number", "number", '4111 1111 1111 1111');
defineField("field-wrapper-name", "name", 'Bo Jackson');
defineField("field-wrapper-expiration_date", "expiration_date", '02/2020');
defineField("field-wrapper-security_code", "security_code", '411');

Step 4: Submit payload and handle response

Form#submit(environment, applicationID, callback)-> Form


/*
Form#submit(environment, applicationID, callback)-> Form
*/

function submitForm() {
  // sandbox or production for environment
  form.submit('sandbox', APxje5CBpRs3URkAdoq8AiYe, function(err, res) {
    if (err) {
      console.log("There was an error");
    }
    // shows id of tokenized payment card
    document.getElementById('preview').innerHTML = JSON.stringify(res, null, '  ');
  })
}

document.getElementById('button').addEventListener('click', function (e){
  e.preventDefault();
  submitForm();
})

// if user types "enter" instead of clicking submit button
form.onSubmit(submitForm);

Example Response:

{
  "status": 201,
  "statusText": "Created",
  "data": {
    "id": "TKiu6N8r5wN38J1xXdeNjzZY",
    "fingerprint": "FPR-2083311660",
    "created_at": "2017-08-29T06:25:54.29Z",
    "updated_at": "2017-08-29T06:25:54.29Z",
    "instrument_type": "PAYMENT_CARD",
    "expires_at": "2017-08-30T06:25:54.29Z",
    "currency": "USD"
  }
}
{
  "cardBrand": "visa",
  "bin": "411111"
}

Finally we will need to register a click event that fires when our users submit the form and define a callback for handling the response.

Next, configure the library to your specific Application where all of the form fields will be submitted during the executed POST request. We’ll also want to register a click event that fires when our users submit the form and define a callback for handling the response.

Once you’ve handled the response you will want to store that ID to utilize the token in the future. To do this you will need to send the ID from your front-end client to your back-end server.

Arguments

Field Type Description
environment string, required sandbox for testing and live for live
applicationId string, required Application id that the payment card will be scoped to
callback function, required Callback that will be executed when the HTTPRequest is finished.

Step 5: Associate to an Identity

curl https://flex.sandbox-payments-api.com/payment_instruments \
    -H "Content-Type: application/vnd.json+api" \
    -u  US5HxjWXaMVY8SUZU9CtDshg:804223b8-212c-4475-85eb-3af7dfaa3540 \
    -d '
    {
        "token": "TK3Wr9zRent6zME2PUrgDcHB",
        "type": "TOKEN",
        "identity": "ID9Kou1FsvdJFYEjypVGHee9"
    }'

import io.finix.payments.forms.*;
import io.finix.payments.views.*;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;

TokenAssociationForm tokenForm =  TokenAssociationForm.builder()
    .token("TK3Wr9zRent6zME2PUrgDcHB")
    .identity("ID9Kou1FsvdJFYEjypVGHee9")
    .build();

Maybe<PaymentCard> cardResponse = api.instruments.post(tokenForm);
if (! cardResponse.succeeded()) {
    ApiError error = cardResponse.error();
    System.out.println(error.getCode());
    throw new RuntimeException("API error attempting to create Payment Card");
}
PaymentCard paymentCard = cardResponse.view();

<?php
use Finix\Resources\PaymentInstrument;

$card = new PaymentInstrument(
    array(
        "token"=> "TK3Wr9zRent6zME2PUrgDcHB",
        "type"=> "TOKEN",
        "identity"=> "ID9Kou1FsvdJFYEjypVGHee9"
    ));
$card = $card->save();



from finix.resources import PaymentInstrument

payment_instrument = PaymentInstrument(**
    {
        "token": "TK3Wr9zRent6zME2PUrgDcHB",
        "type": "TOKEN",
        "identity": "ID9Kou1FsvdJFYEjypVGHee9"
    }).save()

card = Finix::PaymentInstrument.new(
    {
        "token"=> "TK3Wr9zRent6zME2PUrgDcHB",
        "type"=> "TOKEN",
        "identity"=> "ID9Kou1FsvdJFYEjypVGHee9"
    }).save

Example Response:

{
  "id" : "PIsWLg3t26jv6tTuTr3AxJWo",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "fingerprint" : "FPRw9NoorETQgCjFgwKPvcGsV",
  "tags" : { },
  "expiration_month" : 12,
  "expiration_year" : 2029,
  "bin" : "495703",
  "last_four" : "0454",
  "brand" : "VISA",
  "card_type" : "UNKNOWN",
  "name" : null,
  "address" : {
    "line1" : "741 Douglass St",
    "line2" : "Apartment 7",
    "city" : "San Mateo",
    "region" : "CA",
    "postal_code" : "94114",
    "country" : "USA"
  },
  "address_verification" : "UNKNOWN",
  "security_code_verification" : "UNKNOWN",
  "created_at" : "2021-06-19T00:49:46.07Z",
  "updated_at" : "2021-06-19T00:49:46.07Z",
  "instrument_type" : "PAYMENT_CARD",
  "type" : "PAYMENT_CARD",
  "currency" : "USD",
  "identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo"
    },
    "authorizations" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo/authorizations"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo/transfers"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo/verifications"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    },
    "updates" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo/updates"
    }
  }
}

Before you can use the newly tokenized card or bank account you will need to associate it with an Identity. To do this you must make an authenticated POST request to the /payment_instruments endpoint with the relevant token and Identity information.

HTTP Request

POST https://flex.sandbox-payments-api.com/payment_instruments

Request Arguments

Field Type Description
token string, required ID for the Token that was returned via the tokenization client
type string, required Must pass TOKEN as the value
identity string, required ID for the Identity resource which the account is to be associated

Authorizations

An Authorization (also known as a card hold) reserves a specific amount on a card to be captured (i.e. debited) at a later date, usually within 7 days. When an Authorization is captured it produces a Transfer resource.

Create an Authorization

curl https://flex.sandbox-payments-api.com/authorizations \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
    {
        "source": "PI2Wu2tWFH3NnvVwHiVPPkw2",
        "merchant_identity": "ID9Kou1FsvdJFYEjypVGHee9",
        "tags": {
            "order_number": "21DFASJSAKAS"
        },
        "currency": "USD",
        "amount": 100,
        "processor": "DUMMY_V1"
    }'

import io.finix.payments.ApiClient;
import io.finix.payments.forms.*;
import io.finix.payments.views.*;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;

AuthorizationCreateForm formCreateAuthorization = AuthorizationCreateForm.builder()
                .amount(10000L)
                .merchantIdentity("ID9Kou1FsvdJFYEjypVGHee9")
                .source("PI2Wu2tWFH3NnvVwHiVPPkw2")
                .build();

Maybe<Authorization> response = api.authorizations.post(formCreateAuthorization);

if (! response.succeeded()) {
  ApiError error = response.error();
  System.out.println(error.getMessage());
  throw new RuntimeException("API error attempting to creating Authorization");
}

Authorization authorization = response.view();

<?php
use Finix\Resources\Authorization;

$authorization = new Authorization(
    array(
        "source"=> "PI2Wu2tWFH3NnvVwHiVPPkw2",
        "merchant_identity"=> "ID9Kou1FsvdJFYEjypVGHee9",
        "tags"=> array(
            "order_number"=> "21DFASJSAKAS"
        ),
        "currency"=> "USD",
        "amount"=> 100,
        "processor"=> "DUMMY_V1"
    ));
$authorization = $authorization->save();




from finix.resources import Authorization

authorization = Authorization(**
    {
        "source": "PI2Wu2tWFH3NnvVwHiVPPkw2",
        "merchant_identity": "ID9Kou1FsvdJFYEjypVGHee9",
        "tags": {
            "order_number": "21DFASJSAKAS"
        },
        "currency": "USD",
        "amount": 100,
        "processor": "DUMMY_V1"
    }).save()
authorization = Finix::Authorization.new(
    {
        "source"=> "PI2Wu2tWFH3NnvVwHiVPPkw2",
        "merchant_identity"=> "ID9Kou1FsvdJFYEjypVGHee9",
        "tags"=> {
            "order_number"=> "21DFASJSAKAS"
        },
        "currency"=> "USD",
        "amount"=> 100,
        "processor"=> "DUMMY_V1"
    }).save

Example Response:

{
  "id" : "AUaGwoi6LeNSttjXrEgPtVCn",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "amount" : 100,
  "tags" : {
    "order_number" : "21DFASJSAKAS"
  },
  "state" : "SUCCEEDED",
  "currency" : "USD",
  "transfer" : null,
  "messages" : [ ],
  "raw" : null,
  "created_at" : "2021-06-19T00:49:42.84Z",
  "updated_at" : "2021-06-19T00:49:42.96Z",
  "trace_id" : "81dd7223-234f-4393-a2ae-73659a7d8268",
  "source" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
  "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "3ds_redirect_url" : null,
  "is_void" : false,
  "void_state" : "UNATTEMPTED",
  "expires_at" : "2021-06-26T00:49:42.84Z",
  "idempotency_id" : null,
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/authorizations/AUaGwoi6LeNSttjXrEgPtVCn"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "merchant_identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    }
  }
}

Authorizations have two possible states SUCCEEDED and FAILED. If the Authorization has succeeded, it must be captured before the expires_at or the funds will be released.

Learn how to prevent duplicate authorizations by passing an idempotency ID in the payload.

HTTP Request

POST https://flex.sandbox-payments-api.com/authorizations

Request Arguments

Field Type Description
source string, required The Payment Instrument that you will be performing the authorization
merchant_identity string, required The ID of the Identity for the merchant that you are transacting on behalf of
amount integer, required The amount of the authorization in cents
currency string, required 3-letter ISO code designating the currency (e.g. USD)
processor string, optional If the Application has more than one processor association, it’s required to pass the processor (e.g. DUMMY_V1)
tags object, optional Key value pair for annotating custom meta data (e.g. order numbers)
idempotency_id string, optional A randomly generated value that you want associated with the request

Capture an Authorization

curl https://flex.sandbox-payments-api.com/authorizations/AUaGwoi6LeNSttjXrEgPtVCn \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -X PUT \
    -d '
    {
        "fee": "10",
        "capture_amount": 100
    }'

import io.finix.payments.ApiClient;
import io.finix.payments.forms.*;
import io.finix.payments.views.*;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;

AuthorizationUpdateForm form = AuthorizationUpdateForm.builder()
        .captureAmount(100L)
        .fee(10L)
        .statementDescriptor("Order 123")
        .build();

Maybe<Authorization> responseAuthorization = api.authorizations.id("AUaGwoi6LeNSttjXrEgPtVCn").put(form);

if (! responseAuthorization.succeeded()) {
    ApiError error = responseAuthorization.error();
    System.out.println(error.getMessage());
    throw new RuntimeException("API error attempting to capture authorization");
}
Authorization capturedAuth = responseAuthorization.view();

<?php
use Finix\Resources\Authorization;

$authorization = Authorization::retrieve('AUaGwoi6LeNSttjXrEgPtVCn');
$authorization = $authorization->capture([
                    "capture_amount"=> 50,
                    "fee"=> 10
                ]);



from finix.resources import Authorization

authorization = Authorization.get(id="AUaGwoi6LeNSttjXrEgPtVCn")
authorization.capture(**
    {
        "fee": "10",
        "capture_amount": 100
    })

authorization = Finix::Authorization.retrieve(:id=>"AUaGwoi6LeNSttjXrEgPtVCn")
authorization = authorization.capture(
    {
        "fee"=> "10",
        "capture_amount"=> 100
    })



Example Response:

{
  "id" : "AUaGwoi6LeNSttjXrEgPtVCn",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "amount" : 100,
  "tags" : {
    "order_number" : "21DFASJSAKAS"
  },
  "state" : "SUCCEEDED",
  "currency" : "USD",
  "transfer" : "TRcNdmVkoVntXsFsvmzPsUnS",
  "messages" : [ ],
  "raw" : null,
  "created_at" : "2021-06-19T00:49:42.84Z",
  "updated_at" : "2021-06-19T00:49:44.44Z",
  "trace_id" : "81dd7223-234f-4393-a2ae-73659a7d8268",
  "source" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
  "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "3ds_redirect_url" : null,
  "is_void" : false,
  "void_state" : "UNATTEMPTED",
  "expires_at" : "2021-06-26T00:49:42.84Z",
  "idempotency_id" : null,
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/authorizations/AUaGwoi6LeNSttjXrEgPtVCn"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "transfer" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TRcNdmVkoVntXsFsvmzPsUnS"
    },
    "merchant_identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    }
  }
}

Once successfully captured the transfer field of the Authorization will contain the ID for the corresponding Transfer resource. By default, Transfers will be in a PENDING state. PENDING means that the system hasn’t submitted the capture request as they are submitted via batch request. Once submited the state of the Transfer will update to SUCCEEDED.

HTTP Request

PUT https://flex.sandbox-payments-api.com/authorizations/:AUTHORIZATION_ID

URL Parameters

Parameter Description
:AUTHORIZATION_ID ID of the Authorization

Request Arguments

Field Type Description
capture_amount integer, required The amount of the Authorization you would like to capture in cents. Must be less than or equal to the amount of the Authorization
fee integer, optional Amount of the captured Authorization you would like to collect as your fee. Must be less than or equal to the amount

Void an Authorization


curl https://flex.sandbox-payments-api.com/authorizations/AUsCbFqC9cT1Wg4H6q4FMa6t \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -X PUT \
    -d '
    {
        "void_me": true
    }'

import io.finix.payments.ApiClient;
import io.finix.payments.forms.AuthorizationUpdateForm;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.views.*;

AuthorizationUpdateForm formVoid = AuthorizationUpdateForm.builder()
        .voidMe(true)
        .build();

Maybe<Authorization> response = api.authorizations.id("AUaGwoi6LeNSttjXrEgPtVCn").put(formVoid);

if (! response.succeeded()) {
    System.out.println(response.error());
    throw new RuntimeException("API error attempting to void authorization");
}
Authorization voidAuthorization = response.view();

<?php
use Finix\Resources\Authorization;

$authorization = Authorization::retrieve('AUaGwoi6LeNSttjXrEgPtVCn');
$authorization->void(true);
$authorization = $authorization->save();




from finix.resources import Authorization

authorization = Authorization.get(id="AUaGwoi6LeNSttjXrEgPtVCn")
authorization.void()

authorization = Finix::Authorization.retrieve(:id=>"AUaGwoi6LeNSttjXrEgPtVCn")
authorization = authorization.void

Example Response:

{
  "id" : "AUsCbFqC9cT1Wg4H6q4FMa6t",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "amount" : 100,
  "tags" : {
    "order_number" : "21DFASJSAKAS"
  },
  "state" : "SUCCEEDED",
  "currency" : "USD",
  "transfer" : null,
  "messages" : [ ],
  "raw" : null,
  "created_at" : "2021-06-19T00:49:46.73Z",
  "updated_at" : "2021-06-19T00:49:27.95Z",
  "trace_id" : "1479e5f9-a93e-4fc3-87bb-dc0108c1123e",
  "source" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
  "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "3ds_redirect_url" : null,
  "is_void" : true,
  "void_state" : "PENDING",
  "expires_at" : "2021-06-26T00:49:46.73Z",
  "idempotency_id" : null,
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/authorizations/AUsCbFqC9cT1Wg4H6q4FMa6t"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "merchant_identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    }
  }
}

Cancels the Authorization thereby releasing the funds. After voiding an Authorization it can no longer be captured.

HTTP Request

PUT https://flex.sandbox-payments-api.com/authorizations/:AUTHORIZATION_ID

URL Parameters

Parameter Description
:AUTHORIZATION_ID ID of the Authorization

Request Arguments

Field Type Description
void_me boolean, required Set to True to void the Authorization

Fetch an Authorization


curl https://flex.sandbox-payments-api.com/authorizations/AUaGwoi6LeNSttjXrEgPtVCn \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7

import io.finix.ApiClient;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.views.Authorization;

Maybe <Authorization> response =  api.authorizations
    .id("AUaGwoi6LeNSttjXrEgPtVCn")
    .get();

if(! response.succeeded()){
    System.out.println(response.error());
    throw new RuntimeException("API error in attempting to fetch Authorization");
}

Authorization authorization = response.view();

<?php
use Finix\Resources\Authorization;

$authorization = Authorization::retrieve('AUaGwoi6LeNSttjXrEgPtVCn');



from finix.resources import Authorization

authorization = Authorization.get(id="AUaGwoi6LeNSttjXrEgPtVCn")
authorization = Finix::Authorization.retrieve(:id=>"AUaGwoi6LeNSttjXrEgPtVCn")


Example Response:

{
  "id" : "AUaGwoi6LeNSttjXrEgPtVCn",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "amount" : 100,
  "tags" : {
    "order_number" : "21DFASJSAKAS"
  },
  "state" : "SUCCEEDED",
  "currency" : "USD",
  "transfer" : "TRcNdmVkoVntXsFsvmzPsUnS",
  "messages" : [ ],
  "raw" : null,
  "created_at" : "2021-06-19T00:49:42.84Z",
  "updated_at" : "2021-06-19T00:49:44.44Z",
  "trace_id" : "81dd7223-234f-4393-a2ae-73659a7d8268",
  "source" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
  "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "3ds_redirect_url" : null,
  "is_void" : false,
  "void_state" : "UNATTEMPTED",
  "expires_at" : "2021-06-26T00:49:42.84Z",
  "idempotency_id" : null,
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/authorizations/AUaGwoi6LeNSttjXrEgPtVCn"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "transfer" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TRcNdmVkoVntXsFsvmzPsUnS"
    },
    "merchant_identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    }
  }
}

HTTP Request

GET https://flex.sandbox-payments-api.com/authorizations/:AUTHORIZATION_ID

URL Parameters

Parameter Description
:AUTHORIZATION_ID ID of the Authorization

List all Authorizations

curl https://flex.sandbox-payments-api.com/authorizations/ \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7

import io.finix.payments.ApiClient;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.lib.Page;
import io.finix.payments.views.*;

Maybe<Page<Authorization>> response = api.authorizations.get();

if (! response.succeeded()) {
   ApiError error = response.error();
   System.out.println(error.getCode());
   System.out.println(error.getMessage());
   System.out.println(error.getDetails());
   throw new RuntimeException("API error attempting to list all Authorizations");
}

 Page<Authorization> page = response.view();
 Page<Authorization> page2 = page.getNext();

<?php
use Finix\Resources\Authorization;

$authorizations = Authorization::getPagination("/authorizations");




from finix.resources import Authorization

authorization = Authorization.get()
authorizations = Finix::Authorization.retrieve

Example Response:

{
  "_embedded" : {
    "authorizations" : [ {
      "id" : "AUsCbFqC9cT1Wg4H6q4FMa6t",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "amount" : 100,
      "tags" : {
        "order_number" : "21DFASJSAKAS"
      },
      "state" : "SUCCEEDED",
      "currency" : "USD",
      "transfer" : null,
      "messages" : [ ],
      "raw" : null,
      "created_at" : "2021-06-19T00:49:46.73Z",
      "updated_at" : "2021-06-19T00:49:27.95Z",
      "trace_id" : "1479e5f9-a93e-4fc3-87bb-dc0108c1123e",
      "source" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
      "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
      "3ds_redirect_url" : null,
      "is_void" : true,
      "void_state" : "PENDING",
      "expires_at" : "2021-06-26T00:49:46.73Z",
      "idempotency_id" : null,
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/authorizations/AUsCbFqC9cT1Wg4H6q4FMa6t"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "merchant_identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
        }
      }
    }, {
      "id" : "AUhoNLWW1uqsagUvnHjtC22F",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "amount" : 100,
      "tags" : {
        "order_number" : "21DFASJSAKAS"
      },
      "state" : "SUCCEEDED",
      "currency" : "USD",
      "transfer" : null,
      "messages" : [ ],
      "raw" : null,
      "created_at" : "2021-06-19T00:49:43.68Z",
      "updated_at" : "2021-06-19T00:49:43.78Z",
      "trace_id" : "75d3acd5-2420-4ee6-9624-9e76546be8d8",
      "source" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
      "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
      "3ds_redirect_url" : null,
      "is_void" : false,
      "void_state" : "UNATTEMPTED",
      "expires_at" : "2021-06-26T00:49:43.68Z",
      "idempotency_id" : "21ff7b1946bc4e618b598d5665592af3",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/authorizations/AUhoNLWW1uqsagUvnHjtC22F"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "merchant_identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
        }
      }
    }, {
      "id" : "AUaGwoi6LeNSttjXrEgPtVCn",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "amount" : 100,
      "tags" : {
        "order_number" : "21DFASJSAKAS"
      },
      "state" : "SUCCEEDED",
      "currency" : "USD",
      "transfer" : "TRcNdmVkoVntXsFsvmzPsUnS",
      "messages" : [ ],
      "raw" : null,
      "created_at" : "2021-06-19T00:49:42.84Z",
      "updated_at" : "2021-06-19T00:49:44.44Z",
      "trace_id" : "81dd7223-234f-4393-a2ae-73659a7d8268",
      "source" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
      "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
      "3ds_redirect_url" : null,
      "is_void" : false,
      "void_state" : "UNATTEMPTED",
      "expires_at" : "2021-06-26T00:49:42.84Z",
      "idempotency_id" : null,
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/authorizations/AUaGwoi6LeNSttjXrEgPtVCn"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "transfer" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRcNdmVkoVntXsFsvmzPsUnS"
        },
        "merchant_identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/authorizations?offset=0&limit=20&sort=created_at,desc&sort=id,desc"
    }
  },
  "page" : {
    "offset" : 0,
    "limit" : 20,
    "count" : 3
  }
}

HTTP Request

GET https://flex.sandbox-payments-api.com/authorizations/

Disputes

Disputes, also known as chargebacks, represent any customer-disputed charge. The respond_by field gets set by the upstream Processor and is the date that the Merchant needs to submit evidence thats supports their claim.

Upload Dispute Evidence

curl https://flex.sandbox-payments-api.com/disputes/DIooiHahLHAHbyNsBJ7PKghy/evidence \
    -H "Content-Type: application/pdf/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -F 'data=@path/to/local/file' testfile.pdf


<?php





Example Response:


    {
        "tags": {
            "content-type": "application/pdf",
            "file-extension": ".pdf",
            "file-name": "testfile.pdf"
        },
        "created_at": "2021-06-19T01:29:51.75Z",
        "updated_at": "2021-06-19T01:29:51.75Z",
        "state": "PENDING",
        "_links": {
            "self": {
                "href": "https://flex.sandbox-payments-api.com/disputes/DIooiHahLHAHbyNsBJ7PKghy/evidence/DFgSZGGq3EFghLjksEokF4wL"
            }
        },
        "id": "DFgSZGGq3EFghLjksEokF4wL",
        "dispute": "DIooiHahLHAHbyNsBJ7PKghy"
    }

HTTP Request

POST https://flex.sandbox-payments-api.com/disputes/:DISPUTE_ID/evidence

Fetch a Dispute


curl https://flex.sandbox-payments-api.com/disputes/DIooiHahLHAHbyNsBJ7PKghy \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7



import io.finix.payments.processing.client.model.Dispute;

Dispute dispute = transfer.disputeClient().fetch("DIooiHahLHAHbyNsBJ7PKghy");

<?php
use Finix\Resources\Dispute;

$dispute = Dispute::retrieve('DIooiHahLHAHbyNsBJ7PKghy');



from finix.resources import Dispute
dispute = Dispute.get(id="DIooiHahLHAHbyNsBJ7PKghy")

disputes = Finix::Dispute.retrieve

Example Response:

{
  "id" : "DIooiHahLHAHbyNsBJ7PKghy",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "tags" : {
    "order_number" : "21DFASJSAKAS"
  },
  "amount" : 888888,
  "state" : "PENDING",
  "transfer" : "TRakiD6xZjj52y7g5rNP1DVX",
  "reason" : "FRAUD",
  "message" : null,
  "action" : null,
  "identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "created_at" : "2021-06-19T00:51:02.76Z",
  "updated_at" : "2021-06-19T00:51:02.53Z",
  "occurred_at" : "2021-06-19T00:50:08.65Z",
  "respond_by" : "2021-06-26T00:51:02.75Z",
  "dispute_details" : {
    "arn" : "123"
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/disputes/DIooiHahLHAHbyNsBJ7PKghy"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "transfer" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TRakiD6xZjj52y7g5rNP1DVX"
    },
    "evidence" : {
      "href" : "https://flex.sandbox-payments-api.com/disputes/DIooiHahLHAHbyNsBJ7PKghy/evidence"
    },
    "adjustment_transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/disputes/DIooiHahLHAHbyNsBJ7PKghy/adjustment_transfers"
    }
  }
}

HTTP Request

GET https://flex.sandbox-payments-api.com/disputes/:DISPUTE_ID

URL Parameters

Parameter Description
:DISPUTE_ID ID of the Dispute

List all Disputes

curl https://flex.sandbox-payments-api.com/disputes/ \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7

import io.finix.payments.processing.client.model.Dispute;

transfer.disputeClient().<Resources<Dispute>>resourcesIterator()
  .forEachRemaining(page -> {
    Collection<Dispute> disputes = page.getContent();
  })
<?php



from finix.resources import Dispute
dispute = Dispute.get()

disputes = Finix::Dispute.retrieve(:id => "DIooiHahLHAHbyNsBJ7PKghy")

Example Response:

{
  "_embedded" : {
    "disputes" : [ {
      "id" : "DIooiHahLHAHbyNsBJ7PKghy",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "tags" : {
        "order_number" : "21DFASJSAKAS"
      },
      "amount" : 888888,
      "state" : "PENDING",
      "transfer" : "TRakiD6xZjj52y7g5rNP1DVX",
      "reason" : "FRAUD",
      "message" : null,
      "action" : null,
      "identity" : "ID9Kou1FsvdJFYEjypVGHee9",
      "created_at" : "2021-06-19T00:51:02.76Z",
      "updated_at" : "2021-06-19T00:51:02.53Z",
      "occurred_at" : "2021-06-19T00:50:08.65Z",
      "respond_by" : "2021-06-26T00:51:02.75Z",
      "dispute_details" : {
        "arn" : "123"
      },
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/disputes/DIooiHahLHAHbyNsBJ7PKghy"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "transfer" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRakiD6xZjj52y7g5rNP1DVX"
        },
        "evidence" : {
          "href" : "https://flex.sandbox-payments-api.com/disputes/DIooiHahLHAHbyNsBJ7PKghy/evidence"
        },
        "adjustment_transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/disputes/DIooiHahLHAHbyNsBJ7PKghy/adjustment_transfers"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/disputes?offset=0&limit=20&sort=created_at,desc&sort=id,desc"
    }
  },
  "page" : {
    "offset" : 0,
    "limit" : 20,
    "count" : 1
  }
}

HTTP Request

GET https://flex.sandbox-payments-api.com/disputes/

Identities

An Identity resource represents either a buyer or a merchant and is in a many ways the centerpiece of the payment API’s architecture. Transfers and Payment Instruments must be associated with an Identity. For both buyers and merchants this structure makes it easy to manage and reconcile their associated banks accounts, transaction history, and payouts.

Create an Identity for a Buyer



curl https://flex.sandbox-payments-api.com/identities \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
    {
        "tags": {
            "key": "value"
        },
        "entity": {
            "phone": "7145677613",
            "first_name": "Laura",
            "last_name": "Chang",
            "email": "therock@gmail.com",
            "personal_address": {
                "city": "San Mateo",
                "country": "USA",
                "region": "CA",
                "line2": "Apartment 7",
                "line1": "741 Douglass St",
                "postal_code": "94114"
            }
        }
    }'

import io.finix.payments.forms.*;
import io.finix.payments.views.*;
import io.finix.payments.forms.Address;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.forms.Date;


IdentityForm form = IdentityForm.builder()
    .entity(
    IdentityEntityForm.builder()
        .firstName("dwayne")
        .lastName("Sunkhronos")
        .email("user@example.org")
        .personalAddress(
            Address.builder()
                .line1("741 Douglass St")
                .line2("Apartment 7")
                .city("San Mateo")
                .region("CA")
                .postalCode("94114")
                .country("USA")
                .build()
        )
        .build())
    .build();

Maybe<Identity> response = api.identities.post(form);

if (! response.succeeded()) {
    ApiError error = response.error();
    System.out.println(error.getCode());
    throw new RuntimeException("API error attempting to create Identity");
}

Identity identity = response.view();
<?php
use Finix\Resources\Identity;

$identity = new Identity(
    array(
        "tags"=> array(
            "key"=> "value"
        ),
        "entity"=> array(
            "phone"=> "7145677613",
            "first_name"=> "Laura",
            "last_name"=> "Chang",
            "email"=> "therock@gmail.com",
            "personal_address"=> array(
                "city"=> "San Mateo",
                "country"=> "USA",
                "region"=> "CA",
                "line2"=> "Apartment 7",
                "line1"=> "741 Douglass St",
                "postal_code"=> "94114"
            )
        )
    ));
$identity = $identity->save();



from finix.resources import Identity

identity = Identity(**
    {
        "tags": {
            "key": "value"
        },
        "entity": {
            "phone": "7145677613",
            "first_name": "Laura",
            "last_name": "Chang",
            "email": "therock@gmail.com",
            "personal_address": {
                "city": "San Mateo",
                "country": "USA",
                "region": "CA",
                "line2": "Apartment 7",
                "line1": "741 Douglass St",
                "postal_code": "94114"
            }
        }
    }).save()
identity = Finix::Identity.new(
    {
        "tags"=> {
            "key"=> "value"
        },
        "entity"=> {
            "phone"=> "7145677613",
            "first_name"=> "Laura",
            "last_name"=> "Chang",
            "email"=> "therock@gmail.com",
            "personal_address"=> {
                "city"=> "San Mateo",
                "country"=> "USA",
                "region"=> "CA",
                "line2"=> "Apartment 7",
                "line1"=> "741 Douglass St",
                "postal_code"=> "94114"
            }
        }
    }).save

Example Response:

{
  "id" : "IDcPyNBigCcFETtgAwSVBa8p",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "entity" : {
    "title" : null,
    "first_name" : "Laura",
    "last_name" : "Chang",
    "email" : "therock@gmail.com",
    "business_name" : null,
    "business_type" : null,
    "doing_business_as" : null,
    "phone" : "7145677613",
    "business_phone" : null,
    "personal_address" : {
      "line1" : "741 Douglass St",
      "line2" : "Apartment 7",
      "city" : "San Mateo",
      "region" : "CA",
      "postal_code" : "94114",
      "country" : "USA"
    },
    "business_address" : null,
    "mcc" : null,
    "dob" : null,
    "max_transaction_amount" : 0,
    "amex_mid" : null,
    "discover_mid" : null,
    "url" : null,
    "annual_card_volume" : 0,
    "has_accepted_credit_cards_previously" : false,
    "incorporation_date" : null,
    "principal_percentage_ownership" : null,
    "short_business_name" : null,
    "ownership_type" : null,
    "tax_authority" : null,
    "tax_id_provided" : false,
    "business_tax_id_provided" : false,
    "default_statement_descriptor" : null
  },
  "tags" : {
    "key" : "value"
  },
  "created_at" : "2021-06-19T00:49:29.35Z",
  "updated_at" : "2021-06-19T00:49:29.35Z",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/verifications"
    },
    "merchants" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/merchants"
    },
    "settlements" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/settlements"
    },
    "authorizations" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/authorizations"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/transfers"
    },
    "payment_instruments" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/payment_instruments"
    },
    "associated_identities" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/associated_identities"
    },
    "disputes" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/disputes"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    }
  }
}

All fields for a buyer’s Identity are optional. However, a business_type field should not be passed. Passing a business_type indicates that the Identity should be treated as a merchant.

HTTP Request

POST https://flex.sandbox-payments-api.com/identities

Request Arguments

Field Type Description
first_name string, optional First name
last_name string, optional Last name
phone string, optional Phone number
email string, optional Email address
line1 string, optional First line of the address (max 35 characters)
line2 string, optional Second line of the address (max 35 characters)
city string, optional City (max 20 characters)
region string, optional 2-letter State code
postal_code string, optional Zip or Postal code (max 7 characters)
country string, optional 3-Letter Country code
tags object, optional Key value pair for annotating custom meta data (e.g. order numbers)

Create an Identity for a Merchant

curl https://flex.sandbox-payments-api.com/identities \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
      {
        "tags": {
          "Studio Rating": "4.7"
        }, 
        "entity": {
          "last_name": "Sunkhronos", 
          "max_transaction_amount": 12000000, 
          "has_accepted_credit_cards_previously": true, 
          "default_statement_descriptor": "Pollos Hermanos", 
          "personal_address": {
              "city": "San Mateo", 
              "country": "USA", 
              "region": "CA", 
              "line2": "Apartment 7", 
              "line1": "741 Douglass St", 
              "postal_code": "94114"
          }, 
          "incorporation_date": {
              "year": 1978, 
              "day": 27, 
              "month": 6
          }, 
          "business_address": {
              "city": "San Mateo", 
              "country": "USA", 
              "region": "CA", 
              "line2": "Apartment 8", 
              "line1": "741 Douglass St", 
              "postal_code": "94114"
          }, 
          "ownership_type": "PRIVATE", 
          "first_name": "dwayne", 
          "title": "CEO", 
          "business_tax_id": "123456789", 
          "doing_business_as": "Pollos Hermanos", 
          "principal_percentage_ownership": 50, 
          "email": "user@example.org", 
          "mcc": "0742", 
          "phone": "1234567890", 
          "business_name": "Pollos Hermanos", 
          "tax_id": "123456789", 
          "business_type": "INDIVIDUAL_SOLE_PROPRIETORSHIP", 
          "business_phone": "+1 (408) 756-4497", 
          "dob": {
              "year": 1978, 
              "day": 27, 
              "month": 6
          }, 
          "url": "www.PollosHermanos.com", 
          "annual_card_volume": 12000000
        },
        "additional_underwriting_data":{
          "average_card_transfer_amount":200000,
          "average_ach_transfer_amount":200000,
          "annual_ach_volume":200000,
          "business_description":"SB3 vegan cafe",
          "credit_check_ip_address":"42.1.1.113",
          "credit_check_timestamp":"2021-04-28T16:42:55Z",
          "credit_check_allowed":true,
          "credit_check_user_agent":"Mozilla 5.0(Macintosh; IntelMac OS X 10 _14_6)",
          "merchant_agreement_accepted":true,
          "merchant_agreement_ip_address":"42.1.1.113",
          "merchant_agreement_timestamp":"2021-04-28T16:42:55Z",
          "merchant_agreement_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6)",
          "refund_policy":"MERCHANDISE_EXCHANGE_ONLY",
          "card_volume_distribution":{
              "card_present_percentage":30,
              "ecommerce_percentage":60,
              "mail_order_telephone_order_percentage":10
          },
          "volume_distribution_by_business_type": {
              "business_to_business_volume_percentage": 100,
              "business_to_consumer_volume_percentage": 0,
              "person_to_person_volume_percentage": 0,
              "consumer_to_consumer_volume_percentage": 0
          }
        }
    }'

import io.finix.payments.ApiClient;
import io.finix.payments.enums.BusinessType;
import io.finix.payments.forms.Address;
import io.finix.payments.forms.Date;
import io.finix.payments.forms.IdentityEntityForm;
import io.finix.payments.forms.IdentityForm;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.views.Identity;


IdentityForm form = IdentityForm.builder()
  .entity(IdentityEntityForm.builder()
  .firstName("dwayne")
  .lastName("Sunkhronos")
  .email("user@example.org")
  .businessName("business inc")
  .businessType(BusinessType.LIMITED_LIABILITY_COMPANY)
  .doingBusinessAs("doingBusinessAs")
  .phone("1234567890")
  .businessPhone("+1 (408) 756-4497")
  .taxId("123456789")
  .businessTaxId("123456789")
  .personalAddress(Address.builder()
  .line1("741 Douglass St")
  .line2("Apartment 7")
  .city("San Mateo")
  .region("CA")
  .postalCode("94114")
  .country("USA")
  .build())
  .businessAddress(Address.builder()
  .line1("741 Douglass St")
  .line2("Apartment 7")
  .city("San Mateo")
  .region("CA")
  .postalCode("94114")
  .country("USA")
  .build())
  .dob(Date.builder().day(Integer.valueOf(27)).month(Integer.valueOf(5)).year(Integer.valueOf(1978)).build())
  .maxTransactionAmount(Long.valueOf(1000L))
  .mcc("7399").url("http://sample-entity.com")
  .annualCardVolume(Long.valueOf(100L))
  .defaultStatementDescriptor("Business Inc")
  .incorporationDate(Date.builder().day(Integer.valueOf(1)).month(Integer.valueOf(12)).year(Integer.valueOf(2012)).build())
  .principalPercentageOwnership(Integer.valueOf(51)).build()).build();

Maybe<Identity> response = api.identities.post(form);
if(! response.succeeded().booleanValue()) {
    ApiError error = response.error();
    System.out.println(error.getCode());
    throw new RuntimeException("API error attempting to create Identity");
}
    Identity identity = (Identity)response.view();


<?php
use Finix\Resources\Identity;

$identity = new Identity(
    array(
        "tags"=> array(
            "Studio Rating"=> "4.7"
        ),
        "entity"=> array(
            "last_name"=> "Sunkhronos",
            "max_transaction_amount"=> 12000000,
            "has_accepted_credit_cards_previously"=> true,
            "default_statement_descriptor"=> "Pawny City Hall",
            "personal_address"=> array(
                "city"=> "San Mateo",
                "country"=> "USA",
                "region"=> "CA",
                "line2"=> "Apartment 7",
                "line1"=> "741 Douglass St",
                "postal_code"=> "94114"
            ),
            "incorporation_date"=> array(
                "year"=> 1978,
                "day"=> 27,
                "month"=> 6
            ),
            "business_address"=> array(
                "city"=> "San Mateo",
                "country"=> "USA",
                "region"=> "CA",
                "line2"=> "Apartment 8",
                "line1"=> "741 Douglass St",
                "postal_code"=> "94114"
            ),
            "ownership_type"=> "PRIVATE",
            "first_name"=> "dwayne",
            "title"=> "CEO",
            "business_tax_id"=> "123456789",
            "doing_business_as"=> "Pawny City Hall",
            "principal_percentage_ownership"=> 50,
            "email"=> "user@example.org",
            "mcc"=> "0742",
            "phone"=> "1234567890",
            "business_name"=> "Pawny City Hall",
            "tax_id"=> "123456789",
            "business_type"=> "INDIVIDUAL_SOLE_PROPRIETORSHIP",
            "business_phone"=> "+1 (408) 756-4497",
            "dob"=> array(
                "year"=> 1978,
                "day"=> 27,
                "month"=> 6
            ),
            "url"=> "www.PawnyCityHall.com",
            "annual_card_volume"=> 12000000
        )
    )
);
$identity = $identity->save();



from finix.resources import Identity

identity = Identity(**
    {
        "tags": {
            "Studio Rating": "4.7"
        },
        "entity": {
            "last_name": "Sunkhronos",
            "max_transaction_amount": 12000000,
            "has_accepted_credit_cards_previously": True,
            "default_statement_descriptor": "Pawny City Hall",
            "personal_address": {
                "city": "San Mateo",
                "country": "USA",
                "region": "CA",
                "line2": "Apartment 7",
                "line1": "741 Douglass St",
                "postal_code": "94114"
            },
            "incorporation_date": {
                "year": 1978,
                "day": 27,
                "month": 6
            },
            "business_address": {
                "city": "San Mateo",
                "country": "USA",
                "region": "CA",
                "line2": "Apartment 8",
                "line1": "741 Douglass St",
                "postal_code": "94114"
            },
            "ownership_type": "PRIVATE",
            "first_name": "dwayne",
            "title": "CEO",
            "business_tax_id": "123456789",
            "doing_business_as": "Pawny City Hall",
            "principal_percentage_ownership": 50,
            "email": "user@example.org",
            "mcc": "0742",
            "phone": "1234567890",
            "business_name": "Pawny City Hall",
            "tax_id": "123456789",
            "business_type": "INDIVIDUAL_SOLE_PROPRIETORSHIP",
            "business_phone": "+1 (408) 756-4497",
            "dob": {
                "year": 1978,
                "day": 27,
                "month": 6
            },
            "url": "www.PawnyCityHall.com",
            "annual_card_volume": 12000000
        }
    }).save()
identity = Finix::Identity.new(
    {
        "tags"=> {
            "Studio Rating"=> "4.7"
        },
        "entity"=> {
            "last_name"=> "Sunkhronos",
            "max_transaction_amount"=> 12000000,
            "has_accepted_credit_cards_previously"=> true,
            "default_statement_descriptor"=> "Pawny City Hall",
            "personal_address"=> {
                "city"=> "San Mateo",
                "country"=> "USA",
                "region"=> "CA",
                "line2"=> "Apartment 7",
                "line1"=> "741 Douglass St",
                "postal_code"=> "94114"
            },
            "incorporation_date"=> {
                "year"=> 1978,
                "day"=> 27,
                "month"=> 6
            },
            "business_address"=> {
                "city"=> "San Mateo",
                "country"=> "USA",
                "region"=> "CA",
                "line2"=> "Apartment 8",
                "line1"=> "741 Douglass St",
                "postal_code"=> "94114"
            },
            "ownership_type"=> "PRIVATE",
            "first_name"=> "dwayne",
            "title"=> "CEO",
            "business_tax_id"=> "123456789",
            "doing_business_as"=> "Pawny City Hall",
            "principal_percentage_ownership"=> 50,
            "email"=> "user@example.org",
            "mcc"=> "0742",
            "phone"=> "1234567890",
            "business_name"=> "Pawny City Hall",
            "tax_id"=> "123456789",
            "business_type"=> "INDIVIDUAL_SOLE_PROPRIETORSHIP",
            "business_phone"=> "+1 (408) 756-4497",
            "dob"=> {
                "year"=> 1978,
                "day"=> 27,
                "month"=> 6
            },
            "url"=> "www.PawnyCityHall.com",
            "annual_card_volume"=> 12000000
        }
    }).save

Example Response:

{
  "id" : "ID9Kou1FsvdJFYEjypVGHee9",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "entity" : {
    "title" : "CEO",
    "first_name" : "dwayne",
    "last_name" : "Sunkhronos",
    "email" : "user@example.org",
    "business_name" : "Pawny City Hall",
    "business_type" : "INDIVIDUAL_SOLE_PROPRIETORSHIP",
    "doing_business_as" : "Pawny City Hall",
    "phone" : "1234567890",
    "business_phone" : "+1 (408) 756-4497",
    "personal_address" : {
      "line1" : "741 Douglass St",
      "line2" : "Apartment 7",
      "city" : "San Mateo",
      "region" : "CA",
      "postal_code" : "94114",
      "country" : "USA"
    },
    "business_address" : {
      "line1" : "741 Douglass St",
      "line2" : "Apartment 8",
      "city" : "San Mateo",
      "region" : "CA",
      "postal_code" : "94114",
      "country" : "USA"
    },
    "mcc" : "0742",
    "dob" : {
      "day" : 27,
      "month" : 6,
      "year" : 1978
    },
    "max_transaction_amount" : 12000000,
    "amex_mid" : null,
    "discover_mid" : null,
    "url" : "www.PawnyCityHall.com",
    "annual_card_volume" : 12000000,
    "has_accepted_credit_cards_previously" : true,
    "incorporation_date" : {
      "day" : 27,
      "month" : 6,
      "year" : 1978
    },
    "principal_percentage_ownership" : 50,
    "short_business_name" : null,
    "ownership_type" : "PRIVATE",
    "tax_authority" : null,
    "tax_id_provided" : true,
    "business_tax_id_provided" : true,
    "default_statement_descriptor" : "Pawny City Hall"
  },
  "tags" : {
    "Studio Rating" : "4.7"
  },
  "created_at" : "2021-06-19T00:49:21.28Z",
  "updated_at" : "2021-06-19T00:49:21.28Z",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/verifications"
    },
    "merchants" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/merchants"
    },
    "settlements" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/settlements"
    },
    "authorizations" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/authorizations"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/transfers"
    },
    "payment_instruments" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/payment_instruments"
    },
    "associated_identities" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/associated_identities"
    },
    "disputes" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/disputes"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    }
  }
}

Before we can begin charging cards we’ll need to provision a Merchant account for your seller. This requires 3-steps, which we’ll go into greater detail in the next few sections:

  1. First, create an Identity resource with the merchant’s underwriting and identity verification information

    POST https://flex.sandbox-payments-api.com/identities/

  2. Second, create a Payment Instrument representing the merchant’s bank account where processed funds will be settled (i.e. deposited)

    POST https://flex.sandbox-payments-api.com/payment_instruments/

  3. Finally, provision the Merchant account

    POST https://flex.sandbox-payments-api.com/identities/:IDENTITY_ID/merchants

Let’s start with the first step by creating an Identity resource. Each Identity represents either a person or a business. We use this resource to associate cards and payouts. This structure makes it simple to manage and reconcile payment instruments and payout history. Accounting of funds is done using the Identity so it’s recommended to have an Identity per recipient of funds.

You’ll want to store the ID of the newly created Identity resource for reference later.

HTTP Request

POST https://flex.sandbox-payments-api.com/identities

Business-specific Request Arguments

Field Type Description
business_name string, required Merchant’s full legal business name (If INDIVIDUAL_SOLE_PROPRIETORSHIP, please input first name, Full legal last name and middle initial; max 120 characters)
doing_business_as string, required Alternate name of the business. If no other name is used please use the same value for business_name (max 60 characters)
business_type string, required Please select one of the following values: INDIVIDUAL_SOLE_PROPRIETORSHIP, CORPORATION, LIMITED_LIABILITY_COMPANY, PARTNERSHIP, ASSOCIATION_ESTATE_TRUST, TAX_EXEMPT_ORGANIZATION, INTERNATIONAL_ORGANIZATION, GOVERNMENT_AGENCY
business_tax_id string, required Nine digit Tax Identification Number (TIN), Employer Identification Number (EIN) or if the business_type is INDIVIDUAL_SOLE_PROPRIETORSHIP and a Tax ID is not available, the principal’s Social Security Number (SSN)
url string, required Merchant’s publicly available website (max 100 characters)
business_phone string, required Customer service phone number where the merchant can be reached (max 10 characters)
incorporation_date object, required Date company was founded (See below for a full list of the child attributes)
business_address object, required Primary address for the legal entity (Full description of child attributes below)
ownership_type string, required Values can be either PUBLIC to indicate a publicly traded company or PRIVATE for privately held businesses
amex_mid integer, optional Assigned amexMid value. If provided must be 10 or 11 digits
discover_mid integer, optional Assigned discoverMid value

Principal-specific Request Arguments

(i.e. authorized representative or primary contact responsible for the account)

Field Type Description
first_name string, required Full legal first name of the merchant’s principal representative (max 20 characters)
last_name string, required Full legal last name of the merchant’s principal representative (max 20 characters)
title string, required Principal’s corporate title or role (i.e. Chief Executive Officer, CFO, etc.; max 60 characters)
principal_percentage_ownership integer, required Percentage of company owned by the principal (min 0; max 100)
tax_id string, required Nine digit Social Security Number (SSN) for the principal
dob object, required Principal’s date of birth (Full description of child attributes below)
phone string, required Principal’s phone number (max 10 characters)
email string, required Principal’s email address where they can be reached (max 100 characters)
personal_address object, required Principal’s personal home address. This field is used for identity verification purposes (Full description of child attributes below)

Processing-specific Request Arguments

Field Type Description
default_statement_descriptor string, required Billing descriptor displayed on the buyer’s bank or card statement (Length must be between 1 and 20 characters)
annual_card_volume integer, required Approximate annual credit card sales expected to be processed in cents by this merchant (max 23 characters)
max_transaction_amount integer, required Maximum amount that can be transacted for a single transaction in cents (max 12 characters)
mcc string, required Merchant Category Code (MCC) that this merchant will be classified under
has_accepted_credit_cards_previously boolean, optional Defaults to false if not passed

Address-object Request Arguments

Field Type Description
line1 string, required First line of the address (max 35 characters)
line2 string, optional Second line of the address (max 35 characters)
city string, required City (max 20 characters)
region string, required 2-letter State code
postal_code string, required Zip or Postal code (max 7 characters)
country string, required 3-Letter Country code

Incorporation Date-object Request Arguments

Field Type Description
day integer, required Day business was incorporated (between 1 and 31)
month integer, required Month business was incorporated (between 1 and 12)
year integer, required Year business was incorporated (4-digit)

DOB-object Request Arguments

Field Type Description
day integer, required Day of birth (between 1 and 31)
month integer, required Month of birth (between 1 and 12)
year integer, required Year of birth (4-digit)

Additional Underwriting Request Arguments

Field Type Description
annual _ach_volume integer, required Approximate annual ACH sales expected to be processed in cents by this merchant
average_ach_transfer_amount integer, required Approximate average ACH sale amount in cents for this merchant
average_card_transfer_amount integer, required Approximate average credit card sale amount in cents for this merchant
business_description string, required Description of this merchant’s business (max 100 characters)
card_volume_distribution object, required Merchant’s distribution of credit card volume (See below for a full list of the child attributes)
credit_check_allowed boolean, required Sets whether this merchant has consented and accepted to a credit check
credit_check_ip_address string, required IP address of the merchant when this merchant consented to a credit check (e.g., 42.1.1.113 )
credit_check_timestamp string, required Timestamp of the merchant when this merchant consented to a credit check (e.g., 2021-04-28T16:42:55Z)
credit_check_user_agent string, required The user agent of the browser when this merchant consented to a credit check (e.g., Mozilla 5.0(Macintosh; IntelMac OS X 10 _14_6))
merchant_agreeement_accepted boolean, required Sets whether this merchant has accepted the terms and conditions of the merchant agreement
merchant_agreement_ip_address string, required IP address of the merchant when this merchant accepted the merchant agreement (e.g., 42.1.1.113 )
merchant_agreement_timestamp string, required Timestamp of the merchant when this merchant consented to a credit check (e.g., 2021-04-28T16:42:55Z)
merchant_agreement_user_agent string, required The user agent of the browser when this merchant accepted the merchant agreement (e.g., Mozilla 5.0(Macintosh; IntelMac OS X 10 _14_6))
refund_policy string, required Please select one of the following values: NO_REFUNDS, MERCHANDISE_EXCHANGE_ONLY, WITHIN_30_DAYS, OTHER
volume_distribution_by_business_type object, required Merchant’s distribution of credit card volume by business type (See below for a full list of the child attributes)

Card Volume Distribution-object Request Arguments

Field Type Description
card_present_percentage integer, required Merchant’s percentage of business that is card present (between 0 and 100)
ecommerce_present_percentage integer, required Merchant’s percentage of business that is ecommerce (between 0 and 100)
mail_order_telephone_order_percentage integer, required Merchant’s percentage of business that is mail order or telephone order (between 0 and 100)

Volume Distribution by Business Type-object Request Arguments

Field Type Description
business_to_business_volume_percentage integer, required Merchant’s percentage of volume that is business to business (between 0 and 100)
business_to_consumer_volume_percentage integer, required Merchant’s percentage of volume that is business to consumer (between 0 and 100)
consumer_to_consumer_volume_percentage integer, required Merchant’s percentage of volume that is consumer to consumer (between 0 and 100)
person_to_person_volume_percentage integer, required Merchant’s percentage of volume that is person to person (between 0 and 100)
other_volume_percentage integer, required Merchant’s percentage of volume that is not represented by the previous fields (between 0 and 100)

Fetch a Identity


curl https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9 \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7

import io.finix.payments.forms.*;
import io.finix.payments.views.*;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import com.google.common.collect.ImmutableMap;

Maybe<Identity> response = api.identities.id("ID9Kou1FsvdJFYEjypVGHee9").get();
if (! response.succeeded()) {
    ApiError error = response.error();
    System.out.println(error.getCode());
    throw new RuntimeException("API error attempting to fetch Identity");
}
Identity identity = response.view();

<?php
use Finix\Resources\Identity;

$identity = Identity::retrieve('ID9Kou1FsvdJFYEjypVGHee9');


from finix.resources import Identity
identity = Identity.get(id="ID9Kou1FsvdJFYEjypVGHee9")

identity = Finix::Identity.retrieve(:id=>"ID9Kou1FsvdJFYEjypVGHee9")


Example Response:

{
  "id" : "ID9Kou1FsvdJFYEjypVGHee9",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "entity" : {
    "title" : "CEO",
    "first_name" : "dwayne",
    "last_name" : "Sunkhronos",
    "email" : "user@example.org",
    "business_name" : "Pawny City Hall",
    "business_type" : "INDIVIDUAL_SOLE_PROPRIETORSHIP",
    "doing_business_as" : "Pawny City Hall",
    "phone" : "1234567890",
    "business_phone" : "+1 (408) 756-4497",
    "personal_address" : {
      "line1" : "741 Douglass St",
      "line2" : "Apartment 7",
      "city" : "San Mateo",
      "region" : "CA",
      "postal_code" : "94114",
      "country" : "USA"
    },
    "business_address" : {
      "line1" : "741 Douglass St",
      "line2" : "Apartment 8",
      "city" : "San Mateo",
      "region" : "CA",
      "postal_code" : "94114",
      "country" : "USA"
    },
    "mcc" : "0742",
    "dob" : {
      "day" : 27,
      "month" : 6,
      "year" : 1978
    },
    "max_transaction_amount" : 12000000,
    "amex_mid" : null,
    "discover_mid" : null,
    "url" : "www.PawnyCityHall.com",
    "annual_card_volume" : 12000000,
    "has_accepted_credit_cards_previously" : true,
    "incorporation_date" : {
      "day" : 27,
      "month" : 6,
      "year" : 1978
    },
    "principal_percentage_ownership" : 50,
    "short_business_name" : null,
    "ownership_type" : "PRIVATE",
    "tax_authority" : null,
    "tax_id_provided" : true,
    "business_tax_id_provided" : true,
    "default_statement_descriptor" : "Pawny City Hall"
  },
  "tags" : {
    "refund_policy" : "N",
    "credit_inquiry_ip" : "42.1.1.113",
    "service_you_provide" : "Professional Services",
    "underwriting_substatus" : "new",
    "company_type" : "S",
    "merchant_agreement_ip" : "42.1.1.113",
    "merchant_agreement_html_content" : "Legal content",
    "annual_gross_ach_revenue" : "100000",
    "credit_inquiry_electronic_signature" : "You further agree to provide written authorization to undergo a credit check as part of the FCRA Permissible Purpose Guidelines",
    "team" : "name",
    "underwriting_note" : "new",
    "type" : "Beneficial Owner",
    "annual_volume" : "1000000",
    "avg_ach_transaction" : "100",
    "credit_inquiry_timestamp" : "2019-06-19 21:22:03",
    "underwriting_request" : "new",
    "avg_trans_size" : "100",
    "proc_change" : "PROC_CHANGE",
    "credit_inquiry_html_content" : "Legal content",
    "b2b_percent" : "20",
    "application_status" : "new",
    "underwriting_status" : "new",
    "merchant_agreement_timestamp" : "2019-06-19 21:22:03"
  },
  "created_at" : "2021-06-19T00:49:21.28Z",
  "updated_at" : "2021-06-19T00:49:27.09Z",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/verifications"
    },
    "merchants" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/merchants"
    },
    "settlements" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/settlements"
    },
    "authorizations" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/authorizations"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/transfers"
    },
    "payment_instruments" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/payment_instruments"
    },
    "associated_identities" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/associated_identities"
    },
    "disputes" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/disputes"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    }
  }
}

HTTP Request

GET https://flex.sandbox-payments-api.com/identities/:IDENTITY_ID

URL Parameters

Parameter Description
:IDENTITY_ID ID of the Identity

List all Identities

curl https://flex.sandbox-payments-api.com/identities/ \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7


import io.finix.payments.ApiClient;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.lib.Page;

Maybe<Page<Identity>> response = api.identities.get();

if (! response.succeeded()) {
    ApiError error = response.error();
    System.out.println(error.getCode());
    System.out.println(error.getMessage());
    System.out.println(error.getDetails());
    throw new RuntimeException("API error attempting to list all Identities");
}

Page<Identity> page = response.view();

<?php
use Finix\Resources\Identity;

$identities= Identity::getPagination("/identities");




from finix.resources import Identity
identity = Identity.get()

identities = Finix::Identity.retrieve


Example Response:

{
  "_embedded" : {
    "identities" : [ {
      "id" : "IDi32Qn43FtNMRNkS7mLwsoq",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "entity" : {
        "title" : "CEO",
        "first_name" : "dwayne",
        "last_name" : "Sunkhronos",
        "email" : "user@example.org",
        "business_name" : "Petes Coffee",
        "business_type" : "CORPORATION",
        "doing_business_as" : "Petes Coffee",
        "phone" : "1234567890",
        "business_phone" : "+1 (408) 756-4497",
        "personal_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 7",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "business_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 8",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "mcc" : "0742",
        "dob" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "max_transaction_amount" : 12000000,
        "amex_mid" : null,
        "discover_mid" : null,
        "url" : "www.PetesCoffee.com",
        "annual_card_volume" : 12000000,
        "has_accepted_credit_cards_previously" : true,
        "incorporation_date" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "principal_percentage_ownership" : 50,
        "short_business_name" : null,
        "ownership_type" : "PRIVATE",
        "tax_authority" : null,
        "tax_id_provided" : true,
        "business_tax_id_provided" : true,
        "default_statement_descriptor" : "Petes Coffee"
      },
      "tags" : {
        "Studio Rating" : "4.7"
      },
      "created_at" : "2021-06-19T00:49:31.15Z",
      "updated_at" : "2021-06-19T00:49:31.07Z",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq/verifications"
        },
        "merchants" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq/merchants"
        },
        "settlements" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq/settlements"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq/transfers"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq/payment_instruments"
        },
        "associated_identities" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq/associated_identities"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq/disputes"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        }
      }
    }, {
      "id" : "IDcPyNBigCcFETtgAwSVBa8p",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "entity" : {
        "title" : null,
        "first_name" : "Laura",
        "last_name" : "Chang",
        "email" : "therock@gmail.com",
        "business_name" : null,
        "business_type" : null,
        "doing_business_as" : null,
        "phone" : "7145677613",
        "business_phone" : null,
        "personal_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 7",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "business_address" : null,
        "mcc" : null,
        "dob" : null,
        "max_transaction_amount" : 0,
        "amex_mid" : null,
        "discover_mid" : null,
        "url" : null,
        "annual_card_volume" : 0,
        "has_accepted_credit_cards_previously" : false,
        "incorporation_date" : null,
        "principal_percentage_ownership" : null,
        "short_business_name" : null,
        "ownership_type" : null,
        "tax_authority" : null,
        "tax_id_provided" : false,
        "business_tax_id_provided" : false,
        "default_statement_descriptor" : null
      },
      "tags" : {
        "key" : "value"
      },
      "created_at" : "2021-06-19T00:49:29.35Z",
      "updated_at" : "2021-06-19T00:49:29.25Z",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/verifications"
        },
        "merchants" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/merchants"
        },
        "settlements" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/settlements"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/transfers"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/payment_instruments"
        },
        "associated_identities" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/associated_identities"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p/disputes"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        }
      }
    }, {
      "id" : "IDiwiFaKEy4DhvML2uWodTTj",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "entity" : {
        "title" : "CEO",
        "first_name" : "dwayne",
        "last_name" : "Sunkhronos",
        "email" : "user@example.org",
        "business_name" : "Lees Sandwiches",
        "business_type" : "GOVERNMENT_AGENCY",
        "doing_business_as" : "Lees Sandwiches",
        "phone" : "1234567890",
        "business_phone" : "+1 (408) 756-4497",
        "personal_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 7",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "business_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 8",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "mcc" : "0742",
        "dob" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "max_transaction_amount" : 12000000,
        "amex_mid" : null,
        "discover_mid" : null,
        "url" : "www.LeesSandwiches.com",
        "annual_card_volume" : 12000000,
        "has_accepted_credit_cards_previously" : true,
        "incorporation_date" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "principal_percentage_ownership" : 50,
        "short_business_name" : null,
        "ownership_type" : "PUBLIC",
        "tax_authority" : null,
        "tax_id_provided" : true,
        "business_tax_id_provided" : true,
        "default_statement_descriptor" : "Lees Sandwiches"
      },
      "tags" : {
        "Studio Rating" : "4.7"
      },
      "created_at" : "2021-06-19T00:49:25.03Z",
      "updated_at" : "2021-06-19T00:49:24.92Z",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDiwiFaKEy4DhvML2uWodTTj"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDiwiFaKEy4DhvML2uWodTTj/verifications"
        },
        "merchants" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDiwiFaKEy4DhvML2uWodTTj/merchants"
        },
        "settlements" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDiwiFaKEy4DhvML2uWodTTj/settlements"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDiwiFaKEy4DhvML2uWodTTj/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDiwiFaKEy4DhvML2uWodTTj/transfers"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDiwiFaKEy4DhvML2uWodTTj/payment_instruments"
        },
        "associated_identities" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDiwiFaKEy4DhvML2uWodTTj/associated_identities"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDiwiFaKEy4DhvML2uWodTTj/disputes"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        }
      }
    }, {
      "id" : "IDc9N2oQ2BkmUu112cNDJQUe",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "entity" : {
        "title" : "CEO",
        "first_name" : "dwayne",
        "last_name" : "Sunkhronos",
        "email" : "user@example.org",
        "business_name" : "Lees Sandwiches",
        "business_type" : "ASSOCIATION_ESTATE_TRUST",
        "doing_business_as" : "Lees Sandwiches",
        "phone" : "1234567890",
        "business_phone" : "+1 (408) 756-4497",
        "personal_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 7",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "business_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 8",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "mcc" : "0742",
        "dob" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "max_transaction_amount" : 12000000,
        "amex_mid" : null,
        "discover_mid" : null,
        "url" : "www.LeesSandwiches.com",
        "annual_card_volume" : 12000000,
        "has_accepted_credit_cards_previously" : true,
        "incorporation_date" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "principal_percentage_ownership" : 50,
        "short_business_name" : null,
        "ownership_type" : "PRIVATE",
        "tax_authority" : null,
        "tax_id_provided" : true,
        "business_tax_id_provided" : true,
        "default_statement_descriptor" : "Lees Sandwiches"
      },
      "tags" : {
        "Studio Rating" : "4.7"
      },
      "created_at" : "2021-06-19T00:49:23.04Z",
      "updated_at" : "2021-06-19T00:49:22.93Z",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDc9N2oQ2BkmUu112cNDJQUe"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDc9N2oQ2BkmUu112cNDJQUe/verifications"
        },
        "merchants" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDc9N2oQ2BkmUu112cNDJQUe/merchants"
        },
        "settlements" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDc9N2oQ2BkmUu112cNDJQUe/settlements"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDc9N2oQ2BkmUu112cNDJQUe/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDc9N2oQ2BkmUu112cNDJQUe/transfers"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDc9N2oQ2BkmUu112cNDJQUe/payment_instruments"
        },
        "associated_identities" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDc9N2oQ2BkmUu112cNDJQUe/associated_identities"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDc9N2oQ2BkmUu112cNDJQUe/disputes"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        }
      }
    }, {
      "id" : "ID9Kou1FsvdJFYEjypVGHee9",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "entity" : {
        "title" : "CEO",
        "first_name" : "dwayne",
        "last_name" : "Sunkhronos",
        "email" : "user@example.org",
        "business_name" : "Pawny City Hall",
        "business_type" : "INDIVIDUAL_SOLE_PROPRIETORSHIP",
        "doing_business_as" : "Pawny City Hall",
        "phone" : "1234567890",
        "business_phone" : "+1 (408) 756-4497",
        "personal_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 7",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "business_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 8",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "mcc" : "0742",
        "dob" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "max_transaction_amount" : 12000000,
        "amex_mid" : null,
        "discover_mid" : null,
        "url" : "www.PawnyCityHall.com",
        "annual_card_volume" : 12000000,
        "has_accepted_credit_cards_previously" : true,
        "incorporation_date" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "principal_percentage_ownership" : 50,
        "short_business_name" : null,
        "ownership_type" : "PRIVATE",
        "tax_authority" : null,
        "tax_id_provided" : true,
        "business_tax_id_provided" : true,
        "default_statement_descriptor" : "Pawny City Hall"
      },
      "tags" : {
        "refund_policy" : "N",
        "credit_inquiry_ip" : "42.1.1.113",
        "service_you_provide" : "Professional Services",
        "underwriting_substatus" : "new",
        "company_type" : "S",
        "merchant_agreement_ip" : "42.1.1.113",
        "merchant_agreement_html_content" : "Legal content",
        "annual_gross_ach_revenue" : "100000",
        "credit_inquiry_electronic_signature" : "You further agree to provide written authorization to undergo a credit check as part of the FCRA Permissible Purpose Guidelines",
        "team" : "name",
        "underwriting_note" : "new",
        "type" : "Beneficial Owner",
        "annual_volume" : "1000000",
        "avg_ach_transaction" : "100",
        "credit_inquiry_timestamp" : "2019-06-19 21:22:03",
        "underwriting_request" : "new",
        "avg_trans_size" : "100",
        "proc_change" : "PROC_CHANGE",
        "credit_inquiry_html_content" : "Legal content",
        "b2b_percent" : "20",
        "application_status" : "new",
        "underwriting_status" : "new",
        "merchant_agreement_timestamp" : "2019-06-19 21:22:03"
      },
      "created_at" : "2021-06-19T00:49:21.28Z",
      "updated_at" : "2021-06-19T00:49:27.09Z",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/verifications"
        },
        "merchants" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/merchants"
        },
        "settlements" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/settlements"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/transfers"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/payment_instruments"
        },
        "associated_identities" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/associated_identities"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/disputes"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        }
      }
    }, {
      "id" : "IDN3MtjxwfA1whKGLHzhNSb",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "entity" : {
        "title" : "CEO",
        "first_name" : "dwayne",
        "last_name" : "Sunkhronos",
        "email" : "user@example.org",
        "business_name" : "Dunder Mifflin",
        "business_type" : "INTERNATIONAL_ORGANIZATION",
        "doing_business_as" : "Dunder Mifflin",
        "phone" : "1234567890",
        "business_phone" : "+1 (408) 756-4497",
        "personal_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 7",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "business_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 8",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "mcc" : "0742",
        "dob" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "max_transaction_amount" : 12000000,
        "amex_mid" : null,
        "discover_mid" : null,
        "url" : "www.DunderMifflin.com",
        "annual_card_volume" : 12000000,
        "has_accepted_credit_cards_previously" : true,
        "incorporation_date" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "principal_percentage_ownership" : 50,
        "short_business_name" : null,
        "ownership_type" : "PRIVATE",
        "tax_authority" : null,
        "tax_id_provided" : true,
        "business_tax_id_provided" : true,
        "default_statement_descriptor" : "Dunder Mifflin"
      },
      "tags" : {
        "Studio Rating" : "4.7"
      },
      "created_at" : "2021-06-19T00:49:04.84Z",
      "updated_at" : "2021-06-19T00:49:24.31Z",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDN3MtjxwfA1whKGLHzhNSb"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDN3MtjxwfA1whKGLHzhNSb/verifications"
        },
        "merchants" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDN3MtjxwfA1whKGLHzhNSb/merchants"
        },
        "settlements" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDN3MtjxwfA1whKGLHzhNSb/settlements"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDN3MtjxwfA1whKGLHzhNSb/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDN3MtjxwfA1whKGLHzhNSb/transfers"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDN3MtjxwfA1whKGLHzhNSb/payment_instruments"
        },
        "associated_identities" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDN3MtjxwfA1whKGLHzhNSb/associated_identities"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDN3MtjxwfA1whKGLHzhNSb/disputes"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        }
      }
    }, {
      "id" : "IDqN2VUEXMm354CpP2kD5WYA",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "entity" : {
        "title" : "CEO",
        "first_name" : "dwayne",
        "last_name" : "Sunkhronos",
        "email" : "user@example.org",
        "business_name" : "Pollos Hermanos",
        "business_type" : "TAX_EXEMPT_ORGANIZATION",
        "doing_business_as" : "Pollos Hermanos",
        "phone" : "1234567890",
        "business_phone" : "+1 (408) 756-4497",
        "personal_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 7",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "business_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 8",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "mcc" : "0742",
        "dob" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "max_transaction_amount" : 12000000,
        "amex_mid" : null,
        "discover_mid" : null,
        "url" : "www.PollosHermanos.com",
        "annual_card_volume" : 12000000,
        "has_accepted_credit_cards_previously" : true,
        "incorporation_date" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "principal_percentage_ownership" : 50,
        "short_business_name" : null,
        "ownership_type" : "PUBLIC",
        "tax_authority" : null,
        "tax_id_provided" : true,
        "business_tax_id_provided" : true,
        "default_statement_descriptor" : "Pollos Hermanos"
      },
      "tags" : {
        "Studio Rating" : "4.7"
      },
      "created_at" : "2021-06-19T00:49:04.03Z",
      "updated_at" : "2021-06-19T00:49:23.50Z",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDqN2VUEXMm354CpP2kD5WYA"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDqN2VUEXMm354CpP2kD5WYA/verifications"
        },
        "merchants" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDqN2VUEXMm354CpP2kD5WYA/merchants"
        },
        "settlements" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDqN2VUEXMm354CpP2kD5WYA/settlements"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDqN2VUEXMm354CpP2kD5WYA/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDqN2VUEXMm354CpP2kD5WYA/transfers"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDqN2VUEXMm354CpP2kD5WYA/payment_instruments"
        },
        "associated_identities" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDqN2VUEXMm354CpP2kD5WYA/associated_identities"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDqN2VUEXMm354CpP2kD5WYA/disputes"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        }
      }
    }, {
      "id" : "IDi5WVCsEqTyydA1qFL6iYEU",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "entity" : {
        "title" : "CEO",
        "first_name" : "dwayne",
        "last_name" : "Sunkhronos",
        "email" : "user@example.org",
        "business_name" : "Pollos Hermanos",
        "business_type" : "PARTNERSHIP",
        "doing_business_as" : "Pollos Hermanos",
        "phone" : "1234567890",
        "business_phone" : "+1 (408) 756-4497",
        "personal_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 7",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "business_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 8",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "mcc" : "0742",
        "dob" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "max_transaction_amount" : 12000000,
        "amex_mid" : null,
        "discover_mid" : null,
        "url" : "www.PollosHermanos.com",
        "annual_card_volume" : 12000000,
        "has_accepted_credit_cards_previously" : true,
        "incorporation_date" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "principal_percentage_ownership" : 50,
        "short_business_name" : null,
        "ownership_type" : "PRIVATE",
        "tax_authority" : null,
        "tax_id_provided" : true,
        "business_tax_id_provided" : true,
        "default_statement_descriptor" : "Pollos Hermanos"
      },
      "tags" : {
        "Studio Rating" : "4.7"
      },
      "created_at" : "2021-06-19T00:49:02.91Z",
      "updated_at" : "2021-06-19T00:49:22.37Z",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi5WVCsEqTyydA1qFL6iYEU"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi5WVCsEqTyydA1qFL6iYEU/verifications"
        },
        "merchants" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi5WVCsEqTyydA1qFL6iYEU/merchants"
        },
        "settlements" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi5WVCsEqTyydA1qFL6iYEU/settlements"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi5WVCsEqTyydA1qFL6iYEU/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi5WVCsEqTyydA1qFL6iYEU/transfers"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi5WVCsEqTyydA1qFL6iYEU/payment_instruments"
        },
        "associated_identities" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi5WVCsEqTyydA1qFL6iYEU/associated_identities"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi5WVCsEqTyydA1qFL6iYEU/disputes"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        }
      }
    }, {
      "id" : "IDskn952UPwjY1e7EnpYE89R",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "entity" : {
        "title" : "CEO",
        "first_name" : "dwayne",
        "last_name" : "Sunkhronos",
        "email" : "user@example.org",
        "business_name" : "Pollos Hermanos",
        "business_type" : "LIMITED_LIABILITY_COMPANY",
        "doing_business_as" : "Pollos Hermanos",
        "phone" : "1234567890",
        "business_phone" : "+1 (408) 756-4497",
        "personal_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 7",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "business_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 8",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "mcc" : "0742",
        "dob" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "max_transaction_amount" : 12000000,
        "amex_mid" : null,
        "discover_mid" : null,
        "url" : "www.PollosHermanos.com",
        "annual_card_volume" : 12000000,
        "has_accepted_credit_cards_previously" : true,
        "incorporation_date" : {
          "day" : 27,
          "month" : 6,
          "year" : 1978
        },
        "principal_percentage_ownership" : 50,
        "short_business_name" : null,
        "ownership_type" : "PRIVATE",
        "tax_authority" : null,
        "tax_id_provided" : true,
        "business_tax_id_provided" : true,
        "default_statement_descriptor" : "Pollos Hermanos"
      },
      "tags" : {
        "Studio Rating" : "4.7"
      },
      "created_at" : "2021-06-19T00:49:02.29Z",
      "updated_at" : "2021-06-19T00:49:21.76Z",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDskn952UPwjY1e7EnpYE89R"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDskn952UPwjY1e7EnpYE89R/verifications"
        },
        "merchants" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDskn952UPwjY1e7EnpYE89R/merchants"
        },
        "settlements" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDskn952UPwjY1e7EnpYE89R/settlements"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDskn952UPwjY1e7EnpYE89R/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDskn952UPwjY1e7EnpYE89R/transfers"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDskn952UPwjY1e7EnpYE89R/payment_instruments"
        },
        "associated_identities" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDskn952UPwjY1e7EnpYE89R/associated_identities"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDskn952UPwjY1e7EnpYE89R/disputes"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        }
      }
    }, {
      "id" : "ID4vHpdKcsL7mpqgnpKbySdu",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "entity" : {
        "title" : null,
        "first_name" : "dwayne",
        "last_name" : "Sunkhronos",
        "email" : "user@example.org",
        "business_name" : "BrainTree",
        "business_type" : "LIMITED_LIABILITY_COMPANY",
        "doing_business_as" : "BrainTree",
        "phone" : "1234567890",
        "business_phone" : "+1 (408) 756-4497",
        "personal_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 7",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "business_address" : {
          "line1" : "741 Douglass St",
          "line2" : "Apartment 8",
          "city" : "San Mateo",
          "region" : "CA",
          "postal_code" : "94114",
          "country" : "USA"
        },
        "mcc" : null,
        "dob" : {
          "day" : 27,
          "month" : 5,
          "year" : 1978
        },
        "max_transaction_amount" : 1200000,
        "amex_mid" : null,
        "discover_mid" : null,
        "url" : null,
        "annual_card_volume" : 0,
        "has_accepted_credit_cards_previously" : false,
        "incorporation_date" : null,
        "principal_percentage_ownership" : null,
        "short_business_name" : null,
        "ownership_type" : null,
        "tax_authority" : null,
        "tax_id_provided" : true,
        "business_tax_id_provided" : true,
        "default_statement_descriptor" : null
      },
      "tags" : {
        "application_name" : "BrainTree"
      },
      "created_at" : "2021-06-19T00:48:59.64Z",
      "updated_at" : "2021-06-19T00:48:59.68Z",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID4vHpdKcsL7mpqgnpKbySdu"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID4vHpdKcsL7mpqgnpKbySdu/verifications"
        },
        "merchants" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID4vHpdKcsL7mpqgnpKbySdu/merchants"
        },
        "settlements" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID4vHpdKcsL7mpqgnpKbySdu/settlements"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID4vHpdKcsL7mpqgnpKbySdu/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID4vHpdKcsL7mpqgnpKbySdu/transfers"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID4vHpdKcsL7mpqgnpKbySdu/payment_instruments"
        },
        "associated_identities" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID4vHpdKcsL7mpqgnpKbySdu/associated_identities"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID4vHpdKcsL7mpqgnpKbySdu/disputes"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/identities?offset=0&limit=20&sort=created_at,desc&sort=id,desc"
    }
  },
  "page" : {
    "offset" : 0,
    "limit" : 20,
    "count" : 10
  }
}

HTTP Request

GET https://flex.sandbox-payments-api.com/identities/

Update an Identity

curl https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9 \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -X PUT \
    -d '
    {
        "tags": {
            "key": "value_2"
        },
        "entity": {
            "business_phone": "+1 (408) 756-4497",
            "first_name": "Bernard",
            "last_name": "James",
            "title": "CTO",
            "dob": {
                "year": 1988,
                "day": 2,
                "month": 5
            },
            "ownership_type": "PRIVATE",
            "has_accepted_credit_cards_previously": true,
            "mcc": "0742",
            "phone": "7144177878",
            "business_tax_id": "123456789",
            "max_transaction_amount": 1200000,
            "principal_percentage_ownership": 50,
            "doing_business_as": "Pollos Hermanos",
            "annual_card_volume": 12000000,
            "default_statement_descriptor": "Pollos Hermanos",
            "url": "www.PollosHermanos.com",
            "business_name": "Pollos Hermanos",
            "personal_address": {
                "city": "San Diego",
                "country": "USA",
                "region": "CA",
                "line2": "Apartment 2",
                "line1": "712 Douglass St",
                "postal_code": "94194"
            },
            "email": "user@example.org",
            "tax_id": "999999999"
        }
    }'

import io.finix.payments.ApiClient;
import io.finix.payments.enums.BusinessType;
import io.finix.payments.forms.*;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.views.Identity;

IdentityForm form = IdentityForm.builder()
                .entity(
                  IdentityEntityForm.builder()
                      .firstName("dwayne")
                      .email("self@newdomain.com")
                      .businessPhone("+1 (408) 756-4497")
                      .build())
                .build();

Maybe<Identity> response = api.identities.id("ID9Kou1FsvdJFYEjypVGHee9").put(form);

if (! response.succeeded()) {
    System.out.println(response.error());
    throw new RuntimeException("API error attempting to update identity");
}

Identity updatedIdentity = response.view();

<?php



from finix.resources import Identity

identity = Identity.get(id="ID9Kou1FsvdJFYEjypVGHee9")
identity.entity["first_name"] = "Bernard"
identity.save()

identity = Finix::Identity.retrieve(:id=>"ID9Kou1FsvdJFYEjypVGHee9")

identity.entity["first_name"] = "Bernard"
identity.save

Example Response:

{
  "id" : "ID9Kou1FsvdJFYEjypVGHee9",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "entity" : {
    "title" : "CTO",
    "first_name" : "Bernard",
    "last_name" : "James",
    "email" : "user@example.org",
    "business_name" : "Pollos Hermanos",
    "business_type" : "INDIVIDUAL_SOLE_PROPRIETORSHIP",
    "doing_business_as" : "Pollos Hermanos",
    "phone" : "7144177878",
    "business_phone" : "+1 (408) 756-4497",
    "personal_address" : {
      "line1" : "712 Douglass St",
      "line2" : "Apartment 2",
      "city" : "San Diego",
      "region" : "CA",
      "postal_code" : "94194",
      "country" : "USA"
    },
    "business_address" : {
      "line1" : "741 Douglass St",
      "line2" : "Apartment 8",
      "city" : "San Mateo",
      "region" : "CA",
      "postal_code" : "94114",
      "country" : "USA"
    },
    "mcc" : "0742",
    "dob" : {
      "day" : 2,
      "month" : 5,
      "year" : 1988
    },
    "max_transaction_amount" : 1200000,
    "amex_mid" : null,
    "discover_mid" : null,
    "url" : "www.PollosHermanos.com",
    "annual_card_volume" : 12000000,
    "has_accepted_credit_cards_previously" : true,
    "incorporation_date" : {
      "day" : 27,
      "month" : 6,
      "year" : 1978
    },
    "principal_percentage_ownership" : 50,
    "short_business_name" : null,
    "ownership_type" : "PRIVATE",
    "tax_authority" : null,
    "tax_id_provided" : true,
    "business_tax_id_provided" : true,
    "default_statement_descriptor" : "Pollos Hermanos"
  },
  "tags" : {
    "key" : "value_2"
  },
  "created_at" : "2021-06-19T00:49:21.28Z",
  "updated_at" : "2021-06-19T00:50:06.54Z",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/verifications"
    },
    "merchants" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/merchants"
    },
    "settlements" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/settlements"
    },
    "authorizations" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/authorizations"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/transfers"
    },
    "payment_instruments" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/payment_instruments"
    },
    "associated_identities" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/associated_identities"
    },
    "disputes" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/disputes"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    }
  }
}

Update the information of a previously created Identity. Please note that in the case of merchant accounts this API request alone does not update this information on the underlying processor. To update the merchant’s information on the underlying processor you must update the merchant on the processor.

HTTP Request

PUT https://flex.sandbox-payments-api.com/identities/:IDENTITY_ID

Business-specific Request Arguments

Field Type Description
business_name string, required Merchant’s full legal business name (If INDIVIDUAL_SOLE_PROPRIETORSHIP, please input first name, Full legal last name and middle initial; max 120 characters)
doing_business_as string, required Alternate name of the business. If no other name is used please use the same value for business_name (max 60 characters)
business_type string, required Please select one of the following values: INDIVIDUAL_SOLE_PROPRIETORSHIP, CORPORATION, LIMITED_LIABILITY_COMPANY, PARTNERSHIP, ASSOCIATION_ESTATE_TRUST, TAX_EXEMPT_ORGANIZATION, INTERNATIONAL_ORGANIZATION, GOVERNMENT_AGENCY
business_tax_id string, required Nine digit Tax Identification Number (TIN), Employer Identification Number (EIN) or if the business_type is INDIVIDUAL_SOLE_PROPRIETORSHIP and a Tax ID is not available, the principal’s Social Security Number (SSN)
url string, required Merchant’s publicly available website (max 100 characters)
business_phone string, required Customer service phone number where the merchant can be reached (max 10 characters)
incorporation_date object, required Date company was founded (See below for a full list of the child attributes)
business_address object, required Primary address for the legal entity (Full description of child attributes below)
ownership_type string, required Values can be either PUBLIC to indicate a publicly traded company or PRIVATE for privately held businesses

Principal-specific Request Arguments

(i.e. authorized representative or primary contact responsible for the account)

Field Type Description
first_name string, required Full legal first name of the merchant’s principal representative (max 20 characters)
last_name string, required Full legal last name of the merchant’s principal representative (max 20 characters)
title string, required Principal’s corporate title or role (i.e. Chief Executive Officer, CFO, etc.; max 60 characters)
principal_percentage_ownership integer, required Percentage of company owned by the principal (min 0; max 100)
tax_id string, required Nine digit Social Security Number (SSN) for the principal
dob object, required Principal’s date of birth (Full description of child attributes below)
phone string, required Principal’s phone number (max 10 characters)
email string, required Principal’s email address where they can be reached (max 100 characters)
personal_address object, required Principal’s personal home address. This field is used for identity verification purposes (Full description of child attributes below)

Processing-specific Request Arguments

Field Type Description
default_statement_descriptor string, required Billing descriptor displayed on the buyer’s bank or card statement (Length must be between 1 and 20 characters)
annual_card_volume integer, required Approximate annual credit card sales expected to be processed in cents by this merchant (max 23 characters)
max_transaction_amount integer, required Maximum amount that can be transacted for a single transaction in cents (max 12 characters)
mcc string, required Merchant Category Code (MCC) that this merchant will be classified under
has_accepted_credit_cards_previously boolean, optional Defaults to false if not passed

Address-object Request Arguments

Field Type Description
line1 string, optional First line of the address (max 35 characters)
line2 string, optional Second line of the address (max 35 characters)
city string, required City (max 20 characters)
region string, optional 2-letter State code
postal_code string, optional Zip or Postal code (max 7 characters)
country string, optional 3-Letter Country code

Incorporation Date-object Request Arguments

Field Type Description
day integer, required Day business was incorporated (between 1 and 31)
month integer, required Month business was incorporated (between 1 and 12)
year integer, required Year business was incorporated (4-digit)

DOB-object Request Arguments

Field Type Description
day integer, required Day of birth (between 1 and 31)
month integer, required Month of birth (between 1 and 12)
year integer, required Year of birth (4-digit)

Merchants

A Merchant resource represents a business’s merchant account on a processor. In other words, any web service that connects buyers (i.e. customers) and sellers (i.e. merchants).

Provision a Merchant

curl https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/merchants \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
    {
        "tags": {
            "key_2": "value_2"
        }
    }'

import io.finix.payments.interfaces.Maybe;
import io.finix.payments.views.*;
import io.finix.payments.forms.*;

MerchantUnderwritingForm form = MerchantUnderwritingForm.builder()
    .processor(null)
    .tags(ImmutableMap.of("key", "value"))
    .build();

Maybe<Merchant> underwriteMerchant = api.identities.id("ID9Kou1FsvdJFYEjypVGHee9").merchants.post(form);

if(! underwriteMerchant.succeeded()){
   System.out.println(underwriteMerchant.error());
}

Merchant provisionMerchant = underwriteMerchant.view();

<?php
use Finix\Resources\Identity;
use Finix\Resources\Merchant;

$identity = Identity::retrieve('ID9Kou1FsvdJFYEjypVGHee9');

$merchant = $identity->provisionMerchantOn(new Merchant());



from finix.resources import Identity
from finix.resources import Merchant

identity = Identity.get(id="ID9Kou1FsvdJFYEjypVGHee9")
merchant = identity.provision_merchant_on(Merchant())

identity = Finix::Identity.retrieve(:id => "MUg7uTYUGBr2osoonJMECCz4")

merchant = identity.provision_merchant

Example Response:

{
  "id" : "MUg7uTYUGBr2osoonJMECCz4",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "verification" : "VIb4fFJ3GNzQoYsy4Qp1qR1f",
  "merchant_profile" : "MPkY4BpDY7XX8Pj9sGD4nAMb",
  "processor" : "DUMMY_V1",
  "processing_enabled" : true,
  "settlement_enabled" : true,
  "gross_settlement_enabled" : false,
  "creating_transfer_from_report_enabled" : false,
  "card_expiration_date_required" : true,
  "card_cvv_required" : false,
  "tags" : {
    "key_2" : "value_2"
  },
  "mcc" : "0742",
  "mid" : "FNXrP15xhqWvUNeVJF4uSHj3h",
  "merchant_name" : "Pawny City Hall",
  "settlement_funding_identifier" : "UNSET",
  "ready_to_settle_upon" : "RECONCILIATION",
  "fee_ready_to_settle_upon" : "RECONCILIATION",
  "created_at" : "2021-06-19T00:49:08.24Z",
  "updated_at" : "2021-06-19T00:49:08.46Z",
  "onboarding_state" : "APPROVED",
  "processor_details" : {
    "mid" : "FNXrP15xhqWvUNeVJF4uSHj3h",
    "api_key" : "secretValue"
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4"
    },
    "identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4/verifications"
    },
    "merchant_profile" : {
      "href" : "https://flex.sandbox-payments-api.com/merchant_profiles/MPkY4BpDY7XX8Pj9sGD4nAMb"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "verification" : {
      "href" : "https://flex.sandbox-payments-api.com/verifications/VIb4fFJ3GNzQoYsy4Qp1qR1f"
    }
  }
}

Provision a Merchant for a previously created Identity resource to begin transacting on their behalf.

Merchant resources can have 3 potential onboarding_states:

  1. PROVISIONING: Request is pending (state will typically change after two minutes)

    • processing_enabled: False
    • settlement_enabled: False
  2. APPROVED: Merchant has been approved and can begin processing

    • processing_enabled: True
    • settlement_enabled: True
  3. REJECTED: Merchant was rejected by the processor either because the information collected was invalid or it failed one of a number of regulatory and/or compliance checks (e.g. KYC, OFAC or MATCH)

    • processing_enabled: False
    • settlement_enabled: False

HTTP Request

POST https://flex.sandbox-payments-api.com/identities/:IDENTITY_ID/merchants

URL Parameters

Parameter Description
:IDENTITY_ID ID of the Identity

Request Arguments

Field Type Description
processor string, required Name of the processor that you’re onboarding the Merchant with (a user can pass either null or DUMMY_V1 for sandbox)

Fetch a Merchant

curl https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4 \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7

import io.finix.payments.ApiClient;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.views.Merchant;

Maybe<Merchant> response = api.merchants
    .id(merchant.id)
    .get();

if(! response.succeeded()){
    System.out.println(response.error());
    System.out.println(response.error().getDetails());
    throw new RuntimeException("API error attempting to fetch Merchant");
}

Merchant merchantView = response.view();

<?php
use Finix\Resources\Merchant;

$merchant = Merchant::retrieve('MUg7uTYUGBr2osoonJMECCz4');



from finix.resources import Merchant
merchant = Merchant.get(id="MUg7uTYUGBr2osoonJMECCz4")

merchant = Finix::Merchant.retrieve(:id => "MUg7uTYUGBr2osoonJMECCz4")

Example Response:

{
  "id" : "MUg7uTYUGBr2osoonJMECCz4",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "verification" : "VIb4fFJ3GNzQoYsy4Qp1qR1f",
  "merchant_profile" : "MPkY4BpDY7XX8Pj9sGD4nAMb",
  "processor" : "DUMMY_V1",
  "processing_enabled" : true,
  "settlement_enabled" : true,
  "gross_settlement_enabled" : false,
  "creating_transfer_from_report_enabled" : false,
  "card_expiration_date_required" : true,
  "card_cvv_required" : false,
  "tags" : {
    "key_2" : "value_2"
  },
  "mcc" : "0742",
  "mid" : "FNXrP15xhqWvUNeVJF4uSHj3h",
  "merchant_name" : "Pawny City Hall",
  "settlement_funding_identifier" : "UNSET",
  "ready_to_settle_upon" : "RECONCILIATION",
  "fee_ready_to_settle_upon" : "RECONCILIATION",
  "created_at" : "2021-06-19T00:49:08.24Z",
  "updated_at" : "2021-06-19T00:49:08.46Z",
  "onboarding_state" : "APPROVED",
  "processor_details" : {
    "mid" : "FNXrP15xhqWvUNeVJF4uSHj3h",
    "api_key" : "secretValue"
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4"
    },
    "identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4/verifications"
    },
    "merchant_profile" : {
      "href" : "https://flex.sandbox-payments-api.com/merchant_profiles/MPkY4BpDY7XX8Pj9sGD4nAMb"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "verification" : {
      "href" : "https://flex.sandbox-payments-api.com/verifications/VIb4fFJ3GNzQoYsy4Qp1qR1f"
    }
  }
}

HTTP Request

GET https://flex.sandbox-payments-api.com/merchants/:MERCHANT_ID

URL Parameters

Parameter Description
:MERCHANT_ID ID of the Merchant

Reattempt Merchant Provisioning

curl https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4/verifications \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '{}'
Merchant merchant = client.merchantsClient().fetch("MUg7uTYUGBr2osoonJMECCz4");
Verification verification = merchant.verify(
  Verification.builder().build()
);
<?php
use Finix\Resources\Merchant;
use Finix\Resources\Verification;

$merchant = Merchant::retrieve('MUg7uTYUGBr2osoonJMECCz4');
$verification = new Verification();
$verification = $merchant->verifyOn($verification);


from finix.resources import Merchant
from finix.resources import Verification

merchant = Merchant.get(id="MUg7uTYUGBr2osoonJMECCz4")

verification = merchant.verify_on(Verification())

merchant = Finix::Merchant.retrieve(:id => "MUg7uTYUGBr2osoonJMECCz4")

verification = merchant.verify

Example Response:

{
  "id" : "VI4LCEkuxkTPRPEihzCiKmP8",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "tags" : { },
  "messages" : [ ],
  "raw" : null,
  "processor" : "DUMMY_V1",
  "state" : "PENDING",
  "created_at" : "2021-06-19T00:50:08.11Z",
  "updated_at" : "2021-06-19T00:50:08.14Z",
  "trace_id" : "87b51fab-22c6-44b6-a172-baa378632563",
  "payment_instrument" : null,
  "merchant" : "MUg7uTYUGBr2osoonJMECCz4",
  "identity" : null,
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/verifications/VI4LCEkuxkTPRPEihzCiKmP8"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "merchant" : {
      "href" : "https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4"
    }
  }
}

Re-attempt provisioning a Merchant account on a processor if the previous attempt returned a FAILED onboarding_state.

HTTP Request

POST https://flex.sandbox-payments-api.com/merchants/:MERCHANT_ID/verifications

URL Parameters

Parameter Description
:MERCHANT_ID ID of the Merchant

Update Info on Processor

curl https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4/verifications \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '{}'


<?php
use Finix\Resources\Merchant;
use Finix\Resources\Verification;

$merchant = Merchant::retrieve('MUg7uTYUGBr2osoonJMECCz4');
$verification = new Verification();
$verification = $merchant->verifyOn($verification);


from finix.resources import Merchant
merchant = Merchant.get(id="MUg7uTYUGBr2osoonJMECCz4")

merchant.entity["first_name"] = "Michael"
merchant.save()

merchant = Finix::Merchant.retrieve(:id => "MUg7uTYUGBr2osoonJMECCz4")

verification = merchant.entity["default_statement_descriptor"] = "Prestige World Wide"

Example Response:

{
  "id" : "VI4LCEkuxkTPRPEihzCiKmP8",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "tags" : { },
  "messages" : [ ],
  "raw" : null,
  "processor" : "DUMMY_V1",
  "state" : "PENDING",
  "created_at" : "2021-06-19T00:50:08.11Z",
  "updated_at" : "2021-06-19T00:50:08.14Z",
  "trace_id" : "87b51fab-22c6-44b6-a172-baa378632563",
  "payment_instrument" : null,
  "merchant" : "MUg7uTYUGBr2osoonJMECCz4",
  "identity" : null,
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/verifications/VI4LCEkuxkTPRPEihzCiKmP8"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "merchant" : {
      "href" : "https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4"
    }
  }
}

Update Identity information (e.g. default_statement_descriptor, KYC info, etc.) on the underlying processor.

HTTP Request

POST https://flex.sandbox-payments-api.com/merchants/:MERCHANT_ID/verifications

URL Parameters

Parameter Description
:MERCHANT_ID ID of the Merchant

List all Merchants

curl https://flex.sandbox-payments-api.com/merchants/ \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7

import io.finix.payments.ApiClient;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.lib.Page;
import io.finix.payments.views.Merchant;

Maybe<Page<Merchant>> response = api.merchants.get();

if (! response.succeeded()) {
  ApiError error = response.error();
  System.out.println(error.getCode());
  System.out.println(error.getMessage());
  System.out.println(error.getDetails());
  throw new RuntimeException("API error attempting to list all Merchants");
}

Page<Merchant> page = response.view();

<?php
use Finix\Resources\Merchant;

$merchants = Merchant::getPagination("/merchants");




from finix.resources import Merchant
merchant = Merchant.get()

merchants = Finix::Merchant.retrieve

Example Response:

{
  "_embedded" : {
    "merchants" : [ {
      "id" : "MU8Ftnfas6dhJobLwGC7e8mp",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "identity" : "IDi32Qn43FtNMRNkS7mLwsoq",
      "verification" : "VIfjkDaDC6MEKLWYc7SWNzX2",
      "merchant_profile" : "MPaQopm2Bu3BjE2UoNjU3UYJ",
      "processor" : "DUMMY_V1",
      "processing_enabled" : true,
      "settlement_enabled" : true,
      "gross_settlement_enabled" : false,
      "creating_transfer_from_report_enabled" : false,
      "card_expiration_date_required" : true,
      "card_cvv_required" : false,
      "tags" : {
        "key_2" : "value_2"
      },
      "mcc" : "0742",
      "mid" : "FNX6F9RFCtwRhgYDFNCw3MUBE",
      "merchant_name" : "Petes Coffee",
      "settlement_funding_identifier" : "UNSET",
      "ready_to_settle_upon" : "SUCCESSFUL_CAPTURE",
      "fee_ready_to_settle_upon" : "RECONCILIATION",
      "created_at" : "2021-06-19T00:49:32.37Z",
      "updated_at" : "2021-06-19T00:49:33.83Z",
      "onboarding_state" : "APPROVED",
      "processor_details" : {
        "mid" : "FNX6F9RFCtwRhgYDFNCw3MUBE",
        "api_key" : "secretValue"
      },
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/merchants/MU8Ftnfas6dhJobLwGC7e8mp"
        },
        "identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/merchants/MU8Ftnfas6dhJobLwGC7e8mp/verifications"
        },
        "merchant_profile" : {
          "href" : "https://flex.sandbox-payments-api.com/merchant_profiles/MPaQopm2Bu3BjE2UoNjU3UYJ"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "verification" : {
          "href" : "https://flex.sandbox-payments-api.com/verifications/VIfjkDaDC6MEKLWYc7SWNzX2"
        }
      }
    }, {
      "id" : "MUg7uTYUGBr2osoonJMECCz4",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "identity" : "ID9Kou1FsvdJFYEjypVGHee9",
      "verification" : "VIb4fFJ3GNzQoYsy4Qp1qR1f",
      "merchant_profile" : "MPkY4BpDY7XX8Pj9sGD4nAMb",
      "processor" : "DUMMY_V1",
      "processing_enabled" : true,
      "settlement_enabled" : true,
      "gross_settlement_enabled" : false,
      "creating_transfer_from_report_enabled" : false,
      "card_expiration_date_required" : true,
      "card_cvv_required" : false,
      "tags" : {
        "key_2" : "value_2"
      },
      "mcc" : "0742",
      "mid" : "FNXrP15xhqWvUNeVJF4uSHj3h",
      "merchant_name" : "Pawny City Hall",
      "settlement_funding_identifier" : "UNSET",
      "ready_to_settle_upon" : "RECONCILIATION",
      "fee_ready_to_settle_upon" : "RECONCILIATION",
      "created_at" : "2021-06-19T00:49:08.24Z",
      "updated_at" : "2021-06-19T00:49:08.46Z",
      "onboarding_state" : "APPROVED",
      "processor_details" : {
        "mid" : "FNXrP15xhqWvUNeVJF4uSHj3h",
        "api_key" : "secretValue"
      },
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4"
        },
        "identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4/verifications"
        },
        "merchant_profile" : {
          "href" : "https://flex.sandbox-payments-api.com/merchant_profiles/MPkY4BpDY7XX8Pj9sGD4nAMb"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "verification" : {
          "href" : "https://flex.sandbox-payments-api.com/verifications/VIb4fFJ3GNzQoYsy4Qp1qR1f"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/merchants?offset=0&limit=20&sort=created_at,desc&sort=id,desc"
    }
  },
  "page" : {
    "offset" : 0,
    "limit" : 20,
    "count" : 2
  }
}

HTTP Request

GET https://flex.sandbox-payments-api.com/merchants/

List Merchant Verifications

curl https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4/verifications \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7


<?php
use Finix\Resources\Merchant;
use Finix\Resources\Verification;

$merchant = Merchant::retrieve('MUg7uTYUGBr2osoonJMECCz4');
$verifications = Verification::getPagination($merchant->getHref("verifications"));




from finix.resources import Merchant
merchant = Merchant.get(id="MUg7uTYUGBr2osoonJMECCz4")
verifications = merchant.verifications

merchant = Finix::Merchant.retrieve(:id => "MUg7uTYUGBr2osoonJMECCz4")
verifications = merchant.verifications

Example Response:

{
  "_embedded" : {
    "verifications" : [ {
      "id" : "VIb4fFJ3GNzQoYsy4Qp1qR1f",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "tags" : {
        "key_2" : "value_2"
      },
      "messages" : [ ],
      "raw" : "RawDummyMerchantUnderwriteResult",
      "processor" : "DUMMY_V1",
      "state" : "SUCCEEDED",
      "created_at" : "2021-06-19T00:49:08.26Z",
      "updated_at" : "2021-06-19T00:49:08.46Z",
      "trace_id" : "71b176fe-2059-4bb6-99a3-0b438c9418e8",
      "payment_instrument" : null,
      "merchant" : "MUg7uTYUGBr2osoonJMECCz4",
      "identity" : null,
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/verifications/VIb4fFJ3GNzQoYsy4Qp1qR1f"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "merchant" : {
          "href" : "https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/merchants/MUg7uTYUGBr2osoonJMECCz4/verifications?offset=0&limit=20&sort=created_at,desc&sort=id,desc"
    }
  },
  "page" : {
    "offset" : 0,
    "limit" : 20,
    "count" : 1
  }
}

Retrieve all attempts to onboard (i.e. provision) a merchant onto a processor.

HTTP Request

GET https://flex.sandbox-payments-api.com/merchants/:MERCHANT_ID/verifications

URL Parameters

Parameter Description
:MERCHANT_ID ID of the Merchant

Payment Instruments

A Payment Instrument resource represents either a credit card or bank account. A Payment Instrument may be tokenized multiple times and each tokenization produces a unique ID. Each ID may only be associated one time and to only one Identity. Once associated, a Payment Instrument may not be disassociated from an Identity.

Create a Payment Card



curl https://flex.sandbox-payments-api.com/payment_instruments \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
    {
        "name": "Sean Le",
        "expiration_year": 2029,
        "tags": {
            "card_name": "Business Card"
        },
        "number": "4895142232120006",
        "expiration_month": 3,
        "address": {
            "city": "San Francisco",
            "region": "CA",
            "postal_code": "94404",
            "line1": "900 Metro Center Blv",
            "country": "USA"
        },
        "security_code": "022",
        "type": "PAYMENT_CARD",
        "identity": "IDcPyNBigCcFETtgAwSVBa8p"
    }'


import io.finix.payments.forms.*;
import io.finix.payments.views.*;
import io.finix.payments.forms.Address;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import com.google.common.collect.ImmutableMap;

PaymentCardForm form = PaymentCardForm.builder()
        .name("Joe Doe")
        .number("4957030420210454")
        .securityCode("112")
        .expirationYear(2020)
        .identity("ID9Kou1FsvdJFYEjypVGHee9")
        .expirationMonth(12)
        .address(
                Address.builder()
                        .city("San Mateo")
                        .country("USA")
                        .region("CA")
                        .line1("123 Fake St")
                        .line2("#7")
                        .postalCode("90210")
                        .build()
        )
        .tags(ImmutableMap.of("card_name", "Business Card"))
        .build();

Maybe<PaymentCard> response = api.instruments.post(form);
        if (! response.succeeded()) {
            ApiError error = response .error();
            System.out.println(error.getCode());
            throw new RuntimeException("API error attempting to create Payment Card");
        }
PaymentCard card = response.view();

<?php
use Finix\Resources\PaymentCard;
use Finix\Resources\Identity;

$identity = Identity::retrieve('ID9Kou1FsvdJFYEjypVGHee9');
$card = new PaymentCard(
    array(
        "name"=> "Sean Le",
        "expiration_year"=> 2029,
        "tags"=> array(
            "card_name"=> "Business Card"
        ),
        "number"=> "4895142232120006",
        "expiration_month"=> 3,
        "address"=> array(
            "city"=> "San Francisco",
            "region"=> "CA",
            "postal_code"=> "94404",
            "line1"=> "900 Metro Center Blv",
            "country"=> "USA"
        ),
        "security_code"=> "022",
        "type"=> "PAYMENT_CARD",
        "identity"=> "IDcPyNBigCcFETtgAwSVBa8p"
    ));
$card = $identity->createPaymentCard($card);



from finix.resources import PaymentCard

card = PaymentCard(**
    {
        "name": "Sean Le",
        "expiration_year": 2029,
        "tags": {
            "card_name": "Business Card"
        },
        "number": "4895142232120006",
        "expiration_month": 3,
        "address": {
            "city": "San Francisco",
            "region": "CA",
            "postal_code": "94404",
            "line1": "900 Metro Center Blv",
            "country": "USA"
        },
        "security_code": "022",
        "type": "PAYMENT_CARD",
        "identity": "IDcPyNBigCcFETtgAwSVBa8p"
    }).save()
card = Finix::PaymentCard.new(
    {
        "name"=> "Sean Le",
        "expiration_year"=> 2029,
        "tags"=> {
            "card_name"=> "Business Card"
        },
        "number"=> "4895142232120006",
        "expiration_month"=> 3,
        "address"=> {
            "city"=> "San Francisco",
            "region"=> "CA",
            "postal_code"=> "94404",
            "line1"=> "900 Metro Center Blv",
            "country"=> "USA"
        },
        "security_code"=> "022",
        "type"=> "PAYMENT_CARD",
        "identity"=> "IDcPyNBigCcFETtgAwSVBa8p"
    }).save

Example Response:

{
  "id" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "fingerprint" : "FPRogKWsRQks2HGaau5eGR9AF",
  "tags" : {
    "card_name" : "Business Card"
  },
  "expiration_month" : 3,
  "expiration_year" : 2029,
  "bin" : "489514",
  "last_four" : "0006",
  "brand" : "VISA",
  "card_type" : "UNKNOWN",
  "name" : "Sean Le",
  "address" : {
    "line1" : "900 Metro Center Blv",
    "line2" : null,
    "city" : "San Francisco",
    "region" : "CA",
    "postal_code" : "94404",
    "country" : "USA"
  },
  "address_verification" : "UNKNOWN",
  "security_code_verification" : "UNKNOWN",
  "created_at" : "2021-06-19T00:49:29.94Z",
  "updated_at" : "2021-06-19T00:49:29.94Z",
  "instrument_type" : "PAYMENT_CARD",
  "type" : "PAYMENT_CARD",
  "currency" : "USD",
  "identity" : "IDcPyNBigCcFETtgAwSVBa8p",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2"
    },
    "authorizations" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2/authorizations"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2/transfers"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2/verifications"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p"
    },
    "updates" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2/updates"
    }
  }
}

Please review our guide on how to tokenize cards via the tokenization with hosted fields form

HTTP Request

POST https://flex.sandbox-payments-api.com/payment_instruments

Request Arguments

Field Type Description
identity string, required ID of the Identity that the card should be associated
type string, required Type of Payment Instrument (for cards input PAYMENT_CARD)
number string, required Primary account number (no dashes in between numbers)
security_code string, optional The 3-4 digit security code for the card (i.e. CVV code)
expiration_month integer, required Expiration month (e.g. 12 for December)
expiration_year integer, required 4-digit expiration year
name string, optional Full name of the registered card holder
address object, optional Billing address (Full description of child attributes below)

Address-object Request Arguments

Field Type Description
line1 string, optional First line of the address (max 35 characters)
line2 string, optional Second line of the address (max 35 characters)
city string, optional City (max 20 characters)
region string, optional 2-letter State code
postal_code string, optional Zip or Postal code (max 7 characters)
country string, optional 3-Letter Country code

Create a Bank Account


curl https://flex.sandbox-payments-api.com/payment_instruments \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
    {
        "account_type": "SAVINGS",
        "name": "Alice",
        "tags": {
            "Bank Account": "Company Account"
        },
        "country": "USA",
        "bank_code": "123123123",
        "account_number": "123123123",
        "type": "BANK_ACCOUNT",
        "identity": "ID9Kou1FsvdJFYEjypVGHee9"
    }'


import io.finix.payments.ApiClient;
import io.finix.payments.enums.BankAccountType;
import io.finix.payments.forms.BankAccountForm;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.views.BankAccount;
import io.finix.payments.views.Identity;
import java.util.Currency;

BankAccountForm form = BankAccountForm.builder()
        .name("Joe Doe")
        .identity("ID9Kou1FsvdJFYEjypVGHee9")
        .accountNumber("84012312415")
        .bankCode("840123124")
        .accountType(BankAccountType.SAVINGS)
        .companyName("company name")
        .country("USA")
        .currency(Currency.getInstance("USD"))
        .build();

Maybe<BankAccount> request = api.instruments.post(form);

if (! request.succeeded()) {
    ApiError error = request.error();
    System.out.println(error);
    throw new RuntimeException("API error attempting to create bank account");
}
BankAccount bankAccount = request.view();

<?php
use Finix\Resources\Identity;
use Finix\Resources\BankAccount;

$identity = Identity::retrieve('ID9Kou1FsvdJFYEjypVGHee9');
$bank_account = new BankAccount(
    array(
        "account_type"=> "SAVINGS",
        "name"=> "Alice",
        "tags"=> array(
            "Bank Account"=> "Company Account"
        ),
        "country"=> "USA",
        "bank_code"=> "123123123",
        "account_number"=> "123123123",
        "type"=> "BANK_ACCOUNT",
        "identity"=> "ID9Kou1FsvdJFYEjypVGHee9"
    ));
$bank_account = $identity->createBankAccount($bank_account);


from finix.resources import BankAccount

bank_account = BankAccount(**
    {
        "account_type": "SAVINGS",
        "name": "Alice",
        "tags": {
            "Bank Account": "Company Account"
        },
        "country": "USA",
        "bank_code": "123123123",
        "account_number": "123123123",
        "type": "BANK_ACCOUNT",
        "identity": "ID9Kou1FsvdJFYEjypVGHee9"
    }).save()
bank_account = Finix::BankAccount.new(
    {
        "account_type"=> "SAVINGS",
        "name"=> "Alice",
        "tags"=> {
            "Bank Account"=> "Company Account"
        },
        "country"=> "USA",
        "bank_code"=> "123123123",
        "account_number"=> "123123123",
        "type"=> "BANK_ACCOUNT",
        "identity"=> "ID9Kou1FsvdJFYEjypVGHee9"
    }).save

Example Response:

{
  "id" : "PIqJjh3X4mo9qHEWvmjWSrho",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "fingerprint" : "FPRd5moHxL3Ltuvk4cczxetCg",
  "tags" : {
    "Bank Account" : "Company Account"
  },
  "bank_code" : "123123123",
  "country" : "USA",
  "masked_account_number" : "XXXXX3123",
  "name" : "Alice",
  "account_type" : "SAVINGS",
  "created_at" : "2021-06-19T00:49:06.83Z",
  "updated_at" : "2021-06-19T00:49:06.83Z",
  "instrument_type" : "BANK_ACCOUNT",
  "type" : "BANK_ACCOUNT",
  "currency" : "USD",
  "identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho"
    },
    "authorizations" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho/authorizations"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho/transfers"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho/verifications"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    }
  }
}

HTTP Request

POST https://flex.sandbox-payments-api.com/payment_instruments

Request Arguments

Field Type Description
account_number string, required Bank account number
bank_code string, required Bank routing number
type string, required Type of Payment Instrument (for bank accounts use BANK_ACCOUNT)
identity string, required ID for the Identity resource which the account is associated
account_type string, required Either CHECKING or SAVINGS
name string, required Account owner’s full name (max 40 characters)

Associate a Token

curl https://flex.sandbox-payments-api.com/payment_instruments \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
    {
        "token": "TK3Wr9zRent6zME2PUrgDcHB",
        "type": "TOKEN",
        "identity": "ID9Kou1FsvdJFYEjypVGHee9"
    }'


import io.finix.payments.forms.*;
import io.finix.payments.views.*;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;

TokenAssociationForm tokenForm =  TokenAssociationForm.builder()
    .token("TK3Wr9zRent6zME2PUrgDcHB")
    .identity("ID9Kou1FsvdJFYEjypVGHee9")
    .build();

Maybe<PaymentCard> cardResponse = api.instruments.post(tokenForm);
if (! cardResponse.succeeded()) {
    ApiError error = cardResponse.error();
    System.out.println(error.getCode());
    throw new RuntimeException("API error attempting to create Payment Card");
}
PaymentCard paymentCard = cardResponse.view();

<?php
use Finix\Resources\PaymentInstrument;

$card = new PaymentInstrument(
    array(
        "token"=> "TK3Wr9zRent6zME2PUrgDcHB",
        "type"=> "TOKEN",
        "identity"=> "ID9Kou1FsvdJFYEjypVGHee9"
    ));
$card = $card->save();



from finix.resources import PaymentInstrument

payment_instrument = PaymentInstrument(**
    {
        "token": "TK3Wr9zRent6zME2PUrgDcHB",
        "type": "TOKEN",
        "identity": "ID9Kou1FsvdJFYEjypVGHee9"
    }).save()
card = Finix::PaymentInstrument.new(
    {
        "token"=> "TK3Wr9zRent6zME2PUrgDcHB",
        "type"=> "TOKEN",
        "identity"=> "ID9Kou1FsvdJFYEjypVGHee9"
    }).save

Example Response:

{
  "id" : "PIsWLg3t26jv6tTuTr3AxJWo",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "fingerprint" : "FPRw9NoorETQgCjFgwKPvcGsV",
  "tags" : { },
  "expiration_month" : 12,
  "expiration_year" : 2029,
  "bin" : "495703",
  "last_four" : "0454",
  "brand" : "VISA",
  "card_type" : "UNKNOWN",
  "name" : null,
  "address" : {
    "line1" : "741 Douglass St",
    "line2" : "Apartment 7",
    "city" : "San Mateo",
    "region" : "CA",
    "postal_code" : "94114",
    "country" : "USA"
  },
  "address_verification" : "UNKNOWN",
  "security_code_verification" : "UNKNOWN",
  "created_at" : "2021-06-19T00:49:46.07Z",
  "updated_at" : "2021-06-19T00:49:46.07Z",
  "instrument_type" : "PAYMENT_CARD",
  "type" : "PAYMENT_CARD",
  "currency" : "USD",
  "identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo"
    },
    "authorizations" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo/authorizations"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo/transfers"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo/verifications"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    },
    "updates" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo/updates"
    }
  }
}

Associate the newly tokenized card or bank with the instrument owner’s Identity.

HTTP Request

POST https://flex.sandbox-payments-api.com/payment_instruments

Request Arguments

Field Type Description
token string, required ID for the Token that was returned via the tokenization client or hosted iframe
type string, required Must pass TOKEN as the value
identity string, required ID for the Identity resource which the account is to be associated

Fetch a Bank Account

curl https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \

import io.finix.payments.ApiClient;
import io.finix.payments.views.Instrument;
import io.finix.payments.interfaces.Maybe;

Maybe<Instrument> response = api.paymentInstruments
    .id("PIqJjh3X4mo9qHEWvmjWSrho")
    .get();

if(! response.succeeded()){
    System.out.println(response.error());
    System.out.println(response.error().getDetails());
    throw new RuntimeException("API error attempting to fetch Bank Account");
}

Instrument bankAccountView = response.view();

<?php
use Finix\Resources\PaymentInstrument;

$bank_account = PaymentInstrument::retrieve('PIqJjh3X4mo9qHEWvmjWSrho');



from finix.resources import PaymentInstrument
bank_account = PaymentInstrument.get(id="PIqJjh3X4mo9qHEWvmjWSrho")

bank_account = Finix::BankAccount.retrieve(:id=> "PIqJjh3X4mo9qHEWvmjWSrho")

Example Response:

{
  "id" : "PIqJjh3X4mo9qHEWvmjWSrho",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "fingerprint" : "FPRd5moHxL3Ltuvk4cczxetCg",
  "tags" : {
    "Display Name" : "Updated Field"
  },
  "bank_code" : "123123123",
  "country" : "USA",
  "masked_account_number" : "XXXXX3123",
  "name" : "Alice",
  "account_type" : "SAVINGS",
  "created_at" : "2021-06-19T00:49:06.83Z",
  "updated_at" : "2021-06-19T00:49:09.11Z",
  "instrument_type" : "BANK_ACCOUNT",
  "type" : "BANK_ACCOUNT",
  "currency" : "USD",
  "identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho"
    },
    "authorizations" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho/authorizations"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho/transfers"
    },
    "verifications" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho/verifications"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    }
  }
}

Fetch a previously created Payment Instrument that is of type BANK_ACCOUNT

HTTP Request

GET https://flex.sandbox-payments-api.com/payment_instruments/:PAYMENT_INSTRUMENT_ID

URL Parameters

Parameter Description
:PAYMENT_INSTRUMENT_ID ID of the Payment Instrument

List all Payment Instruments

curl https://flex.sandbox-payments-api.com/payment_instruments \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7
import io.finix.payments.ApiClient;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.lib.Page;
import io.finix.payments.views.Instrument;

Maybe<Page<Instrument>> response = api.instruments.get();

if (! response.succeeded()) {
    ApiError error = response.error();
    System.out.println(error.getCode());
    System.out.println(error.getMessage());
    System.out.println(error.getDetails());
    throw new RuntimeException("API error attempting to list all Payment Instruments");
}

Page<Instrument> page = response.view();

<?php
use Finix\Resources\PaymentInstrument;

$paymentinstruments = PaymentInstrument::getPagination("/payment_instruments");




from finix.resources import PaymentInstrument
payment_instruments = PaymentInstrument.get()

payment_instruments = Finix::PaymentInstrument.retrieve

Example Response:

{
  "_embedded" : {
    "payment_instruments" : [ {
      "id" : "PIsWLg3t26jv6tTuTr3AxJWo",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "fingerprint" : "FPRw9NoorETQgCjFgwKPvcGsV",
      "tags" : { },
      "expiration_month" : 12,
      "expiration_year" : 2029,
      "bin" : "495703",
      "last_four" : "0454",
      "brand" : "VISA",
      "card_type" : "UNKNOWN",
      "name" : null,
      "address" : {
        "line1" : "741 Douglass St",
        "line2" : "Apartment 7",
        "city" : "San Mateo",
        "region" : "CA",
        "postal_code" : "94114",
        "country" : "USA"
      },
      "address_verification" : "UNKNOWN",
      "security_code_verification" : "UNKNOWN",
      "created_at" : "2021-06-19T00:49:46.07Z",
      "updated_at" : "2021-06-19T00:49:45.84Z",
      "instrument_type" : "PAYMENT_CARD",
      "type" : "PAYMENT_CARD",
      "currency" : "USD",
      "identity" : "ID9Kou1FsvdJFYEjypVGHee9",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo/transfers"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo/verifications"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
        },
        "updates" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIsWLg3t26jv6tTuTr3AxJWo/updates"
        }
      }
    }, {
      "id" : "PI6yteeBtaaH7BdDZ2jnYi6Y",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "fingerprint" : "FPRd5moHxL3Ltuvk4cczxetCg",
      "tags" : {
        "Bank Account" : "Company Account"
      },
      "bank_code" : "123123123",
      "country" : "USA",
      "masked_account_number" : "XXXXX3123",
      "name" : "Alice",
      "account_type" : "SAVINGS",
      "created_at" : "2021-06-19T00:49:30.55Z",
      "updated_at" : "2021-06-19T00:49:30.44Z",
      "instrument_type" : "BANK_ACCOUNT",
      "type" : "BANK_ACCOUNT",
      "currency" : "USD",
      "identity" : "IDcPyNBigCcFETtgAwSVBa8p",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI6yteeBtaaH7BdDZ2jnYi6Y"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI6yteeBtaaH7BdDZ2jnYi6Y/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI6yteeBtaaH7BdDZ2jnYi6Y/transfers"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI6yteeBtaaH7BdDZ2jnYi6Y/verifications"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p"
        }
      }
    }, {
      "id" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "fingerprint" : "FPRogKWsRQks2HGaau5eGR9AF",
      "tags" : {
        "card_name" : "Business Card"
      },
      "expiration_month" : 3,
      "expiration_year" : 2029,
      "bin" : "489514",
      "last_four" : "0006",
      "brand" : "VISA",
      "card_type" : "UNKNOWN",
      "name" : "Sean Le",
      "address" : {
        "line1" : "900 Metro Center Blv",
        "line2" : null,
        "city" : "San Francisco",
        "region" : "CA",
        "postal_code" : "94404",
        "country" : "USA"
      },
      "address_verification" : "POSTAL_CODE_AND_STREET_MATCH",
      "security_code_verification" : "MATCHED",
      "created_at" : "2021-06-19T00:49:29.94Z",
      "updated_at" : "2021-06-19T00:49:42.93Z",
      "instrument_type" : "PAYMENT_CARD",
      "type" : "PAYMENT_CARD",
      "currency" : "USD",
      "identity" : "IDcPyNBigCcFETtgAwSVBa8p",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2/transfers"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2/verifications"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDcPyNBigCcFETtgAwSVBa8p"
        },
        "updates" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2/updates"
        }
      }
    }, {
      "id" : "PIhjT5FXuDg2w6K1T4Vvg4iw",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "fingerprint" : "FPRd5moHxL3Ltuvk4cczxetCg",
      "tags" : {
        "Bank Account" : "Company Account"
      },
      "bank_code" : "123123123",
      "country" : "USA",
      "masked_account_number" : "XXXXX3123",
      "name" : "Alice",
      "account_type" : "SAVINGS",
      "created_at" : "2021-06-19T00:49:25.77Z",
      "updated_at" : "2021-06-19T00:49:25.66Z",
      "instrument_type" : "BANK_ACCOUNT",
      "type" : "BANK_ACCOUNT",
      "currency" : "USD",
      "identity" : "ID4vHpdKcsL7mpqgnpKbySdu",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIhjT5FXuDg2w6K1T4Vvg4iw"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIhjT5FXuDg2w6K1T4Vvg4iw/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIhjT5FXuDg2w6K1T4Vvg4iw/transfers"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIhjT5FXuDg2w6K1T4Vvg4iw/verifications"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID4vHpdKcsL7mpqgnpKbySdu"
        }
      }
    }, {
      "id" : "PI77V1mvtSPvGbwk86xQRufk",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "fingerprint" : "FPRd5moHxL3Ltuvk4cczxetCg",
      "tags" : {
        "Bank Account" : "Company Account"
      },
      "bank_code" : "123123123",
      "country" : "USA",
      "masked_account_number" : "XXXXX3123",
      "name" : "Alice",
      "account_type" : "SAVINGS",
      "created_at" : "2021-06-19T00:49:12.15Z",
      "updated_at" : "2021-06-19T00:49:31.60Z",
      "instrument_type" : "BANK_ACCOUNT",
      "type" : "BANK_ACCOUNT",
      "currency" : "USD",
      "identity" : "IDi32Qn43FtNMRNkS7mLwsoq",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI77V1mvtSPvGbwk86xQRufk"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI77V1mvtSPvGbwk86xQRufk/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI77V1mvtSPvGbwk86xQRufk/transfers"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI77V1mvtSPvGbwk86xQRufk/verifications"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq"
        }
      }
    }, {
      "id" : "PIqJjh3X4mo9qHEWvmjWSrho",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "fingerprint" : "FPRd5moHxL3Ltuvk4cczxetCg",
      "tags" : {
        "Display Name" : "Updated Field"
      },
      "bank_code" : "123123123",
      "country" : "USA",
      "masked_account_number" : "XXXXX3123",
      "name" : "Alice",
      "account_type" : "SAVINGS",
      "created_at" : "2021-06-19T00:49:06.83Z",
      "updated_at" : "2021-06-19T00:49:09.11Z",
      "instrument_type" : "BANK_ACCOUNT",
      "type" : "BANK_ACCOUNT",
      "currency" : "USD",
      "identity" : "ID9Kou1FsvdJFYEjypVGHee9",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho/transfers"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PIqJjh3X4mo9qHEWvmjWSrho/verifications"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
        }
      }
    }, {
      "id" : "PI41kVJxci9jRWrodWLuwtPQ",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "fingerprint" : "FPRd5moHxL3Ltuvk4cczxetCg",
      "tags" : {
        "test2" : "tami4",
        "test" : "tami2",
        "testing" : "tami"
      },
      "bank_code" : "123123123",
      "country" : "USA",
      "masked_account_number" : "XXXXX3123",
      "name" : "Fran Lemke",
      "account_type" : "SAVINGS",
      "created_at" : "2021-06-19T00:48:41.41Z",
      "updated_at" : "2021-06-19T00:48:41.46Z",
      "instrument_type" : "BANK_ACCOUNT",
      "type" : "BANK_ACCOUNT",
      "currency" : "USD",
      "identity" : "ID8bW3W9DmKEgFYF4GfDJ8or",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI41kVJxci9jRWrodWLuwtPQ"
        },
        "authorizations" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI41kVJxci9jRWrodWLuwtPQ/authorizations"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI41kVJxci9jRWrodWLuwtPQ/transfers"
        },
        "verifications" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI41kVJxci9jRWrodWLuwtPQ/verifications"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID8bW3W9DmKEgFYF4GfDJ8or"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments?offset=0&limit=20&sort=created_at,desc&sort=id,desc"
    }
  },
  "page" : {
    "offset" : 0,
    "limit" : 20,
    "count" : 7
  }
}

HTTP Request

GET https://flex.sandbox-payments-api.com/payment_instruments

Settlements

A Settlement is a logical construct representing a collection (i.e. batch) of Transfers that are intended to be paid out to a specific Merchant.

In v2 of the settlement engine, the destination attribute will be deprecated from all API’s that return the settlement resource (e.g. STxxx). The destination field will be stored in settlements/:SETTLEMENT_ID/funding_transfers.

Create a Batch Settlement


curl https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9/settlements \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
    {
        "currency": "USD",
        "processor": "DUMMY_V1",
        "tags": {
            "Internal Daily Settlement ID": "21DFASJSAKAS"
        }
    }'

import io.finix.payments.ApiClient;
import io.finix.payments.forms.SettlementForm;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.views.*;
import java.util.Currency;


Settlement settlement = identity.createSettlement(
  Settlement.builder()
    .currency("USD")
    .build()
);

SettlementForm formSettlement = SettlementForm.builder()
        .currency(Currency.getInstance("USD"))
        .build();

Transfer transfer = api.transfers.id("AUaGwoi6LeNSttjXrEgPtVCn").get().view();

Maybe<Settlement> response = api.identities.id("ID9Kou1FsvdJFYEjypVGHee9").settlements.post(formSettlement);

if (! response.succeeded()) {
    throw new RuntimeException("API error attempting to create batch settlement");
}

Settlement settlementBatch = response.view();

<?php
use Finix\Resources\Identity;
use Finix\Resources\Settlement;

$identity = Identity::retrieve('ID9Kou1FsvdJFYEjypVGHee9');
$settlement = new Settlement(
    array(
        "currency"=> "USD",
        "processor"=> "DUMMY_V1",
        "tags"=> array(
            "Internal Daily Settlement ID"=> "21DFASJSAKAS"
        )
    ));
$settlement = $identity->createSettlement($settlement);



from finix.resources import Identity
from finix.resources import Settlement

identity = Identity.get(id="ID9Kou1FsvdJFYEjypVGHee9")
settlement = Settlement(**
    {
        "currency": "USD",
        "processor": "DUMMY_V1",
        "tags": {
            "Internal Daily Settlement ID": "21DFASJSAKAS"
        }
    })
identity.create_settlement(settlement)
identity = Finix::Identity.retrieve(:id=>"ID9Kou1FsvdJFYEjypVGHee9")
settlement = identity.create_settlement(
    {
        "currency"=> "USD",
        "processor"=> "DUMMY_V1",
        "tags"=> {
            "Internal Daily Settlement ID"=> "21DFASJSAKAS"
        }
    })

Example Response:

{
  "id" : "STepiPp7ttZ22SyoXTw9oeoD",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "tags" : {
    "Internal Daily Settlement ID" : "21DFASJSAKAS"
  },
  "identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "currency" : "USD",
  "merchant_id" : "MUg7uTYUGBr2osoonJMECCz4",
  "created_at" : "2021-06-19T00:51:03.91Z",
  "updated_at" : "2021-06-19T01:38:35.02Z",
  "processor" : "DUMMY_V1",
  "type" : "MERCHANT_REVENUE",
  "funds_flow" : null,
  "payment_type" : null,
  "total_amount" : -888888,
  "total_fees" : 0,
  "total_fee" : 0,
  "net_amount" : -888888,
  "destination" : null,
  "status" : "AWAITING_APPROVAL",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    },
    "funding_transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/funding_transfers"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers"
    },
    "fees" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=fee"
    },
    "reversals" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=reverse"
    },
    "credits" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=credit"
    },
    "debits" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=debit"
    },
    "disputes" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=dispute"
    }
  }
}

Each settlement is comprised of all the Transfers that have a SUCCEEDED state and that have not been previously settled out. In other words, if a merchant has a Transfer in the PENDING state it will not be included in the batch settlement. In addition, Settlements will include any refunded Transfers as a deduction. The total_amount minus the total_fee equals the net_amount (the amount in cents that will be deposited into your merchant’s bank account).

HTTP Request

POST https://flex.sandbox-payments-api.com/identities/:IDENTITY_ID/settlements

URL Parameters

Parameter Description
:IDENTITY_ID ID of the Identity for the merchant you wish to settle out

Request Arguments

Field Type Description
currency integer, required 3-letter currency code that the funds should be deposited (e.g. USD)
processor string, optional If the Application has more than one processor association, it’s required to pass the processor (e.g. DUMMY_V1)
MERCHANT_ID string, required If the Application has more than one processor association, this field is required
tags object, optional Key value pair for annotating custom meta data (e.g. order numbers)

Fetch a Batch Settlement



curl https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \

import io.finix.payments.ApiClient;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.views.Settlement;

Maybe<Settlement> response = api.settlements
  .id("STepiPp7ttZ22SyoXTw9oeoD")
  .get();

if(! response.succeeded()){
    System.out.println(response.error());
    System.out.println(response.error().getDetails());
    throw new RuntimeException("API error attempting to fetch settlement");
}

Settlement settlementView = response.view();

<?php
use Finix\Resources\Settlement;

$settlement = Settlement::retrieve('STepiPp7ttZ22SyoXTw9oeoD');



from finix.resources import Settlements
settlement = Settlement.get(id="STepiPp7ttZ22SyoXTw9oeoD")

settlement = Finix::Settlement.retrieve(:id=>"STepiPp7ttZ22SyoXTw9oeoD")

Example Response:

{
  "id" : "STepiPp7ttZ22SyoXTw9oeoD",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "tags" : {
    "Internal Daily Settlement ID" : "21DFASJSAKAS"
  },
  "identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "currency" : "USD",
  "merchant_id" : "MUg7uTYUGBr2osoonJMECCz4",
  "created_at" : "2021-06-19T00:51:03.91Z",
  "updated_at" : "2021-06-19T01:38:35.02Z",
  "processor" : "DUMMY_V1",
  "type" : "MERCHANT_REVENUE",
  "funds_flow" : null,
  "payment_type" : null,
  "total_amount" : -888888,
  "total_fees" : 0,
  "total_fee" : 0,
  "net_amount" : -888888,
  "destination" : null,
  "status" : "AWAITING_APPROVAL",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    },
    "funding_transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/funding_transfers"
    },
    "transfers" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers"
    },
    "fees" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=fee"
    },
    "reversals" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=reverse"
    },
    "credits" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=credit"
    },
    "debits" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=debit"
    },
    "disputes" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=dispute"
    }
  }
}

Fetch a previously created Settlement.

HTTP Request

GET https://flex.sandbox-payments-api.com/settlements/:SETTLEMENT_ID

URL Parameters

Parameter Description
:SETTLEMENT_ID ID of the Settlement

List all Batch Settlements

curl https://flex.sandbox-payments-api.com/settlements/ \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7

import io.finix.payments.ApiClient;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.lib.Page;
import io.finix.payments.views.Settlement;

Maybe<Page<Settlement>> request = api.settlements.get();

if (! request.succeeded()) {
    ApiError error = request.error();
    System.out.println(error.getCode());
    System.out.println(error.getMessage());
    System.out.println(error.getDetails());
    throw new RuntimeException("API error attempting to list all Settlements");
}

Page<Settlement> page = request.view();

<?php
use Finix\Resources\Settlement;

$settlements = Settlement::getPagination("/settlements");




from finix.resources import Settlement
settlements = Settlement.get()

settlements = Finix::Settlement.retrieve

Example Response:

{
  "_embedded" : {
    "settlements" : [ {
      "id" : "STepiPp7ttZ22SyoXTw9oeoD",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "tags" : {
        "Internal Daily Settlement ID" : "21DFASJSAKAS"
      },
      "identity" : "ID9Kou1FsvdJFYEjypVGHee9",
      "currency" : "USD",
      "merchant_id" : "MUg7uTYUGBr2osoonJMECCz4",
      "created_at" : "2021-06-19T00:51:03.91Z",
      "updated_at" : "2021-06-19T01:38:35.02Z",
      "processor" : "DUMMY_V1",
      "type" : "MERCHANT_REVENUE",
      "funds_flow" : null,
      "payment_type" : null,
      "total_amount" : -888888,
      "total_fees" : 0,
      "total_fee" : 0,
      "net_amount" : -888888,
      "destination" : null,
      "status" : "AWAITING_APPROVAL",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
        },
        "funding_transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/funding_transfers"
        },
        "transfers" : {
          "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers"
        },
        "fees" : {
          "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=fee"
        },
        "reversals" : {
          "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=reverse"
        },
        "credits" : {
          "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=credit"
        },
        "debits" : {
          "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=debit"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?type=dispute"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements?offset=0&limit=20&sort=created_at,desc&sort=id,desc"
    }
  },
  "page" : {
    "offset" : 0,
    "limit" : 20,
    "count" : 1
  }
}

List the Transfers of type CREDIT that result from issuing funding instructions for the Settlement.

HTTP Request

GET https://flex.sandbox-payments-api.com/settlements/:SETTLEMENT_ID/funding_transfers

URL Parameters

Parameter Description
:SETTLEMENT_ID ID of the Settlement

List Funding Transfers in a Batch Settlement

curl https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/funding_transfers \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7

Settlement settlement = client.settlementsClient().fetch("STepiPp7ttZ22SyoXTw9oeoD");
  settlement.fundingTransfersClient().<Resources<Transfer>>resourcesIterator()
    .forEachRemaining(page -> {
      Collection<Transfer> transfers = page.getContent();
      transfers.forEach(transfer ->
     // do something
      );
    });
}
<?php
use Finix\Resources\Settlement;

$settlement = Settlement::retrieve('STepiPp7ttZ22SyoXTw9oeoD');
$settlements = Settlement::getPagination($settlement->getHref("funding_transfers"));



from finix.resources import Settlements
settlement = Settlement.get(id="STepiPp7ttZ22SyoXTw9oeoD")
transfers = settlement.funding_transfers

settlement = Finix::Settlement.retrieve(:id=>"STepiPp7ttZ22SyoXTw9oeoD")
transfers = settlement.funding_transfers

Example Response:

{
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/funding_transfers?offset=0&limit=20&sort=created_at,desc&sort=id,desc"
    }
  },
  "page" : {
    "offset" : 0,
    "limit" : 20,
    "count" : 0
  }
}

List the Transfers of type CREDIT that result from issuing a Settlement.

HTTP Request

GET https://flex.sandbox-payments-api.com/settlements/:SETTLEMENT_ID/funding_transfers

URL Parameters

Parameter Description
:SETTLEMENT_ID ID of the Settlement

List Transfers in a Batch Settlement


curl https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7

Settlement settlement = client.settlementsClient().fetch("STepiPp7ttZ22SyoXTw9oeoD");
    settlement.transfersClient().<Resources<Transfer>>resourcesIterator()
      .forEachRemaining(page -> {
        Collection<Transfer> transfers = page.getContent();
        transfers.forEach(transfer ->
       // do something
        );
      });
  }



<?php
use Finix\Resources\Settlement;

$settlement = Settlement::retrieve('STepiPp7ttZ22SyoXTw9oeoD');
$settlements = Settlement::getPagination($settlement->getHref("transfers"));




settlement = Finix::Settlement.retrieve(:id=>"STepiPp7ttZ22SyoXTw9oeoD")
transfers = settlement.transfers

Example Response:

{
  "_embedded" : {
    "transfers" : [ {
      "id" : "TRo52CuWuzZ6x2jMy5PKMayU",
      "amount" : 888888,
      "tags" : { },
      "state" : "SUCCEEDED",
      "trace_id" : "2ad40d76-dfe5-4331-9bdd-07304d06ce84",
      "currency" : "USD",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "source" : null,
      "destination" : null,
      "ready_to_settle_at" : "2021-06-19T00:51:03.00Z",
      "fee" : 0,
      "statement_descriptor" : null,
      "type" : "DISPUTE",
      "messages" : [ ],
      "raw" : null,
      "created_at" : "2021-06-19T00:51:03.01Z",
      "updated_at" : "2021-06-19T00:51:02.53Z",
      "idempotency_id" : null,
      "merchant_identity" : "ID8bW3W9DmKEgFYF4GfDJ8or",
      "subtype" : "PLATFORM_CREDIT",
      "_links" : {
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRo52CuWuzZ6x2jMy5PKMayU"
        },
        "merchant_identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID8bW3W9DmKEgFYF4GfDJ8or"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRo52CuWuzZ6x2jMy5PKMayU/payment_instruments"
        },
        "disputed_transfer" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRo52CuWuzZ6x2jMy5PKMayU/disputed_transfer"
        },
        "fee_profile" : {
          "href" : "https://flex.sandbox-payments-api.com/fee_profiles/FPgm2N4rHHXxbnuyi6ecdX71"
        }
      }
    }, {
      "id" : "TRq9xANR6mSapi69M8UJi16f",
      "amount" : 888888,
      "tags" : { },
      "state" : "SUCCEEDED",
      "trace_id" : "52e78f62-826f-44ce-81c6-d39cd4ef42c3",
      "currency" : "USD",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "source" : null,
      "destination" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
      "ready_to_settle_at" : "2021-06-19T00:51:02.78Z",
      "fee" : 0,
      "statement_descriptor" : null,
      "type" : "DISPUTE",
      "messages" : [ ],
      "raw" : null,
      "created_at" : "2021-06-19T00:51:02.80Z",
      "updated_at" : "2021-06-19T00:51:02.53Z",
      "idempotency_id" : null,
      "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
      "subtype" : "MERCHANT_DEBIT",
      "_links" : {
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRq9xANR6mSapi69M8UJi16f"
        },
        "merchant_identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRq9xANR6mSapi69M8UJi16f/payment_instruments"
        },
        "disputed_transfer" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRq9xANR6mSapi69M8UJi16f/disputed_transfer"
        },
        "destination" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2"
        },
        "fee_profile" : {
          "href" : "https://flex.sandbox-payments-api.com/fee_profiles/FPjk3LcKSpfTBQZdfqtowSFm"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/settlements/STepiPp7ttZ22SyoXTw9oeoD/transfers?offset=0&limit=20&sort=created_at,desc&sort=id,desc"
    }
  },
  "page" : {
    "offset" : 0,
    "limit" : 20,
    "count" : 2
  }
}

List the batch of Transfers of type DEBIT and REFUND that comprise the net settled amount of a Settlement.

HTTP Request

GET https://flex.sandbox-payments-api.com/settlements/:SETTLEMENT_ID/transfers

URL Parameters

Parameter Description
:SETTLEMENT_ID ID of the Settlement

Transfers

A Transfer represents any flow of funds either to or from a Payment Instrument. For example, a Transfer is a credit to a bank account refund to a card.

A Transfer can have one of three types: Debit, Credit, or Reversal. Each type indicates a different funds flow. For example:

Transfers can have four possible states values: PENDING, SUCCEEDED, FAILED, or CANCELED.

By default, Transfers will be in a PENDING state and will eventually (typically within an hour) update to SUCCEEDED.

ready_to_settle_at field can have 2 possible values:

  1. null: Funds have been captured, but are not yet ready to be paid out
  2. TIMESTAMP: A UTC timestamp that specifies when the funds will be available to be payout out. Once in the past, the Transfer will be eligible for inclusion in a batch Settlement.

Create Sale

Combines both the create authorization and capture authorization API calls into one.

curl https://flex.sandbox-payments-api.com/transfers \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
    {
        "merchant": "MU8Ftnfas6dhJobLwGC7e8mp",
        "currency": "USD",
        "amount": 100,
        "source": "PI2Wu2tWFH3NnvVwHiVPPkw2",
        "tags": {
            "test": "sale"
        }
    }'

import io.finix.payments.forms.*;
import io.finix.payments.views.*;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import com.google.common.collect.ImmutableMap;
import java.util.Currency;

TransferForm form = TransferForm.builder()
        .amount(100L)
        .currency(Currency.getInstance("USD"))
        .source("PI2Wu2tWFH3NnvVwHiVPPkw2")
        .merchantIdentity("ID9Kou1FsvdJFYEjypVGHee9")
        .tags(ImmutableMap.of("order_number", "21DFASJSAKAS"))
        .build();

Maybe<Transfer> response = api.transfers.post(form);
if (! response.succeeded()) {
    ApiError error = response.error();
    System.out.println(error.getCode());
    throw new RuntimeException("API error attempting to debit Bank Account");
}
Transfer transfer = response.view();

<?php
use Finix\Resources\Transfer;

$debit = new Transfer(
    array(
        "merchant"=> "MU8Ftnfas6dhJobLwGC7e8mp",
        "currency"=> "USD",
        "amount"=> 100,
        "source"=> "PI2Wu2tWFH3NnvVwHiVPPkw2",
        "tags"=> array(
            "test"=> "sale"
        )
    ));
$debit = $debit->save();



from finix.resources import Transfer

payout = Transfer(**
    {
        "merchant": "MU8Ftnfas6dhJobLwGC7e8mp",
        "currency": "USD",
        "amount": 100,
        "source": "PI2Wu2tWFH3NnvVwHiVPPkw2",
        "tags": {
            "test": "sale"
        }
    }).save()

Finix::Transfer.new(
    array(
        "merchant"=> "MU8Ftnfas6dhJobLwGC7e8mp",
        "currency"=> "USD",
        "amount"=> 100,
        "source"=> "PI2Wu2tWFH3NnvVwHiVPPkw2",
        "tags"=> array(
            "test"=> "sale"
        )
    )).save

Example Response:

{
  "id" : "TR81WeVDoJYhdVRRhRYYjadL",
  "amount" : 100,
  "tags" : {
    "test" : "sale"
  },
  "state" : "PENDING",
  "trace_id" : "6825f422-286c-43ab-9aa1-861719557b6c",
  "currency" : "USD",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "source" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
  "destination" : null,
  "ready_to_settle_at" : null,
  "fee" : 0,
  "statement_descriptor" : "FIN*PETES COFFEE",
  "type" : "DEBIT",
  "messages" : [ ],
  "raw" : null,
  "created_at" : "2021-06-19T00:49:37.17Z",
  "updated_at" : "2021-06-19T00:49:18.03Z",
  "idempotency_id" : null,
  "merchant_identity" : "IDi32Qn43FtNMRNkS7mLwsoq",
  "subtype" : "API",
  "_links" : {
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL"
    },
    "merchant_identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq"
    },
    "payment_instruments" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL/payment_instruments"
    },
    "reversals" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL/reversals"
    },
    "fees" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL/fees"
    },
    "disputes" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL/disputes"
    },
    "source" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2"
    },
    "fee_profile" : {
      "href" : "https://flex.sandbox-payments-api.com/fee_profiles/FPrATYzpomaTRtdo2BssRoGx"
    }
  }
}

A Transfer representing a customer payment where funds are obtained from a payment card. These specific Transfers are distinguished by their type which return DEBIT.

Learn how to prevent duplicate transfers by passing an idempotency ID in the payload.

HTTP Request

POST https://flex.sandbox-payments-api.com/transfers

Request Arguments

Field Type Description
source string, required ID of the Payment Instrument that will be debited
merchant string, required Merchant ID of the merchant whom you’re charging on behalf of
amount integer, required The total amount that will be debited in cents (e.g. 100 cents to debit $1.00)
fee integer, optional The amount of the Transfer you would like to collect as your fee in cents. Defaults to zero (Must be less than or equal to the amount)
currency string, required 3-letter ISO code designating the currency of the Transfers (e.g. USD)processor
idempotency_id string, optional A randomly generated value that you want associated with the request
tags object, optional Key value pair for annotating custom meta data (e.g. order numbers)

Fetch a Transfer


curl https://flex.sandbox-payments-api.com/transfers/TR7XmtqQxzuMuc5Z1eLR13to \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7


import io.finix.payments.ApiClient;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.views.Transfer;

Maybe<Transfer> response = api.transfers
    .id("TR7XmtqQxzuMuc5Z1eLR13to")
    .get();

if(! response.succeeded()){
    System.out.println(response.error());
    System.out.println(response.error().getDetails());
    throw new RuntimeException("API error attempting to fetch Transfer");
}

Transfer transferView = response.view();

<?php
use Finix\Resources\Transfer;

$transfer = Transfer::retrieve('TR7XmtqQxzuMuc5Z1eLR13to');





from finix.resources import Transfer
transfer = Transfer.get(id="TR7XmtqQxzuMuc5Z1eLR13to")

transfer = Finix::Transfer.retrieve(:id=> "TR7XmtqQxzuMuc5Z1eLR13to")

Example Response:

{
  "id" : "TR7XmtqQxzuMuc5Z1eLR13to",
  "amount" : 460461,
  "tags" : {
    "order_number" : "21DFASJSAKAS"
  },
  "state" : "PENDING",
  "trace_id" : "9b8d12b0-9b21-4e4f-94a3-5e559131407f",
  "currency" : "USD",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "source" : "PI6yteeBtaaH7BdDZ2jnYi6Y",
  "destination" : null,
  "ready_to_settle_at" : null,
  "fee" : 46046,
  "statement_descriptor" : "FIN*PAWNY CITY HALL",
  "type" : "DEBIT",
  "messages" : [ ],
  "raw" : null,
  "created_at" : "2021-06-19T00:49:36.33Z",
  "updated_at" : "2021-06-19T00:49:36.69Z",
  "idempotency_id" : null,
  "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "subtype" : "API",
  "_links" : {
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR7XmtqQxzuMuc5Z1eLR13to"
    },
    "merchant_identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    },
    "payment_instruments" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR7XmtqQxzuMuc5Z1eLR13to/payment_instruments"
    },
    "reversals" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR7XmtqQxzuMuc5Z1eLR13to/reversals"
    },
    "fees" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR7XmtqQxzuMuc5Z1eLR13to/fees"
    },
    "disputes" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR7XmtqQxzuMuc5Z1eLR13to/disputes"
    },
    "source" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI6yteeBtaaH7BdDZ2jnYi6Y"
    },
    "fee_profile" : {
      "href" : "https://flex.sandbox-payments-api.com/fee_profiles/FPrATYzpomaTRtdo2BssRoGx"
    }
  }
}

HTTP Request

GET https://flex.sandbox-payments-api.com/transfers/:TRANSFER_ID

URL Parameters

Parameter Description
:TRANSFER_ID ID of the Transfer

Refund a Debit


curl https://flex.sandbox-payments-api.com/transfers/TR7XmtqQxzuMuc5Z1eLR13to/reversals \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d  '
                  {
                  "refund_amount" : 100
                  }
                '


import io.finix.payments.processing.client.model.Refund;

Refund refund = transfer.reverse(100L);

<?php
use Finix\Resources\Transfer;

$debit = Transfer::retrieve('TR7XmtqQxzuMuc5Z1eLR13to');
$refund = $debit->reverse(11);



from finix.resources import Transfer

transfer = Transfer.get(id="TR7XmtqQxzuMuc5Z1eLR13to")
transfer.reverse(**
                  {
                  "refund_amount" : 100
                  }
                )
transfer = Finix::Transfer.retrieve(:id=> "TR7XmtqQxzuMuc5Z1eLR13to")

refund = transfer.reverse(100)

Example Response:

{
  "id" : "TRj5byKwN3cWqHaj31n1WAcq",
  "amount" : 100,
  "tags" : { },
  "state" : "SUCCEEDED",
  "trace_id" : "7b6774b3-35ba-4260-a59b-b254196110c6",
  "currency" : "USD",
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "source" : null,
  "destination" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
  "ready_to_settle_at" : null,
  "fee" : 0,
  "statement_descriptor" : "FIN*PAWNY CITY HALL",
  "type" : "REVERSAL",
  "messages" : [ ],
  "raw" : null,
  "created_at" : "2021-06-19T00:49:40.66Z",
  "updated_at" : "2021-06-19T00:49:40.86Z",
  "idempotency_id" : null,
  "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
  "subtype" : "API",
  "_links" : {
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    },
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TRj5byKwN3cWqHaj31n1WAcq"
    },
    "parent" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TR8cuPrriC6VnbykukEXx9SF"
    },
    "destination" : {
      "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2"
    },
    "merchant_identity" : {
      "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
    },
    "payment_instruments" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers/TRj5byKwN3cWqHaj31n1WAcq/payment_instruments"
    },
    "fee_profile" : {
      "href" : "https://flex.sandbox-payments-api.com/fee_profiles/FPrATYzpomaTRtdo2BssRoGx"
    }
  }
}

A Transfer representing the refund (i.e. reversal) of a previously created Transfer (type DEBIT). The refunded amount may be any value up to the amount of the original Transfer. These specific Transfers are distinguished by their type which return REVERSAL.

A Reversal can have two subtypes indicating how they were created:

HTTP Request

POST https://flex.sandbox-payments-api.com/transfers/:TRANSFER_ID/reversals

URL Parameters

Parameter Description
:TRANSFER_ID ID of the original Transfer

Request Arguments

Field Type Description
refund_amount integer, required The amount of the refund in cents (Must be equal to or less than the amount of the original Transfer)

List all Transfers

curl https://flex.sandbox-payments-api.com/transfers \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7

import io.finix.payments.ApiClient;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.lib.Page;
import io.finix.payments.views.Transfer;

Maybe<Page<Transfer>> request = api.transfers.get();

if (! request.succeeded()) {
    ApiError error = request.error();
    System.out.println(error.getCode());
    System.out.println(error.getMessage());
    System.out.println(error.getDetails());
    throw new RuntimeException("API error attempting to list all Transfers");
}

Page<Transfer> page = request.view();

<?php
use Finix\Resources\Transfer;

$transfers = Transfer::getPagination("/transfers");




from finix.resources import Transfer
transfer = Transfer.get()

transfers = Finix::Transfer.retrieve

Example Response:

{
  "_embedded" : {
    "transfers" : [ {
      "id" : "TRcNdmVkoVntXsFsvmzPsUnS",
      "amount" : 100,
      "tags" : { },
      "state" : "SUCCEEDED",
      "trace_id" : "81dd7223-234f-4393-a2ae-73659a7d8268",
      "currency" : "USD",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "source" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
      "destination" : null,
      "ready_to_settle_at" : null,
      "fee" : 10,
      "statement_descriptor" : "FIN*PAWNY CITY HALL",
      "type" : "DEBIT",
      "messages" : [ ],
      "raw" : null,
      "created_at" : "2021-06-19T00:49:44.43Z",
      "updated_at" : "2021-06-19T00:50:02.01Z",
      "idempotency_id" : null,
      "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
      "subtype" : "API",
      "_links" : {
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRcNdmVkoVntXsFsvmzPsUnS"
        },
        "merchant_identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRcNdmVkoVntXsFsvmzPsUnS/payment_instruments"
        },
        "reversals" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRcNdmVkoVntXsFsvmzPsUnS/reversals"
        },
        "fees" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRcNdmVkoVntXsFsvmzPsUnS/fees"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRcNdmVkoVntXsFsvmzPsUnS/disputes"
        },
        "source" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2"
        },
        "fee_profile" : {
          "href" : "https://flex.sandbox-payments-api.com/fee_profiles/FPrATYzpomaTRtdo2BssRoGx"
        }
      }
    }, {
      "id" : "TRj5byKwN3cWqHaj31n1WAcq",
      "amount" : 100,
      "tags" : { },
      "state" : "SUCCEEDED",
      "trace_id" : "7b6774b3-35ba-4260-a59b-b254196110c6",
      "currency" : "USD",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "source" : null,
      "destination" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
      "ready_to_settle_at" : null,
      "fee" : 0,
      "statement_descriptor" : "FIN*PAWNY CITY HALL",
      "type" : "REVERSAL",
      "messages" : [ ],
      "raw" : null,
      "created_at" : "2021-06-19T00:49:40.66Z",
      "updated_at" : "2021-06-19T00:49:40.86Z",
      "idempotency_id" : null,
      "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
      "subtype" : "API",
      "_links" : {
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRj5byKwN3cWqHaj31n1WAcq"
        },
        "merchant_identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TRj5byKwN3cWqHaj31n1WAcq/payment_instruments"
        },
        "parent" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR8cuPrriC6VnbykukEXx9SF"
        },
        "destination" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2"
        },
        "fee_profile" : {
          "href" : "https://flex.sandbox-payments-api.com/fee_profiles/FPrATYzpomaTRtdo2BssRoGx"
        }
      }
    }, {
      "id" : "TR8cuPrriC6VnbykukEXx9SF",
      "amount" : 100,
      "tags" : {
        "order_number" : "21DFASJSAKAS"
      },
      "state" : "CANCELED",
      "trace_id" : "70e9946a-1122-4c91-9048-251d17b96255",
      "currency" : "USD",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "source" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
      "destination" : null,
      "ready_to_settle_at" : null,
      "fee" : 10,
      "statement_descriptor" : "FIN*PAWNY CITY HALL",
      "type" : "DEBIT",
      "messages" : [ ],
      "raw" : null,
      "created_at" : "2021-06-19T00:49:39.65Z",
      "updated_at" : "2021-06-19T00:49:40.65Z",
      "idempotency_id" : null,
      "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
      "subtype" : "API",
      "_links" : {
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR8cuPrriC6VnbykukEXx9SF"
        },
        "merchant_identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR8cuPrriC6VnbykukEXx9SF/payment_instruments"
        },
        "reversals" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR8cuPrriC6VnbykukEXx9SF/reversals"
        },
        "fees" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR8cuPrriC6VnbykukEXx9SF/fees"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR8cuPrriC6VnbykukEXx9SF/disputes"
        },
        "source" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2"
        },
        "fee_profile" : {
          "href" : "https://flex.sandbox-payments-api.com/fee_profiles/FPrATYzpomaTRtdo2BssRoGx"
        }
      }
    }, {
      "id" : "TR81WeVDoJYhdVRRhRYYjadL",
      "amount" : 100,
      "tags" : {
        "test" : "sale"
      },
      "state" : "SUCCEEDED",
      "trace_id" : "6825f422-286c-43ab-9aa1-861719557b6c",
      "currency" : "USD",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "source" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
      "destination" : null,
      "ready_to_settle_at" : "2021-06-19T00:50:04.10Z",
      "fee" : 0,
      "statement_descriptor" : "FIN*PETES COFFEE",
      "type" : "DEBIT",
      "messages" : [ ],
      "raw" : null,
      "created_at" : "2021-06-19T00:49:37.17Z",
      "updated_at" : "2021-06-19T00:50:04.02Z",
      "idempotency_id" : null,
      "merchant_identity" : "IDi32Qn43FtNMRNkS7mLwsoq",
      "subtype" : "API",
      "_links" : {
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL"
        },
        "merchant_identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL/payment_instruments"
        },
        "reversals" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL/reversals"
        },
        "fees" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL/fees"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR81WeVDoJYhdVRRhRYYjadL/disputes"
        },
        "source" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2"
        },
        "fee_profile" : {
          "href" : "https://flex.sandbox-payments-api.com/fee_profiles/FPrATYzpomaTRtdo2BssRoGx"
        }
      }
    }, {
      "id" : "TR7XmtqQxzuMuc5Z1eLR13to",
      "amount" : 460461,
      "tags" : {
        "order_number" : "21DFASJSAKAS"
      },
      "state" : "PENDING",
      "trace_id" : "9b8d12b0-9b21-4e4f-94a3-5e559131407f",
      "currency" : "USD",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "source" : "PI6yteeBtaaH7BdDZ2jnYi6Y",
      "destination" : null,
      "ready_to_settle_at" : null,
      "fee" : 46046,
      "statement_descriptor" : "FIN*PAWNY CITY HALL",
      "type" : "DEBIT",
      "messages" : [ ],
      "raw" : null,
      "created_at" : "2021-06-19T00:49:36.33Z",
      "updated_at" : "2021-06-19T00:49:36.69Z",
      "idempotency_id" : null,
      "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
      "subtype" : "API",
      "_links" : {
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7XmtqQxzuMuc5Z1eLR13to"
        },
        "merchant_identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7XmtqQxzuMuc5Z1eLR13to/payment_instruments"
        },
        "reversals" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7XmtqQxzuMuc5Z1eLR13to/reversals"
        },
        "fees" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7XmtqQxzuMuc5Z1eLR13to/fees"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7XmtqQxzuMuc5Z1eLR13to/disputes"
        },
        "source" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI6yteeBtaaH7BdDZ2jnYi6Y"
        },
        "fee_profile" : {
          "href" : "https://flex.sandbox-payments-api.com/fee_profiles/FPrATYzpomaTRtdo2BssRoGx"
        }
      }
    }, {
      "id" : "TR7TmMvTtSrbkXNg6VgZo9y1",
      "amount" : 856629,
      "tags" : {
        "order_number" : "21DFASJSAKAS"
      },
      "state" : "PENDING",
      "trace_id" : "67a2201c-102b-4a13-bd34-ca7658e3828d",
      "currency" : "USD",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "source" : "PI2Wu2tWFH3NnvVwHiVPPkw2",
      "destination" : null,
      "ready_to_settle_at" : null,
      "fee" : 85663,
      "statement_descriptor" : "FIN*PAWNY CITY HALL",
      "type" : "DEBIT",
      "messages" : [ ],
      "raw" : null,
      "created_at" : "2021-06-19T00:49:35.40Z",
      "updated_at" : "2021-06-19T00:49:35.86Z",
      "idempotency_id" : "813bbf52b8704766b2b3df76699d92ff",
      "merchant_identity" : "ID9Kou1FsvdJFYEjypVGHee9",
      "subtype" : "API",
      "_links" : {
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7TmMvTtSrbkXNg6VgZo9y1"
        },
        "merchant_identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/ID9Kou1FsvdJFYEjypVGHee9"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7TmMvTtSrbkXNg6VgZo9y1/payment_instruments"
        },
        "reversals" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7TmMvTtSrbkXNg6VgZo9y1/reversals"
        },
        "fees" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7TmMvTtSrbkXNg6VgZo9y1/fees"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7TmMvTtSrbkXNg6VgZo9y1/disputes"
        },
        "source" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI2Wu2tWFH3NnvVwHiVPPkw2"
        },
        "fee_profile" : {
          "href" : "https://flex.sandbox-payments-api.com/fee_profiles/FPrATYzpomaTRtdo2BssRoGx"
        }
      }
    }, {
      "id" : "TR7PxoqhYhWMDwyHzbmUJuiP",
      "amount" : 279294,
      "tags" : {
        "order_number" : "21DFASJSAKAS"
      },
      "state" : "PENDING",
      "trace_id" : "99b9c384-7083-450f-b082-676595214552",
      "currency" : "USD",
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "source" : "PI6yteeBtaaH7BdDZ2jnYi6Y",
      "destination" : null,
      "ready_to_settle_at" : null,
      "fee" : 27929,
      "statement_descriptor" : "FIN*PETES COFFEE",
      "type" : "DEBIT",
      "messages" : [ ],
      "raw" : null,
      "created_at" : "2021-06-19T00:49:34.50Z",
      "updated_at" : "2021-06-19T00:49:34.90Z",
      "idempotency_id" : null,
      "merchant_identity" : "IDi32Qn43FtNMRNkS7mLwsoq",
      "subtype" : "API",
      "_links" : {
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        },
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7PxoqhYhWMDwyHzbmUJuiP"
        },
        "merchant_identity" : {
          "href" : "https://flex.sandbox-payments-api.com/identities/IDi32Qn43FtNMRNkS7mLwsoq"
        },
        "payment_instruments" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7PxoqhYhWMDwyHzbmUJuiP/payment_instruments"
        },
        "reversals" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7PxoqhYhWMDwyHzbmUJuiP/reversals"
        },
        "fees" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7PxoqhYhWMDwyHzbmUJuiP/fees"
        },
        "disputes" : {
          "href" : "https://flex.sandbox-payments-api.com/transfers/TR7PxoqhYhWMDwyHzbmUJuiP/disputes"
        },
        "source" : {
          "href" : "https://flex.sandbox-payments-api.com/payment_instruments/PI6yteeBtaaH7BdDZ2jnYi6Y"
        },
        "fee_profile" : {
          "href" : "https://flex.sandbox-payments-api.com/fee_profiles/FPrATYzpomaTRtdo2BssRoGx"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/transfers?offset=0&limit=20&sort=created_at,desc&sort=id,desc"
    }
  },
  "page" : {
    "offset" : 0,
    "limit" : 20,
    "count" : 7
  }
}

HTTP Request

GET https://flex.sandbox-payments-api.com/transfers

Webhooks

Webhooks allow you to build or set up integrations which subscribe to certain automated notifications (i.e. events) on the Finix API. When one of those events is triggered, we’ll send a HTTP POST payload to the webhook’s configured URL. Instead of forcing you to pull info from the API, webhooks push notifications to your configured URL endpoint. Webhooks are particularly useful for updating asynchronous state changes in Transfers, Merchant account provisioning, and listening for notifications of newly created Disputes.

In v2 of the settlement engine, the destination attribute will be deprecated from the Settlement Webhook event. The destination field will be returned in the transfer (type = created; entity = transfer) Webhook event.

Create a Webhook


curl https://flex.sandbox-payments-api.com/webhooks \
    -H "Content-Type: application/vnd.json+api" \
    -u USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -d '
                    {
                    "url" : "http://requestb.in/1jb5zu11"
                    }
                '

import io.finix.payments.ApiClient;
import io.finix.payments.forms.WebhookForm;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.views.Webhook;

WebhookForm form = WebhookForm.builder()
    .url("http://requestb.in/1jb5zu11")
    .build();

Maybe<Webhook> request = api.webhooks.post(form);

if (! request.succeeded()) {
    ApiError error = request.error();
    System.out.println(error);
    throw new RuntimeException("API error attempting to create Webhook");
}
Webhook webhookView = request.view();

<?php
use Finix\Resources\Webhook;

$webhook = new Webhook(
                    array(
                    "url" => "http=>//requestb.in/1jb5zu11"
                    )
                );
$webhook = $webhook->save();



from finix.resources import Webhook
webhook = Webhook(**
                    {
                    "url" : "http://requestb.in/1jb5zu11"
                    }
                ).save()

webhook = Finix::Webhook.new(
                    {
                    "url" => "http=>//requestb.in/1jb5zu11"
                    }
                ).save

Example Response:

{
  "id" : "WH73Urvi7KmLEGaM9kQsGdcm",
  "url" : "http://requestb.in/1jb5zu11",
  "enabled" : true,
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "created_at" : "2021-06-19T00:49:20.08Z",
  "updated_at" : "2021-06-19T00:49:20.08Z",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/webhooks/WH73Urvi7KmLEGaM9kQsGdcm"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    }
  }
}

HTTP Request

POST https://flex.sandbox-payments-api.com/webhooks

Request Arguments

Field Type Description
url string, required The HTTP or HTTPS url where the callbacks will be sent via POST request (max 120 characters)

Update Webhook

curl https://flex.sandbox-payments-api.com/webhooks/WH73Urvi7KmLEGaM9kQsGdcm \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7 \
    -X PUT \
    -d '
                    {
                    "url" : "https://requestb.in/1bexhoq1"
                    }
        '


<?php





Example Response:

{
  "id" : "WH73Urvi7KmLEGaM9kQsGdcm",
  "url" : "https://requestb.in/1bexhoq1",
  "enabled" : true,
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "created_at" : "2021-06-19T00:49:20.08Z",
  "updated_at" : "2021-06-19T00:49:20.62Z",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/webhooks/WH73Urvi7KmLEGaM9kQsGdcm"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    }
  }
}

HTTP Request

PUT https://flex.sandbox-payments-api.com/webhooks/:WEBHOOK_ID

Fetch a Webhook




curl https://flex.sandbox-payments-api.com/webhooks/WH73Urvi7KmLEGaM9kQsGdcm \
    -H "Content-Type: application/vnd.json+api" \
    -u USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7


import io.finix.payments.ApiClient;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.views.Webhook;

Maybe<Webhook> response = api.webhooks
        .id("WH73Urvi7KmLEGaM9kQsGdcm")
        .get();

if(! response.succeeded()){
    System.out.println(response.error());
    System.out.println(response.error().getDetails());
    throw new RuntimeException("API error attempting to fetch Webhook");
}
Webhook webhookView = response.view();

<?php
use Finix\Resources\Webhook;

$webhook = Webhook::retrieve('WH73Urvi7KmLEGaM9kQsGdcm');





from finix.resources import Webhook
webhook = Webhook.get(id="WH73Urvi7KmLEGaM9kQsGdcm")

webhook = Finix::Webhook.retrieve(:id=> "WH73Urvi7KmLEGaM9kQsGdcm")


Example Response:

{
  "id" : "WH73Urvi7KmLEGaM9kQsGdcm",
  "url" : "https://requestb.in/1bexhoq1",
  "enabled" : true,
  "application" : "APxje5CBpRs3URkAdoq8AiYe",
  "created_at" : "2021-06-19T00:49:20.08Z",
  "updated_at" : "2021-06-19T00:49:20.62Z",
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/webhooks/WH73Urvi7KmLEGaM9kQsGdcm"
    },
    "application" : {
      "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
    }
  }
}

HTTP Request

GET https://flex.sandbox-payments-api.com/webhooks/:WEBHOOK_ID

URL Parameters

Parameter Description
:WEBHOOK_ID ID of the Webhook

List all Webhooks

curl https://flex.sandbox-payments-api.com/webhooks/ \
    -H "Content-Type: application/vnd.json+api" \
    -u  USdCBTiL4BwY9jJ6Mq12ymrW:d294d534-b1f7-473b-bc56-7f76ccb011e7

import io.finix.payments.ApiClient;
import io.finix.payments.interfaces.ApiError;
import io.finix.payments.interfaces.Maybe;
import io.finix.payments.lib.Page;
import io.finix.payments.views.Webhook;

Maybe<Page<Webhook>> response = api.webhooks.get();

if (! response.succeeded()) {
    ApiError error = response.error();
    System.out.println(error.getCode());
    System.out.println(error.getMessage());
    System.out.println(error.getDetails());
    throw new RuntimeException("API error attempting to list all Webhooks");
}

Page<Webhook> page = response.view();

<?php
use Finix\Resources\Webhook;

$webhooks = Webhook::getPagination("/webhooks");




from finix.resources import Webhook
webhooks = Webhook.get()

webhooks = Finix::Webhook.retrieve

Example Response:

{
  "_embedded" : {
    "webhooks" : [ {
      "id" : "WH73Urvi7KmLEGaM9kQsGdcm",
      "url" : "https://requestb.in/1bexhoq1",
      "enabled" : true,
      "application" : "APxje5CBpRs3URkAdoq8AiYe",
      "created_at" : "2021-06-19T00:49:20.08Z",
      "updated_at" : "2021-06-19T00:49:20.62Z",
      "_links" : {
        "self" : {
          "href" : "https://flex.sandbox-payments-api.com/webhooks/WH73Urvi7KmLEGaM9kQsGdcm"
        },
        "application" : {
          "href" : "https://flex.sandbox-payments-api.com/applications/APxje5CBpRs3URkAdoq8AiYe"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://flex.sandbox-payments-api.com/webhooks?offset=0&limit=20&sort=created_at,desc&sort=id,desc"
    }
  },
  "page" : {
    "offset" : 0,
    "limit" : 20,
    "count" : 1
  }
}

HTTP Request

GET https://flex.sandbox-payments-api.com/webhooks

Sample Payloads

<?php


Created Authorization


{
  "type" : "created",
  "entity" : "authorization",
  "occurred_at" : "2016-07-06T08:15:21.734",
  "_embedded" : {
    "authorizations" : [ {
      "amount" : 100,
      "trace_id" : "5e157d2f-1362-4ab2-86af-3f97a8f28f0d",
      "created_at" : "2016-07-06T08:15:21.63Z",
      "source" : "PIeAkgVK9TPBnmyf6CSskv5i",
      "merchant_identity" : "IDradKrsCKMYJyj3VFKimKuy",
      "tags" : {
        "order_number" : "21DFASJSAKAS"
      },
      "transfer" : null,
      "expires_at" : "2016-07-13T08:15:21.63Z",
      "updated_at" : "2016-07-06T08:15:21.65Z",
      "is_void" : false,
      "currency" : "USD",
      "id" : "AUfU8FU7RfgTmhfRagrF1RpS",
      "state" : "SUCCEEDED"
    } ]
  }
}

Created New Transfer

{
 "type" : "created",
  "entity" : "transfer",
  "occurred_at" : "2016-07-06T07:41:38.466",
  "_embedded" : {
    "transfers" : [ {
      "amount" : 100,
      "trace_id" : "e87b8ebc-177e-4e11-9cc3-6cfcfae7adc8",
      "destination" : "PIg3pCsoqrygp1gCvBNvfT3x",
      "created_at" : "2016-07-06T07:41:38.24Z",
      "source" : "PI2f1E5JVeQriDMeDpULnae3",
      "merchant_identity" : "IDoXe9ce6ztf6Pbpoq2WbeMt",
      "type" : "REVERSAL",
      "tags" : { },
      "statement_descriptor" : "PLD*POLLOS HERMANOS",
      "application" : "APdHz4LE8cNmJbbK7WW2egcg",
      "updated_at" : "2016-07-06T07:41:38.37Z",
      "currency" : "USD",
      "id" : "TRjgpj7b7xZXN18XyD7G3JER",
      "state" : "PENDING"
    } ]
  }
}

Updated Transfer

{
  "type" : "updated",
  "entity" : "transfer",
  "occurred_at" : "2016-07-06T07:08:02.342",
  "_embedded" : {
    "transfers" : [ {
      "amount" : 100,
      "trace_id" : "55ab6c90-2cfd-47ea-8f9b-c7385880617d",
      "destination" : "PIx7rQE9dzEGoccQ76D22xuZ",
      "created_at" : "2016-07-06T07:07:39.51Z",
      "source" : "PIoHzz6XzUzCqi5YqL9TVGN6",
      "merchant_identity" : "IDhxk2ESd2eFF38ewG7Eth93",
      "type" : "REVERSAL",
      "tags" : { },
      "statement_descriptor" : "PLD*PRESTIGE WORLD WI",
      "application" : "APwD1R6mEokpr84pypG4TBZv",
      "updated_at" : "2016-07-06T07:08:02.19Z",
      "currency" : "USD",
      "id" : "TR4CUpq9T8E6tBDmWMxQQ2P1",
      "state" : "SUCCEEDED"