Introduction
The Xflow API is based on REST. Our API has predictable resource-oriented URLs, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
To launch successfully with Xflow, you’ll need to integrate both systems and business processes with Xflow, plan for your launch and communicate with your stakeholders. We've written up helpful integration guides for both direct users (who are looking to accept funds for themselves) and platform users (who are looking to accept funds on behalf of other connected users). These guides provide you with tools and knowledge to help you launch your Xflow implementation.
You can also use the Xflow API in test mode. Test mode does not affect your live data or interact with the financial networks. The API key you use to authenticate the request determines whether the request is in live or test mode.
The Xflow API is also available on Postman. Feel free to fork a collection by visiting the Xflow Developers Workspace. In addition, our latest Open API spec is also available publicly on Github.
Authentication
The Xflow API uses API keys to authenticate requests. You can view and manage your API keys in the Xflow Dashboard.
Testmode secret keys have the prefix sk_test_
and livemode secret keys have the prefix sk_live_
. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password.
If you need to authenticate via bearer auth (e.g., for a cross-origin request), use -H "Authorization: Bearer sk_test_your_key"
instead of -u sk_test_your_key
.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
curl -L -X GET 'https://api.xflowpay.com/v1/receivables/receivable_f0A_1666079293438_eDQAH_000' \
-H 'Authorization: Bearer sk_your_key'
Errors
Xflow uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx
range indicate success. Codes in the 4xx range
indicate an error that failed given the information provided (e.g., a required parameter was omitted, a payment failed, etc.). Codes in the 5xx range
indicate an error with Xflow’s servers (these are rare).
You can find Xflow's error codes here.
{
"errors": [
{
"code": "parameter_invalid_empty",
"message": "You did not provide a value for account.type. Please try again with a keyed-in enum value.",
"metadata": {
"field_name": "account.type"
}
}
],
"http_status_code": 400,
"object": "error"
}
Metadata
Updateable Xflow objects including accounts, files and receivables have a metadata
parameter. You can use this parameter to attach key-value data to these objects. You can specify up to 10 keys, with key names up to 40 characters long and values up to 500 characters long.
Metadata is useful for storing additional, structured information on an object. As an example, you could store your user's full name and corresponding unique identifier from your system on an Xflow receivables object. Metadata is not used by Xflow, for example, Xflow does not use metadata to fail a payment and won't be seen by your users unless you choose to show it to them.
Do not store any sensitive information (bank account numbers, etc.) as metadata.
curl -L -X POST 'https://api.xflowpay.com/v1/receivables/receivable_f0A_1666079293438_eDQAH_000' \
-H 'Authorization: Bearer sk_your_key' \
-H 'Content-Type: application/json' \
-d '{
"amount_maximum_reconcilable": "45.00",
"description": "This is a useful description",
"metadata": {
"internal_reference": "ABC-1234"
}
}'
{
"account_id": "account_F0A_1666079163481_A7fje_000",
"amount_locked": "0.00",
"amount_maximum_reconcilable": "45.00",
"amount_reconcilable": "30.00",
"amount_settled_payouts": "19.95",
"created": 1666079293,
"currency": "USD",
"deposit_ids_amount_locked": [],
"description": "This is a useful description",
"id": "receivable_f0A_1666079293438_eDQAH_000",
"invoice": {
"amount": "50.00",
"creation_date": "2022-10-08",
"currency": "USD",
"document": "file_F0A_1666079283600_ffoLd_000",
"due_date": "2022-11-07",
"reference_number": "Invoice FY 2022-23-038"
},
"livemode": true,
"metadata": {
"internal_reference": "ABC-1234"
},
"object": "receivable",
"purpose_code": "P1006",
"purpose_code_description": "Business and management consultancy and public relations services",
"status": "activated",
"system_message": [],
"transaction_type": "services"
}
Pagination
All core API resources have support for bulk fetches via "list" API methods. For instance, you can list accounts, files and receivables. These list API methods share a common structure and support least 2 parameters: limit
and starting_after
. The objects returned as part of a list query are sorted in descending order on the created
field, unless otherwise noted.
An array containing the actual response elements, paginated by any request parameters.
A cursor for use in pagination. ending_before
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, starting with obj_bar
, your subsequent call can include ending_before=obj_bar
in order to fetch the previous page of the list.
A limit on the number of objects to be returned, between 1 and 10. If this parameter is not specified, a default value of 10 is assumed.
A cursor for use in pagination. starting_after
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, ending with obj_bar
, your subsequent call can include starting_after=obj_bar
in order to fetch the next page of the list.
An array containing the actual response elements, paginated by any request parameters.
Whether or not there are more elements available after this set. If false
, this set comprises the end of the list.
{
"data": [
{
"bank_account": {
"domestic_credit": "CITI0000004",
"domestic_debit": null,
"domestic_fast_credit": null,
"domestic_wire": null,
"global_wire": null,
"iban": null,
"last4": "9007",
"number": "9874139007"
},
"billing_details": {
"city": "Bangalore",
"country": "IN",
"line1": "MG Road",
"line2": null,
"postal_code": "560038",
"state": null
},
"category": "user_payout",
"created": 1666160723,
"currency": "INR",
"id": "address_f0A_1666160723235_fJSRH_000",
"is_reusable": false,
"linked_id": "account_F0A_1666077553446_41Hgq_000",
"linked_object": "account",
"livemode": true,
"metadata": null,
"name": "address-name-1",
"object": "address",
"status": "activated",
"type": "bank_account"
},
{...},
{...}
],
"has_next": false,
"object": "list"
}
Accounts
Account objects are fundamental to Xflow and model entities like direct users, connected users, partners and platforms. Depending on whether you are setup as a direct user or platform, you can create new accounts, retrieve existing accounts to see its properties or take action on accounts to accept funds on their behalf.
This parameter represents the state of the xflow_receive
addresses associated with this account. The valid values include deactivated
, requested
, processing
and activated
.
Details about the business and activities that the account engages in.
The seconds elapsed since Unix epoch time at which the account was created.
Has the value true
if the object exists in livemode, the value false
if the object exists in testmode or null
in the case of a direct user or a platform (a direct user is an Xflow account of type=user
which is not connected to an account of type=platform
).
A file object identifier which contains a logo for the user to customize communications with their customers.
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them.
Details of the supporting documentation for the account.
draft
Account has been created but not yet submitted for activation.
verifying
Account activation request submitted and is being verified by Xflow.
activated
Account is activated, can create live receivables and receive payouts.
deactivated
Account is deactivated, cannot create live receivables or receive payouts.
hold
Account is being held due to verification process outcome, please reach out to the Xflow Operations team.
{
"address": "deactivated",
"business_details": {
"dba": "Xflow",
"email": "ops@xflow.com",
"ids": {
"business": "U11100KA2021FTC149048",
"tax": "AFBPB8047Q",
"tax_deduction": "BLRX00710A",
"tax_gst": "29AAACX3717G777",
"tax_trade": "YYZCX3717B"
},
"legal_name": "XFLOW PAYMENTS INDIA PRIVATE LIMITED",
"physical_address": {
"city": "Bangalore",
"country": "IN",
"line1": "No. 843, 2nd Floor, 5th Main Road",
"line2": "Indira Nagar 1st Stage,",
"postal_code": "560038",
"state": "Karnataka"
},
"product_description": "Cross-border payments infrastructure company",
"type": "company",
"website": "https://xflowpay.com"
},
"created": 1666077553,
"id": "account_F0A_1666077553446_41Hgq_000",
"link": null,
"livemode": null,
"logo_id": "file_F0A_1666077980329_rsfl3_000",
"metadata": null,
"nickname": null,
"object": "account",
"parent_account_id": null,
"supporting_documentation": {
"id_document": "file_F0A_1666078140654_lQm8l_000"
},
"status": "activated",
"tos_acceptance": {
"ip": "219.65.110.90",
"time": 1666078213,
"user_agent": "grpc-node-js/1.6.7"
},
"type": "platform"
}
Details about the business and activities that the account engages in.
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them.
curl -L -X POST 'https://api.xflowpay.com/v1/accounts' \
-H 'Authorization: Bearer sk_your_key' \
-H 'Content-Type: application/json' \
-d '{
"business_details": {
"email": "Rene9@gmail.com",
"legal_name": "Macejkovic - Casper",
"physical_address": {
"city": "Bowling Green",
"country": "US",
"line1": "73427 Carmine Greens",
"postal_code": "94107",
"state": "CA"
},
"type": "company"
},
"nickname": "Jaime Howe",
"type": "partner"
}'
Retrieve an Account
curl -L -X GET 'https://api.xflowpay.com/v1/accounts/account_F0A_1666184956871_JsBZ2_000' \
-H 'Authorization: Bearer sk_your_key'
Details about the business and activities that the account engages in.
A file object identifier which contains a logo for the user to customize communications with their customers.
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them.
Details of the supporting documentation for the account.
curl -L -X POST 'https://api.xflowpay.com/v1/accounts/account_F0A_1689699873811_mK7SU_000' \
-H 'Authorization: Bearer sk_your_key' \
-H 'Content-Type: application/json' \
-d '{
"business_details": {
"email": "alternate_contact@shoedog.com"
},
"metadata": {
"internal_name": "Shoe and Sock Power"
}
}'
List all Accounts
This endpoint returns all accounts (filtered by the applied below query parameters) associated with the platform, connected user or direct user in question. Specifically, in context of a:
- Platform, this endpoint will return the platform and its connected users
- Connected user, this endpoint will return the connected user and its partners
- Direct user, this endpoint will return the direct user and its partners
This parameter represents the state of the xflow_receive
addresses associated with this account. The valid values include deactivated
, requested
, processing
and activated
.
Return results where the created
field is equal to the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is greater than the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is greater than or equal to the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is lesser than the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is lesser than or equal to the timestamp value in seconds elapsed since Unix epoch time.
A cursor for use in pagination. ending_before
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, starting with obj_bar
, your subsequent call can include ending_before=obj_bar
in order to fetch the previous page of the list.
A limit on the number of objects to be returned, between 1 and 10. If this parameter is not specified, a default value of 10 is assumed.
A cursor for use in pagination. starting_after
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, ending with obj_bar
, your subsequent call can include starting_after=obj_bar
in order to fetch the next page of the list.
draft
Account has been created but not yet submitted for activation.
verifying
Account activation request submitted and is being verified by Xflow.
activated
Account is activated, can create live receivables and receive payouts.
deactivated
Account is deactivated, cannot create live receivables or receive payouts.
hold
Account is being held due to verification process outcome, please reach out to the Xflow Operations team.
curl -L -X GET 'https://api.xflowpay.com/v1/accounts?type=partner' \
-H 'Authorization: Bearer sk_your_key'
Activate an Account
Activating an account in Xflow enables real-world (aka as livemode
within Xflow) money movement against it. There are three types of accounts in Xflow and activation for each of them is different.
1. Activate platform and direct user
Platforms and direct users can be activated only through the Xflow Dashboard.
2. Activate connected user
A connected user can be activated only by a platform over the API and the Xflow Dashboard. The activation will require the following:
- Account object of
type=user
created by the platform - Address object of
type=user_payout
created by the platform on behalf of the connected user - Person objects for a director, owner and business representative created by the platform on behalf of the connected user
In addition, please remember the following:
- For
business_details.type
=company
andlimited_liability_partnership
, a Company Identification Number (CIN) / LLP ID or Business PAN or GSTIN is required.
- GSTIN can be passed in
business_details.tax_gst
. Alternatively, the user can pass a scanned copy of the GSTIN certificate as a file identifier insupporting_documentation.id_document
. Remember to set the purpose for the file identifier totax_document
- CIN or LLP ID is passed in
business_details.ids.business
. Alternatively, the user can pass the Certificate of Incorporation as a file identifier insupporting_documentation.id_document
. Remember to set the purpose for the file identifier toadditional_verification
- Business PAN is passed in
business_details.ids.tax
. Alternatively, the user can pass a scanned copy of the Business PAN as a file identifier insupporting_documentation.id_document
. Remember to set the purpose for the file identifier toidentity_document
- For
business_details.type
=sole_proprietor
andindividual
, a GSTIN or Address is required.
- GSTIN can be passed in
business_details.tax_gst
. Alternatively, the user can pass a scanned copy of the GSTIN certificate as a file identifier insupporting_documentation.id_document
. Remember to set the purpose for the file identifier totax_document
- The physical address details will have to be provided in
business_details.physical_address
hash
- For
business_details.type
=partnership
, a GSTIN is required.
- GSTIN can be passed in
business_details.tax_gst
. In addition, the user must pass a scanned copy of the Partnership Deed as a file identifier insupporting_documentation.id_document
. Remember to set the purpose for the file identifier toidentity_document
- You can create a person by providing the image of the individual PAN card or individual PAN number (text) + full name. Please remember that for
account.business_details.type
:
company
,limited_liability_partnership
andpartnership
: for person of relationship owner alone, you can alternatively pass an image of their passport (this is to support non-Indian owners who may not have a PAN) or of course a PAN if one is availablesole_proprietor
andindividual
:person.relationship.owner
must be set to true and no other relationships are possible
Once the above setup is complete, you can proceed forward to activate the connected user.
3. Activate partner
A partner can be activated by a platform or a direct user over the API and the Xflow Dashboard.
curl -L -X POST 'https://api.xflowpay.com/v1/accounts/account_F0A_1666184956871_JsBZ2_000/activate' \
-H 'Authorization: Bearer sk_your_key' \
-H 'Content-Type: application/json'
Deactivate an Account
You can only deactivate an account of type=partner
.
curl -L -X POST 'https://api.xflowpay.com/v1/accounts/account_F0A_1666184956871_JsBZ2_000/deactivate' \
-H 'Authorization: Bearer sk_your_key' \
-H 'Content-Type: application/json'
AccountSettings
The AccountSetting object models the settings for a given account. The AccountSetting object is created by Xflow at the time of account creation.
This parameter represents the account object with which the AccountSetting object is associated.
Default values for address of category xflow_receive
availability for different types of accounts.
Default values for the currency for address of category xflow_receive
for different types of accounts.
The seconds elapsed since Unix epoch time at which the AccountSetting was created.
Indicates whether live FX is enabled for a platform's connected users. If true
, payouts are processed immediately for all connected users.
Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them.
{
"account_id": "account_F0A_1666079993446_77Hgq_000",
"address": {
"connected_user": false,
"connected_user_partner": false,
"partner": false,
"platform": true,
"user": null
},
"address_currency": {
"connected_user": ["USD"],
"connected_user_partner": ["USD"],
"partner": ["USD"],
"platform": ["USD"],
"user": []
},
"created": 1666077553,
"id": "account_setting_F0A_1666077553446_41Hgq_000",
"live_fx": true,
"livemode": true,
"metadata": null,
"object": "account_setting",
"payouts": {
"enabled": true,
"interval": "monthly",
"monthly_anchor": 25,
"reason_code_not_enabled": "account_not_activated",
"weekly_anchor": null
}
}
Retrieve an AccountSetting
curl -L -X GET 'https://api.xflowpay.com/v1/account_settings/account_setting_F0A_1666184956871_JsBZ2_000' \
-H 'Authorization: Bearer sk_your_key'
Default values for address of category xflow_receive
availability for different types of accounts.
Default values for address of category xflow_receive
availability for different types of accounts.
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them.
curl -L -X POST 'https://api.xflowpay.com/v1/account_settings/account_setting_F0A_1689699873811_mK7SU_000' \
-H 'Authorization: Bearer sk_your_key' \
-H 'Content-Type: application/json' \
-d '{
"metadata": {
"internal_name": "Shoe and Sock Power"
}
}'
List all AccountSettings
This endpoint returns all AccountSettings (filtered by the applied below query parameters) associated with the platform, connected user or direct user in question. Specifically, in context of a:
- Platform, this endpoint will return the platform and its connected users AccountSettings
- Connected user, this endpoint will return the connected user and its partners AccountSettings
- Direct user, this endpoint will return the direct user and its partners AccountSettings
This parameter represents the account object with which the AccountSetting object is associated.
Indicates whether an address is available by default for a connected user.
Indicates whether an address is available by default for a connected user's partner.
Return results where the created
field is equal to the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is greater than the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is greater than or equal to the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is lesser than the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is lesser than or equal to the timestamp value in seconds elapsed since Unix epoch time.
A cursor for use in pagination. ending_before
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, starting with obj_bar
, your subsequent call can include ending_before=obj_bar
in order to fetch the previous page of the list.
A limit on the number of objects to be returned, between 1 and 10. If this parameter is not specified, a default value of 10 is assumed.
Whether Xflow can send payouts to this account. This parameter can be set by Xflow for a direct user or by the platform on behalf of a connected user. The former is an Xflow account of type=user
which is not connected to an account of type=platform
.
account_not_activated
Payouts are not enabled on this account as it has not been activated.
platform_hold
Payouts are not enabled on this account as they have been disabled by the platform.
xflow_hold
Payouts are not enabled on this account as they have been disabled by Xflow.
A cursor for use in pagination. starting_after
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, ending with obj_bar
, your subsequent call can include starting_after=obj_bar
in order to fetch the next page of the list.
curl -L -X GET 'https://api.xflowpay.com/v1/account_settings?limit=2' \
-H 'Authorization: Bearer sk_your_key'
List all AccountSettings (Connected Users)
This endpoint returns all AccountSettings (filtered by the applied below query parameters) associated with the connected users of a platform.
This parameter represents the account object with which the AccountSetting object is associated.
Indicates whether an address is available by default for a connected user.
Indicates whether an address is available by default for a connected user's partner.
Return results where the created
field is equal to the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is greater than the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is greater than or equal to the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is lesser than the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is lesser than or equal to the timestamp value in seconds elapsed since Unix epoch time.
A cursor for use in pagination. ending_before
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, starting with obj_bar
, your subsequent call can include ending_before=obj_bar
in order to fetch the previous page of the list.
A limit on the number of objects to be returned, between 1 and 10. If this parameter is not specified, a default value of 10 is assumed.
Whether Xflow can send payouts to this account. This parameter can be set by Xflow for a direct user or by the platform on behalf of a connected user. The former is an Xflow account of type=user
which is not connected to an account of type=platform
.
account_not_activated
Payouts are not enabled on this account as it has not been activated.
platform_hold
Payouts are not enabled on this account as they have been disabled by the platform.
xflow_hold
Payouts are not enabled on this account as they have been disabled by Xflow.
A cursor for use in pagination. starting_after
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, ending with obj_bar
, your subsequent call can include starting_after=obj_bar
in order to fetch the next page of the list.
curl -L -X GET 'https://api.xflowpay.com/v1/account_settings/connected?limit=2' \
-H 'Authorization: Bearer sk_your_key'
Addresses
Address objects represent a destination (for a store of value), which is usually an Xflow account.
xflow_receive
A destination (for a store of value) created by Xflow for the user to accept funds.
The seconds elapsed since Unix epoch time at which the address object was created.
The ISO 4217 3-digit code for the amount currency.
Unique identifier of an account object associated with this address. This is an account of type=partner
or type=user
or type=platform
for address of category xflow_receive
.
The type of object that this address object is associated with. This can only be account
for now.
Has the value true
if the object exists in livemode or the value false
if the object exists in testmode.
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them.
activated
Address is activated, and can be used to send or receive funds from.
deactivated
Address is deactivated, and cannot be used to send or receive funds from.
expired
Address is expired, and cannot be re-used to send or receive funds from.
pending_deactivation
Address is scheduled to be deactivated.
Documents required to prove the authenticity of this destination (for a store of value).
Type of destination (for a store of value). This is bank_account
for address of category xflow_receive
.
{
"bank_account": {
"domestic_credit": "000000007",
"domestic_debit": null,
"domestic_fast_credit": "000000007",
"domestic_wire": "000000008",
"global_wire": "XFLOWS33",
"iban": null,
"last4": "0400",
"number": "51744431540400"
},
"billing_details": null,
"category": "xflow_receive",
"created": 1709474909,
"currency": "USD",
"id": "address_f0A_1709474909321_p7bVk_000",
"is_reusable": false,
"linked_id": "account_F0A_1709429640704_QFIJN_000",
"linked_object": "account",
"livemode": false,
"metadata": null,
"name": null,
"object": "address",
"status": "activated",
"supporting_documentation": null,
"type": "bank_account",
"wallet": null
}
This parameter indicates the category of the address. To create an address to pay out a user, this needs to be set to user_payout
.
The ISO 4217 3-digit code for the amount currency. This should be set to INR
.
Unique identifier of an account object associated with this address. This is an account of type=user
or type=platform
for address of category user_payout
.
The type of object that this address object is associated with. This can only be account
for now.
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them.
Documents required to prove the authenticity of this destination (for a store of value).
curl -L -X POST 'https://api.xflowpay.com/v1/addresses' \
-H 'Authorization: Bearer sk_your_key' \
-H 'Content-Type: application/json' \
-d $'{
"bank_account": {
"domestic_credit": "HDFC0000261",
"number": "5021102940182"
},
"billing_details": {
"city": "Bangalore",
"country": "IN",
"line1": "No. 7 MG Road",
"postal_code": "560038",
"state": "Karnataka"
},
"category": "user_payout",
"currency": "INR",
"linked_id": "account_F0A_1666077553446_41Hgq_000",
"linked_object": "account",
"name": "Marvelous Movies India. Pvt. Ltd.",
"type": "bank_account"
}'
Retrieve an Address
curl -L -X GET 'https://api.xflowpay.com/v1/addresses/address_f0A_1666184962045_5J7h9_000' \
-H 'Authorization: Bearer sk_your_key'
Update an Address
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them.
curl -L -X POST 'https://api.xflowpay.com/v1/addresses/address_f0A_1666184962045_5J7h9_000' \
-H 'Authorization: Bearer sk_your_key' \
-H 'Content-Type: application/json' \
-d '{
"metadata": {
"internal_reference": "ABC-1234"
}
}'
List all Addresses
Xflow categorization of destination (for a store of value).
partner_payment
A destination (for a store of value) that the partner has paid the user from.
user_payout
A destination (for a store of value) created by the user to pay themselves out.
xflow_checkout
A destination (for a store of value) that was created for managing funds coming in through Checkout.
xflow_fee_advance
A destination (for a store of value) created by Xflow for the platform user to maintain an advance balance to enable its connected users which have fees lower than the passthrough fees.
xflow_receive
A destination (for a store of value) created by Xflow for the user to accept funds.
Return results where the created
field is equal to the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is greater than the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is greater than or equal to the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is lesser than the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is lesser than or equal to the timestamp value in seconds elapsed since Unix epoch time.
The ISO 4217 3-digit code for the amount currency.
A cursor for use in pagination. ending_before
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, starting with obj_bar
, your subsequent call can include ending_before=obj_bar
in order to fetch the previous page of the list.
A limit on the number of objects to be returned, between 1 and 10. If this parameter is not specified, a default value of 10 is assumed.
Unique identifier of an account object associated with this address. This is an account of:
type=partner
or type=user
or type=platform
for addresses of category xflow_receive
type=user
or type=platform
for address of category user_payout
type=platform
for addresses of category xflow_fee_advance
type=partner
for addresses of category partner_payment
, xflow_checkout
A cursor for use in pagination. starting_after
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, ending with obj_bar
, your subsequent call can include starting_after=obj_bar
in order to fetch the next page of the list.
activated
Address is activated, and can be used to send or receive funds from.
deactivated
Address is deactivated, and cannot be used to send or receive funds from.
expired
Address is expired, and cannot be re-used to send or receive funds from.
pending_deactivation
Address is scheduled to be deactivated.
Type of destination (for a store of value). This can be bank_account
or wallet
.
curl -L -X GET 'https://api.xflowpay.com/v1/addresses?limit=2&status=activated' \
-H 'Authorization: Bearer sk_your_key'
The Balance object
Funds that are available to the user within Xflow. For example, this could be funds which have been reconciled, but have not yet been picked up by Xflow for payouts.
Funds that have been transferred by the user to maintain balance within Xflow to enable connected users to have fees lower than the passthrough fees. This is []
for non-platform users.
Has the value true
if the object exists in livemode or the value false
if the object exists in testmode.
Funds that are being processed for payouts by Xflow.
Funds that are not yet available to the user within Xflow. For example, this could be funds which have been received against a particular account identifier but have not yet been reconciled.
{
"account_id": "account_F0A_1666077553446_41Hgq_000",
"available": [
{
"amount": "500.00",
"currency": "AED"
},
{
"amount": "9000.00",
"currency": "AUD"
},
{
"amount": "2000.00",
"currency": "CHF"
},
{
"amount": "410.00",
"currency": "CZK"
},
{
"amount": "5610.00",
"currency": "DKK"
},
{
"amount": "100.00",
"currency": "EUR"
},
{
"amount": "200.00",
"currency": "GBP"
},
{
"amount": "120.00",
"currency": "HKD"
},
{
"amount": "500.00",
"currency": "NOK"
},
{
"amount": "600.00",
"currency": "PLN"
},
{
"amount": "100.00",
"currency": "SEK"
},
{
"amount": "500.00",
"currency": "SGD"
},
{
"amount": "3400.00",
"currency": "USD"
}
],
"fee_advance": [],
"livemode": true,
"object": "balance",
"payout_processing": [
{
"amount": "0.00",
"currency": "AED"
},
{
"amount": "0.00",
"currency": "AUD"
},
{
"amount": "0.00",
"currency": "CHF"
},
{
"amount": "0.00",
"currency": "CZK"
},
{
"amount": "0.00",
"currency": "DKK"
},
{
"amount": "0.00",
"currency": "EUR"
},
{
"amount": "0.00",
"currency": "GBP"
},
{
"amount": "120.00",
"currency": "HKD"
},
{
"amount": "500.00",
"currency": "NOK"
},
{
"amount": "650.00",
"currency": "PLN"
},
{
"amount": "100.00",
"currency": "SEK"
},
{
"amount": "500.00",
"currency": "SGD"
},
{
"amount": "300.00",
"currency": "USD"
}
],
"pending": [
{
"amount": "100.00",
"currency": "AED"
},
{
"amount": "900.00",
"currency": "AUD"
},
{
"amount": "200.00",
"currency": "CHF"
},
{
"amount": "10.00",
"currency": "CZK"
},
{
"amount": "10.00",
"currency": "DKK"
},
{
"amount": "100.00",
"currency": "EUR"
},
{
"amount": "200.00",
"currency": "GBP"
},
{
"amount": "120.00",
"currency": "HKD"
},
{
"amount": "100.00",
"currency": "NOK"
},
{
"amount": "600.00",
"currency": "PLN"
},
{
"amount": "100.00",
"currency": "SEK"
},
{
"amount": "500.00",
"currency": "SGD"
},
{
"amount": "200.00",
"currency": "USD"
}
],
"processing": [
{
"amount": "500.00",
"currency": "AED"
},
{
"amount": "200.00",
"currency": "AUD"
},
{
"amount": "200.00",
"currency": "CHF"
},
{
"amount": "10.00",
"currency": "CZK"
},
{
"amount": "10.00",
"currency": "DKK"
},
{
"amount": "100.00",
"currency": "EUR"
},
{
"amount": "200.00",
"currency": "GBP"
},
{
"amount": "120.00",
"currency": "HKD"
},
{
"amount": "100.00",
"currency": "NOK"
},
{
"amount": "600.00",
"currency": "PLN"
},
{
"amount": "100.00",
"currency": "SEK"
},
{
"amount": "500.00",
"currency": "SGD"
},
{
"amount": "300.00",
"currency": "USD"
}
]
}
Retrieve Balance
curl -L -X GET 'https://api.xflowpay.com/v1/balance?account_id=account_F0A_1666077553446_41Hgq_000' \
-H 'Authorization: Bearer sk_your_key'
Retrieve Aggregate Partner Pending Balance
curl -L -X GET 'https://api.xflowpay.com/v1/balance/aggregate?account_id=account_F0A_1666077553446_41Hgq_000' \
-H 'Authorization: Bearer sk_your_key'
BalanceTransactions
BalanceTransactions (BTs) are created by payments and represent funds being credited and debited in the Available and Pending compartments. Note that a single Payment can create multiple BTs.
The BalanceTransaction object
available
Funds that are available to the user within Xflow.
fee_advance
Funds that have been sent by the user to manage shortfall in Xflow fees.
payout_processing
Funds that are blocked for payouts within Xflow to the user.
pending
Funds that are not yet available to the user within Xflow.
processing
Funds that are blocked for processing by Xflow.
The seconds elapsed since Unix epoch time at which the BalanceTransaction object was created.
The ISO 4217 3-digit code for the amount currency.
Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
{
"amount": "20.00",
"category": "available",
"created": 1666127190,
"currency": "USD",
"id": "bt_f0A_1666127190761_EZ7RC_000",
"livemode": true,
"object": "balance_transaction",
"payment_id": "payment_f0A_1666127190761_y0Yqq_000"
}
Retrieve a BalanceTransaction
curl -L -X GET 'https://api.xflowpay.com/v1/balance_transactions/bt_f0A_1666127190761_EZ7RC_000' \
-H 'Authorization: Bearer sk_your_key'
List all BalanceTransactions
available
Funds that are available to the user within Xflow.
fee_advance
Funds that have been sent by the user to manage shortfall in Xflow fees.
payout_processing
Funds that are blocked for payouts within Xflow to the user.
pending
Funds that are not yet available to the user within Xflow.
processing
Funds that are blocked for processing by Xflow.
Return results where the created
field is equal to the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is greater than the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is greater than or equal to the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is lesser than the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is lesser than or equal to the timestamp value in seconds elapsed since Unix epoch time.
The ISO 4217 3-digit code for the amount currency.
A cursor for use in pagination. ending_before
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, starting with obj_bar
, your subsequent call can include ending_before=obj_bar
in order to fetch the previous page of the list.
A limit on the number of objects to be returned, between 1 and 10. If this parameter is not specified, a default value of 10 is assumed.
Unique identifier for the payment object associated with the BalanceTransaction.
A cursor for use in pagination. starting_after
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, ending with obj_bar
, your subsequent call can include starting_after=obj_bar
in order to fetch the next page of the list.
curl -L -X GET 'https://api.xflowpay.com/v1/balance_transactions?currency=USD' \
-H 'Authorization: Bearer sk_your_key'
The Deposit object
The seconds elapsed since Unix epoch time at which the deposit was created.
The ISO 4217 3-digit code for the amount currency.
Details of the account and address from which the funds are being deposited.
Has the value true
if the object exists in livemode or the value false
if the object exists in testmode.
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them.
affirm
Funds are transferred using Affirm, a Buy-Now-Pay-Later payment method.
afterpay
Funds are transferred using Afterpay, a Buy-Now-Pay-Later payment method.
check
Funds are transferred via a check.
domestic_credit
Funds are transferred using local ACH credit.
domestic_debit
Funds are debited using local ACH debit.
domestic_fast_credit
Funds are transferred using fast local ACH credit.
domestic_wire
Funds are transferred using domestic wire systems.
global_wire
Funds are transferred using SWIFT.
klarna
Funds are transferred using Klarna, a Buy-Now-Pay-Later payment method.
Details of the payment method being used for the deposit of funds.
Reason why the deposit was declined or disputed. Possible values are cancelled
, duplicate
, general
, high_risk
, incorrect_amount
, poor_image_quality
, unmatched_details
.
initialized
The deposit object has been created but has not yet been processed.
processing
The deposit object is now being processed. Xflow does not know at this time whether it will complete successfully.
completed
The deposit object has completed successfully. Funds are now available in Xflow.
cancelled
The deposit object was cancelled before it was processed.
failed
The deposit object failed processing.
reversed
The deposit amount has been returned back to the source.
{
"amount": "20.00",
"created": 1666079759,
"currency": "USD",
"from": {
"account_id": "account_F0A_1666079163481_A7fje_000",
"address_id": "address_f0A_1666079747608_NDR0g_000"
},
"id": "deposit_f0A_1666079759165_P3FtR_000",
"livemode": true,
"metadata": null,
"object": "deposit",
"payment_method": "domestic_debit",
"payment_method_details": null,
"reason_code": null,
"statement_descriptor": "Online Payment for Invoice FY 2022-23-038",
"status": "completed",
"to": {
"account_id": "account_F0A_1666079163481_A7fje_000",
"address_id": "address_f0A_1666079171474_6jxOu_000"
}
}
Create a Deposit
This call works only in testmode
.
The ISO 4217 3-digit code for the amount currency. This can only be USD
for now.
Details of the account and address from which the funds are being deposited.
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them.
domestic_credit
Funds are transferred using local ACH credit.
domestic_fast_credit
Funds are transferred using fast local ACH credit.
domestic_wire
Funds are transferred using domestic wire systems.
global_wire
Funds are transferred using SWIFT.
curl -L -X POST 'https://api.xflowpay.com/v1/deposits' \
-H 'Authorization: Bearer sk_your_key' \
-H 'Content-Type: application/json' \
-d '{
"amount": "20.00",
"currency": "USD",
"from": {
"account_id": "account_F0A_1666079163481_A7fje_000"
},
"payment_method": "domestic_credit",
"to": {
"account_id": "account_F0A_1666079163481_A7fje_000",
"address_id": "address_f0A_1666079171474_6jxOu_000"
}
}'
Retrieve a Deposit
curl -L -X GET 'https://api.xflowpay.com/v1/deposits/deposit_f0A_1666079759165_P3FtR_000' \
-H 'Authorization: Bearer sk_your_key'
Update a Deposit
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them.
curl -L -X POST 'https://api.xflowpay.com/v1/deposits/deposit_f0A_1666079759165_P3FtR_000' \
-H 'Authorization: Bearer sk_your_key' \
-H 'Content-Type: application/json' \
-d '{
"metadata": {
"internal_reference": "ABC-1234"
}
}'
List all Deposits
Return results where the created
field is equal to the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is greater than the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is greater than or equal to the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is lesser than the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is lesser than or equal to the timestamp value in seconds elapsed since Unix epoch time.
The ISO 4217 3-digit code for the amount currency.
A cursor for use in pagination. ending_before
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, starting with obj_bar
, your subsequent call can include ending_before=obj_bar
in order to fetch the previous page of the list.
Account identifier for the account from which funds are being deposited. Refer account object for more details.
Address identifier of the account from which funds are being deposited. Refer address object for more details.
A limit on the number of objects to be returned, between 1 and 10. If this parameter is not specified, a default value of 10 is assumed.
affirm
Funds are transferred using Affirm, a Buy-Now-Pay-Later payment method.
afterpay
Funds are transferred using Afterpay, a Buy-Now-Pay-Later payment method.
check
Funds are transferred via a check.
domestic_credit
Funds are transferred using local ACH credit.
domestic_debit
Funds are debited using local ACH debit.
domestic_fast_credit
Funds are transferred using fast local ACH credit.
domestic_wire
Funds are transferred using domestic wire systems.
global_wire
Funds are transferred using SWIFT.
klarna
Funds are transferred using Klarna, a Buy-Now-Pay-Later payment method.
Reason why the deposit was declined or disputed. Possible values are cancelled
, duplicate
, general
, high_risk
, incorrect_amount
, poor_image_quality
, unmatched_details
.
A cursor for use in pagination. starting_after
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, ending with obj_bar
, your subsequent call can include starting_after=obj_bar
in order to fetch the next page of the list.
initialized
The deposit object has been created but has not yet been processed.
processing
The deposit object is now being processed. Xflow does not know at this time whether it will complete successfully.
completed
The deposit object has completed successfully. Funds are now available in Xflow.
cancelled
The deposit object was cancelled before it was processed.
failed
The deposit object failed processing.
reversed
The deposit amount has been returned back to the source.
Account identifier for the account to which funds are being deposited. Refer account object for more details.
Address identifier of the account to which funds are being deposited. Refer address object for more details.
curl -L -X GET 'https://api.xflowpay.com/v1/deposits?payment_method=domestic_credit&status=initialized' \
-H 'Authorization: Bearer sk_your_key'
Events
Events are Xflow's way of letting you know when something interesting happens in your account. When an interesting event occurs, we create a new event object. For example, when a deposit is received, we create a deposit.status.completed
event. Note that many API requests may cause multiple events to be created.
Events occur when the state of another API resource changes. For example, a deposit.status.completed
event will contain a deposit and account.updated.payouts_enabled
will contain an account. Individual Events don’t contain very much information on their own. This is by design, as the API structure can remain extremely stable and avoid difficult webhook migrations in the future as the Xflow API changes. If you need additional information, make a GET
request to the API for that information. You can use the event.linked_id
parameter to determine what resource to fetch from the API.
As with other API resources, you can use endpoints to retrieve an individual event or a list of events from the API. We also have a separate webhooks system for sending the event objects directly to an endpoint on your server. Webhooks are managed in your account settings, and our webhooks guide will help you get set up.
When using Xflow for Platforms, you can also receive notifications of events that occur in your platform and connected accounts.
NOTE: Right now, access to events through the Retrieve event API is guaranteed only for 30 days.
The Event object
The identifier for the account to which the associated object that generated this event belongs.
The seconds elapsed since Unix epoch time at which the event was created.
Has the value true
if the object exists in livemode or the value false
if the object exists in testmode.
Description of the event (e.g., deposit.status.completed
). You can find the full list of event types here.
{
"account_id": "account_f0A_1648522874420_w8GTc_000",
"created": 1662917008,
"id": "event_f0A_1648522874420_w8GTc_000",
"linked_id": "deposit_f0A_1912224718366_laE3R_000",
"linked_object": "deposit",
"livemode": false,
"object": "event",
"type": "deposit.status.completed"
}
Retrieve an Event
curl -L -X GET 'https://api.xflowpay.com/v1/events/event_f0A_1666079759165_P3FtR_000' \
-H 'Authorization: Bearer sk_your_key'
List all Events
The identifier for the account to which the associated object that generated this event belongs. This can be passed only by an account of type=platform
.
Return results where the created
field is equal to the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is greater than the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is greater than or equal to the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is lesser than the timestamp value in seconds elapsed since Unix epoch time.
Return results where the created
field is lesser than or equal to the timestamp value in seconds elapsed since Unix epoch time.
A cursor for use in pagination. ending_before
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, starting with obj_bar
, your subsequent call can include ending_before=obj_bar
in order to fetch the previous page of the list.
A limit on the number of objects to be returned, between 1 and 10. If this parameter is not specified, a default value of 10 is assumed.
A cursor for use in pagination. starting_after
is an object identifier that defines your place in the list. For instance, if you make a list request and receive 5 objects, ending with obj_bar
, your subsequent call can include starting_after=obj_bar
in order to fetch the next page of the list.
Description of the event (e.g., deposit.status.completed
). You can find the full list of event types here.
curl -L -X GET 'https://api.xflowpay.com/v1/events?limit=5' \
-H 'Authorization: Bearer sk_your_key'
Types of Events
This is a list of all the types of events we currently send. We may add more at any time, so in developing and maintaining your code, you should not assume that only these types exist.
You’ll notice that these events follow a pattern: resource.event.change
. Our goal is to design a consistent system that makes things easier to anticipate and code against.
Occurs when there is a change in the value of the parameter account.payouts.enabled
.