curl --request POST \
--url https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/{id}/invoice \
--header 'Content-Type: application/json' \
--header 'partner-api-key: <api-key>' \
--data '
{
"invoiceFile": "<string>"
}
'import requests
url = "https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/{id}/invoice"
payload = { "invoiceFile": "<string>" }
headers = {
"partner-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'partner-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({invoiceFile: '<string>'})
};
fetch('https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/{id}/invoice', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/{id}/invoice",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'invoiceFile' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"partner-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/{id}/invoice"
payload := strings.NewReader("{\n \"invoiceFile\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("partner-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/{id}/invoice")
.header("partner-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"invoiceFile\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/{id}/invoice")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["partner-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoiceFile\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyUpload Cross-Ramp Invoice
Uploads the commercial invoice (Base64 PDF) for a cross-ramp in WAITING_INVOICE. On success the cross-ramp moves to PENDING_FUNDS. The response does not include funding instructions: read the cross-ramp to get sourceBankAccount. Naturally idempotent: repeating an upload after it succeeded returns 200 with the current status. This route does not support the Idempotency-Key header. Nothing is paid out for a cross-ramp until its invoice is uploaded, in every country; the payout to the provider is placed after the upload. The file is parsed as a real PDF: an unreadable or encrypted file, or one with 0 or more than 500 pages, is rejected with INVALID_COMMERCIAL_INVOICE (400). For a transaction of a bulk, the stored invoices of the bulk may total at most 24 MiB decoded and 500 pages: a file that would go over is rejected with CROSS_RAMP_BULK_INVOICE_BUDGET_EXCEEDED or CROSS_RAMP_BULK_INVOICE_PAGES_EXCEEDED (400), nothing is stored and the transaction stays WAITING_INVOICE. A 503 (CROSS_RAMP_BULK_INVOICE_BUSY after a wait of about 2 seconds, or CROSS_RAMP_BULK_INVOICE_SIZE_UNAVAILABLE) is temporary and stores nothing: wait a second or two and retry.
curl --request POST \
--url https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/{id}/invoice \
--header 'Content-Type: application/json' \
--header 'partner-api-key: <api-key>' \
--data '
{
"invoiceFile": "<string>"
}
'import requests
url = "https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/{id}/invoice"
payload = { "invoiceFile": "<string>" }
headers = {
"partner-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'partner-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({invoiceFile: '<string>'})
};
fetch('https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/{id}/invoice', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/{id}/invoice",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'invoiceFile' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"partner-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/{id}/invoice"
payload := strings.NewReader("{\n \"invoiceFile\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("partner-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/{id}/invoice")
.header("partner-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"invoiceFile\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/{id}/invoice")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["partner-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoiceFile\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyWAITING_INVOICE). On success the cross-ramp moves to PENDING_FUNDS. The response returns id, status and updatedAt; read the cross-ramp afterwards to get sourceBankAccount, the funding instructions the user needs to deposit the source currency.
invoiceFile in Create Cross-Ramp, the cross-ramp waits in WAITING_INVOICE and no funding instructions are returned until this call succeeds; the payout to the provider is placed after the upload.Idempotency
This route does not support theIdempotency-Key header. It is naturally idempotent: repeating an upload that already succeeded returns 200 with the current status and creates nothing new.
Rules
- The cross-ramp must be in
WAITING_INVOICE. invoiceFile: Base64-encoded PDF, maximum 25 MB once decoded. The file is parsed as a real PDF: an unreadable or encrypted file, or one with 0 or more than 500 pages, is rejected withINVALID_COMMERCIAL_INVOICE.- A valid PDF is accepted automatically (no manual review) and moves the cross-ramp to
PENDING_FUNDS. - The user must be verified and have no outstanding beneficial-owner signature; otherwise the request is rejected with
403and the cross-ramp staysWAITING_INVOICE. - For a transaction of a bulk, the stored invoices of the bulk may total at most 24 MiB decoded and 500 pages. A file that would go over is rejected with
400CROSS_RAMP_BULK_INVOICE_BUDGET_EXCEEDED(size) orCROSS_RAMP_BULK_INVOICE_PAGES_EXCEEDED(pages); nothing is stored and the transaction staysWAITING_INVOICE, so you can retry with a smaller file. - For a bulk transaction, a
503(CROSS_RAMP_BULK_INVOICE_BUSYorCROSS_RAMP_BULK_INVOICE_SIZE_UNAVAILABLE) is temporary and nothing is stored.CROSS_RAMP_BULK_INVOICE_BUSYmeans another invoice of the same bulk kept the bulk busy for about 2 seconds: wait a second or two and repeat the upload. - If storing the file fails you get a retryable
500and the status staysWAITING_INVOICE. Retry with the same file. - A
WAITING_INVOICEcross-ramp can also be cancelled with the cancel endpoint. There is no expiry. - Replacing an invoice that was already uploaded is not supported.
- There is no dedicated upload webhook event; see Transaction Events.
Error Codes
Common Errors
| HTTP Status | Code | Message |
|---|---|---|
| 401 | UNAUTHORIZED | ”API Key is missing” |
| 401 | UNAUTHORIZED | ”Invalid API Key format” |
| 401 | UNAUTHORIZED | ”Invalid API Key” |
Endpoint-Specific Errors
| HTTP Status | Code | Message |
|---|---|---|
| 400 | INVALID_USER_INPUT_ERROR | ”Invalid User Input” (invoiceFile missing, not valid Base64 or over the size limit) |
| 400 | INVALID_COMMERCIAL_INVOICE | ”Commercial invoice is invalid: not a valid PDF” (also for an empty or oversized decoded file, “the PDF is encrypted or cannot be read”, or “the PDF must have between 1 and 500 pages”) |
| 400 | CROSS_RAMP_BULK_INVOICE_BUDGET_EXCEEDED | Bulk transaction only: the invoices of the bulk would total more than 24 MiB. Nothing is stored; the transaction stays WAITING_INVOICE. Retry with a smaller file |
| 400 | CROSS_RAMP_BULK_INVOICE_PAGES_EXCEEDED | Bulk transaction only: the invoices of the bulk would total more than 500 pages. Nothing is stored; the transaction stays WAITING_INVOICE. Retry with a shorter file |
| 403 | USER_NOT_VERIFIED_ERROR | The cross-ramp’s user is not verified. The cross-ramp stays WAITING_INVOICE |
| 403 | SIGNATURE_REQUIREMENT_NOT_MET | A beneficial-owner signature is outstanding. The cross-ramp stays WAITING_INVOICE |
| 404 | NOT_FOUND_ERROR | ”Cross ramp was not found” (unknown id or another partner’s cross-ramp) |
| 409 | CROSS_RAMP_NOT_AWAITING_INVOICE | The cross-ramp is CANCELLED, EXPIRED or FAILED, including when cancelled while uploading |
| 500 | COMMERCIAL_INVOICE_UPLOAD_FAILED | Storing the file failed. Retryable, status unchanged |
| 503 | CROSS_RAMP_BULK_INVOICE_BUSY | Bulk transaction only: another invoice of the same bulk is being processed. Nothing is stored. Wait a second or two and retry |
| 503 | CROSS_RAMP_BULK_INVOICE_SIZE_UNAVAILABLE | Bulk transaction only: the size or page count of an invoice already stored for the bulk can’t be read yet. Nothing is stored. Back off and retry |
Authorizations
API key for the affiliated partner performing the request.
Path Parameters
Cross-ramp transaction ID returned when the cross-ramp was created.
Body
Base64-encoded PDF commercial invoice. Maximum 25 MB once decoded. Parsed as a real PDF: an unreadable or encrypted file, or one with 0 or more than 500 pages, is rejected with INVALID_COMMERCIAL_INVOICE.