Skip to main content

Inbounds

An inbound represents a payment service that enables users to deposit funds into the Tango system to support their transactions. Each inbound can support one or more payment methods (e.g., bank transfer, card payment, or other providers).

You can retrieve the list of available inbounds through the frontendConfiguration query.

This data is required to determine which payment methods are supported and to allow users to register or add a payment method accordingly.

query {
public {
frontendConfiguration {
inbounds {
code
displayName
paymentMethodRequired
}
}
}
}

paymentMethodRequired - Indicates whether the end user must add a new payment method in order to use this inbound service.

How to add a new payment method?

To add a new payment method, call the generateInboundToken mutation and provide the inboundCode parameter. The inboundCode must correspond to one of the available inbound codes retrieved from the frontendConfiguration query.

Workflow:

  1. Fetch the list of available inbounds using the frontendConfiguration query (see example above).
  2. Select an inbound from the list and note its code value.
  3. If the inbound requires the user to set up a payment method, choose one where paymentMethodRequired: true .
  4. Call the generateInboundToken mutation with the selected inboundCode to initiate the payment method setup process.
mutation generateInboundToken($inboundCode: String!) {
user {
generateInboundToken(inbound: $inboundCode) {
accessToken
isKYCMissing
expiresIn
refreshToken
isSandbox
redirectUrl
scope
tokenType
userAccountId
__typename
}
__typename
}
}

Example: For an inbound with code: "CARD_PAYMENT", you would call:

mutation {
user {
generateInboundToken(inbound: "CARD_PAYMENT") {
accessToken
redirectUrl
# ... other fields
}
}
}

Response Handling

The behavior after calling the generateInboundToken mutation depends on the specific inbound service and the response it returns. In general:

  • If redirectUrl is present: The user must be redirected to this URL to complete the inbound setup process. This typically opens an external payment provider's interface where the user can add their payment method or complete the inbound configuration.
  • If redirectUrl is not present: The inbound may be configured directly through the Tango API without requiring external redirection.

Always check for the presence of redirectUrl in the response and handle the redirect appropriately in your frontend application.

warning

Adding a payment method will automatically resolve the flag with the REGISTER_PAYMENT_METHOD code.