requestPayment
Overview
This mutation takes the required inputs and creates a payment request from a specific email address. This will be payable by any accounts owned by that email.
Special Considerations
- Payments can be made by any account from the requested email (i.e. business or personal)
Inputs
requestPaymentArgs
Required Data
toEmail: string
amount: float
currency: Currency
valueDate: DateTime
description: string
emailMessage (optional): string
Returns
Promise<PrivatePaymentRequest>
A promise containing the following object / data:
PrivatePaymentRequest: {
id: ID,
currency: CURRENCY,
amount: float,
description: string,
emailMessage: string,
chargeDate: DateTime,
paymentLink: string,
}
Example
Running this mutation:
mutation {
requestPayment(data: {
toEmail: "docexample@getborderless.com"
amount: 25
currency: USD
valueDate: "2020-10-09T00:00:00Z"
description: "test"
}) {
id
currency
amount
description
chargeDate
paymentLink
}
}
Gives us:
{
"data": {
"requestPayment": {
"id": "ckbbqjpeo000f0772zslm0uqg",
"currency": "USD",
"amount": 25,
"description": "test",
"chargeDate": "2020-10-09T00:00:00.000Z",
"paymentLink": "http://localhost:8000/payment-request?id=ckbbqjpeo000f0772zslm0uqg"
}
}
}
Common Errors
N/A