Import an external payment transaction
curl --request POST \
--url https://api-sb.meld.io/payments/external/import \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"serviceProvider": "STRIPE",
"serviceTransactionId": "<string>"
}
'import requests
url = "https://api-sb.meld.io/payments/external/import"
payload = {
"serviceProvider": "STRIPE",
"serviceTransactionId": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({serviceProvider: 'STRIPE', serviceTransactionId: '<string>'})
};
fetch('https://api-sb.meld.io/payments/external/import', 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-sb.meld.io/payments/external/import",
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([
'serviceProvider' => 'STRIPE',
'serviceTransactionId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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-sb.meld.io/payments/external/import"
payload := strings.NewReader("{\n \"serviceProvider\": \"STRIPE\",\n \"serviceTransactionId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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-sb.meld.io/payments/external/import")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"serviceProvider\": \"STRIPE\",\n \"serviceTransactionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sb.meld.io/payments/external/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"serviceProvider\": \"STRIPE\",\n \"serviceTransactionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"transaction": {
"accountId": "<string>",
"authAmount": 123,
"captureAmount": 123,
"countryCode": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"cryptoPurchaseDetails": {
"blockchainTransactionId": "<string>",
"destinationAmount": 123,
"destinationCurrencyCode": "<string>",
"institution": "<string>",
"networkFee": 123,
"networkFeeInUsd": 123,
"partnerFee": 123,
"partnerFeeInUsd": 123,
"totalFee": 123,
"totalFeeInUsd": 123,
"transactionFee": 123,
"transactionFeeInUsd": 123,
"walletAddress": "<string>"
},
"customer": "<unknown>",
"description": "<string>",
"destinationAmount": 123,
"destinationCurrencyCode": "<string>",
"destinationWalletAddress": "<string>",
"externalCustomerId": "<string>",
"externalReferenceId": "<string>",
"externalSessionId": "<string>",
"externalSubaccountCustomerId": "<string>",
"id": "<string>",
"isImported": true,
"isPassthrough": true,
"key": "<string>",
"multiFactorAuthorizationStatus": [
{
"method": "SMS",
"submitted": true,
"successful": true,
"url": "<string>"
}
],
"parentPaymentTransactionId": "<string>",
"passthroughReference": "<string>",
"paymentMethod": {
"accountId": "<string>",
"id": "<string>",
"serviceProvider": "<string>",
"token": "<string>"
},
"paymentMethodType": "<string>",
"serviceProvider": "<string>",
"serviceProviderCreatedAt": "2023-11-07T05:31:56Z",
"serviceProviderDetails": {},
"serviceProviderTransactionUrl": "<string>",
"serviceTransactionId": "<string>",
"sessionId": "<string>",
"sourceAmount": 123,
"sourceAmountInUsd": 123,
"sourceCurrencyCode": "<string>",
"sourceWalletAddress": "<string>",
"status": "<string>",
"subaccountCustomerId": "<string>",
"transactionType": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"wallet": "<string>"
}
}{
"code": "<string>",
"message": "<string>",
"errors": [
"<string>"
],
"serviceProviderDetails": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"errors": [
"<string>"
],
"serviceProviderDetails": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"errors": [
"<string>"
],
"serviceProviderDetails": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"errors": [
"<string>"
],
"serviceProviderDetails": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"errors": [
"<string>"
],
"serviceProviderDetails": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}External Transactions
Import an external payment transaction
This is the endpoint to import a transaction on any of the supported providers. Use this endpoint if you have performed transactions on one or more providers outside of Meld, and want to import those transactions into Meld’s system. Note that when performing an external refund, the initial transaction is automatically imported into Meld’s system.
POST
/
payments
/
external
/
import
Import an external payment transaction
curl --request POST \
--url https://api-sb.meld.io/payments/external/import \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"serviceProvider": "STRIPE",
"serviceTransactionId": "<string>"
}
'import requests
url = "https://api-sb.meld.io/payments/external/import"
payload = {
"serviceProvider": "STRIPE",
"serviceTransactionId": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({serviceProvider: 'STRIPE', serviceTransactionId: '<string>'})
};
fetch('https://api-sb.meld.io/payments/external/import', 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-sb.meld.io/payments/external/import",
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([
'serviceProvider' => 'STRIPE',
'serviceTransactionId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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-sb.meld.io/payments/external/import"
payload := strings.NewReader("{\n \"serviceProvider\": \"STRIPE\",\n \"serviceTransactionId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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-sb.meld.io/payments/external/import")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"serviceProvider\": \"STRIPE\",\n \"serviceTransactionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sb.meld.io/payments/external/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"serviceProvider\": \"STRIPE\",\n \"serviceTransactionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"transaction": {
"accountId": "<string>",
"authAmount": 123,
"captureAmount": 123,
"countryCode": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"cryptoPurchaseDetails": {
"blockchainTransactionId": "<string>",
"destinationAmount": 123,
"destinationCurrencyCode": "<string>",
"institution": "<string>",
"networkFee": 123,
"networkFeeInUsd": 123,
"partnerFee": 123,
"partnerFeeInUsd": 123,
"totalFee": 123,
"totalFeeInUsd": 123,
"transactionFee": 123,
"transactionFeeInUsd": 123,
"walletAddress": "<string>"
},
"customer": "<unknown>",
"description": "<string>",
"destinationAmount": 123,
"destinationCurrencyCode": "<string>",
"destinationWalletAddress": "<string>",
"externalCustomerId": "<string>",
"externalReferenceId": "<string>",
"externalSessionId": "<string>",
"externalSubaccountCustomerId": "<string>",
"id": "<string>",
"isImported": true,
"isPassthrough": true,
"key": "<string>",
"multiFactorAuthorizationStatus": [
{
"method": "SMS",
"submitted": true,
"successful": true,
"url": "<string>"
}
],
"parentPaymentTransactionId": "<string>",
"passthroughReference": "<string>",
"paymentMethod": {
"accountId": "<string>",
"id": "<string>",
"serviceProvider": "<string>",
"token": "<string>"
},
"paymentMethodType": "<string>",
"serviceProvider": "<string>",
"serviceProviderCreatedAt": "2023-11-07T05:31:56Z",
"serviceProviderDetails": {},
"serviceProviderTransactionUrl": "<string>",
"serviceTransactionId": "<string>",
"sessionId": "<string>",
"sourceAmount": 123,
"sourceAmountInUsd": 123,
"sourceCurrencyCode": "<string>",
"sourceWalletAddress": "<string>",
"status": "<string>",
"subaccountCustomerId": "<string>",
"transactionType": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"wallet": "<string>"
}
}{
"code": "<string>",
"message": "<string>",
"errors": [
"<string>"
],
"serviceProviderDetails": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"errors": [
"<string>"
],
"serviceProviderDetails": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"errors": [
"<string>"
],
"serviceProviderDetails": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"errors": [
"<string>"
],
"serviceProviderDetails": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"errors": [
"<string>"
],
"serviceProviderDetails": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}Headers
Body
application/json