createPaymentSession
Overview
This mutation takes the email or slug and an optionally defined currency as inputs and creates a payment session to the given email or slug and defined currency. The payment session must be updated before submitting (i.e. updatePaymentSession mutation).
Special Considerations
- One of the two inputs, email and slug, is required to create a payment session
- The third input, fromCurrency, is optional. It it is passed in, then the payment session is initialized to have a funding source of the funding balance from that currency. If no fromCurrency is given, the funding source that is defaulted on creation of the payment session will be calculated based on the user’s preferred payment method.
Inputs
createPaymentSessionArgs
Required Data
Either email or slug (not both) is required to be used as input.
toEmail: string
toSlug: string
fromCurrency (optional) : Currency
Returns
Promise<SuccessResult>
A promise containing the following object / data:
message: string
Example
Running this mutation:
mutation {
createPaymentSession (toEmail:"docexample@getborderless.com", fromCurrency:"CAD") {
message
}
}
Gives us:
{
"data": {
"createPaymentSession": {
"message": "Payment session created!"
}
}
}
Common Errors
When running this mutation some of the common errors encountered include:
You are unable to make payments from your account at this time. Please enable funding balance or wait until your account is approved to use this feature. (I-4732)
- The account's country is a global payout country and the account's status is not 'funding balance verified'.
Do not provide both Email and Handle (I-4701)
- Both email and slug are inputted.
You must provide either an email or a handle. (I-4702)
- Neither email nor slug are inputted.
You cannot pay yourself. (I-4703)
- You've attempted to request a payment session from yourself. Please enter a different email or slug.
No account exists for email: ____ (I-4704)
- An account has not been created with the given email.
No contact found with this information.
- The slug is not an account or the account's status is not an external contact.
There is no account associated with this handle. (I-4706)
- The given slug is not associated with a borderless account.
Development error: this person has no accounts. (I-4707)
- The person does not have an account.
beneBankError
- The bank account id of the beneficiary's account does not exist.
The user you are trying to pay has not completed their account setup. (I-4709)
- beneBankError was thrown.
There was an issue accessing your bank account information. (I-4709)
- Bank information may not be available for the given slug or email
Please allow 1-2 business days for your account to be verified before making an international payment. (I-4730)
- The payer's account status is 'not verified' or 'funding balance not verified' and the currency of the payer's account is different from the currency of the beneficiary's account.
Cannot send a payment to this email at this time. (I-4708)
- The account you are sending a payment to may be suspended