Look up the supplier's bank, save a SWIFT payee with an optional intermediary bank, upload the invoice and send a USD payout.
12 min read
Use this recipe to look up a supplier's bank, save a SWIFT payee with an optional intermediary bank, upload the invoice and send a USD payout.
Who it is for. A US importer that pays a textile supplier in Lagos for an invoiced shipment.
Status. Available to Nigeria (NG) from bank-held USD accounts. Not yet available to other countries, or from wallet-backed accounts. SWIFT payouts are in USD only.
Acme uploads invoice INV-7731 (a 180 KB PDF), then sends 12,000.00 USD to Adebayo Textiles Ltd's USD account at a Nigerian bank. In this example, the fee on its plan is 25.00 USD.
3.
Gravv debits the account 12,025.00 USD. Banks along the way, such as an intermediary bank or the receiving bank, may take their own charges out of the 12,000.00 USD. Gravv's fee is the fee in the response.
Before you start
•
A bank-held USD account that is active and funded. Check it with GET /v2/accounts/{id}. For a country other than Nigeria, contact support before you build the flow, because no API lists the countries open for SWIFT.
•
The invoice or contract as a PDF, PNG or JPEG, at most 700 KB (in sandbox, under 500 KB).
•
These details from the supplier:
◦
The legal name on the account.
◦
The account number, or the IBAN.
◦
The SWIFT/BIC code.
◦
The supplier's address.
◦
The bank's address.
◦
The intermediary (correspondent) bank's details, only if the supplier's bank gave you them.
Find out what is required
The bank and its address
Look the bank up by BIC. SWIFT banks appear only when you pass swift_code, search (3 characters or more) or institution_type=swift.
Copy the fields in prefill into the payee. address is one display line. min_amount and max_amount are reference values, not limits. For a BIC that is not in the directory, the API returns HTTP 200 with an empty items list.
Set payee_type to swift and currency to USD, the only currency allowed.
•
Send bic, which must be in the SWIFT directory, and account_number. The account number is required even when you also send iban.
•
Set account_owner_type to business for a company or individual for a person.
•
Send the beneficiary's address with address_line1, city, state and country.
•
Send the bank's bank_address_line_1, bank_city, bank_state, bank_postal_code and bank_country. Gravv fills bank_name and institution_id from the BIC.
•
An intermediary bank is optional. If you add one, send all or none of intermediary_financial_institution, intermediary_bank_routing_number, intermediary_bank_address1, intermediary_bank_city, intermediary_bank_state, intermediary_bank_zip_code and intermediary_bank_country. intermediary_bank_address2 is optional.
Whether a document is needed
Whether a SWIFT payout needs a document depends on a setting of your account at the bank, not on the payee. If one SWIFT payout from an account needed a document, expect all of them to need one. For business payments, always attach the invoice. If you send no document and one is needed, the transfer comes back paused. See Pay a person abroad by SWIFT.
Gravv stores the bank and intermediary fields but does not return them.
2. Wait until the payee is active
A SWIFT payee can stay pending while the bank approves the receiving details, and there is no fixed time for this. Listen for external_account.active or external_account.setup_failed.
Store data.id. Upload a supporting document lists the document types and rules. You can attach up to 5 documents to a transfer. Each document works for one transfer only. Gravv deletes an unused document after 7 days.
4. Send the SWIFT payout
Gravv sends description to the bank as the purpose of payment, so say what the money is for. Set rail to swift. The wire rail is a US domestic wire, and the API refuses it for this payee.
400 a minimum of $1 USD is required for SWIFT transfers
The amount is below 1 USD
Send at least 1.00 USD
400 payee type "swift" does not accept ACH/Wire transfers
The request sent "rail": "wire"
Use "rail": "swift"
400 transfers from this account to DE/USD are not supported at this time
Payouts to that country are not open for your account
Contact support
200 pending, then transfer.status.failed with event_data.transfer_statusmanual_processing_required, transaction still pending
Gravv accepted the transfer but holds it for a person to review, for example a SWIFT payout from a wallet-backed account. No money has left the account
Do not send it again. Contact support with the reference
200 with transfer_statuspaused and statusawaiting_supporting_document
400 supporting_document_ids: each id must be a document uploaded for this customer and not used by another transfer
The document belongs to another customer, is already used, or is older than 7 days
Upload it again for this customer
400 supporting_document_ids: at most 5 documents per transfer
The request has too many ids, or lists one twice
Send up to 5 different ids
400 content: the file is 812 KB (831488 bytes); the largest accepted is 700 KB (716800 bytes). …
The file is over 700 KB
Compress it to 700 KB or less
413 the uploaded file is too large — the maximum is 5MB
In sandbox, a request of about 600 KB or more, whatever the message says. In live, a file over about 5 MB
Compress it to under 500 KB in sandbox, or to 700 KB or less in live
400 content: the file is not a application/pdf
content_type does not match the file
Send the file's real type
400 supporting documents cannot be checked right now; retry shortly
The document store is briefly unavailable
Retry shortly with a new key. Gravv replays the 400 for 24 hours under the old key
transfer.status.failed and a refund after the bank refused the payment
The bank refused the payment for good, for example because the payee was saved against another account. Nothing was paid
Save the payee with internal_account_id set to the source, then send again
Webhooks you will receive
You receive external_account.created, then external_account.active, then several transfer.status.pending events, then transfer.status.completed. If a document is missing, you receive transfer.requires_information.
Testing in sandbox
Sandbox simulates SWIFT payee setup. A business payee with an intermediary bank and an individual payee both become active within seconds. Uploads work as in live, except for size. Keep each file under 500 KB, because sandbox refuses requests from about 600 KB with a 413. The largest file that passed was 563 KB. You cannot force a document pause with a test value.