Counterparties
8 operations under counterparties. Examples read $API and $KEY from your shell.
- GET /v1/counterparties
- POST /v1/counterparties
- GET /v1/counterparties/{id}
- POST /v1/counterparties/{id}/archive
- POST /v1/counterparties/{id}/ownership-proof
- POST /v1/counterparties/{id}/ownership-challenge
- POST /v1/counterparties/{id}/sponsored-trustline
- POST /v1/counterparties/{id}/sponsored-trustline/submit
GET /v1/counterparties
Parameters
typestring optional in query, one of bank_account, stellar_walletstatusstring optional in query, one of pending_verification, active, archivedlimitinteger required in querystarting_afterstring optional in query
Responses
200 Default Response
object
dataarray requiredEach item:
idstring requiredtypestring required one ofbank_account,stellar_walletlabelstring required (nullable)statusstring required one ofpending_verification,active,archivedcreated_atstring requiredverified_atstring required (nullable)archived_atstring required (nullable)bank_accountobject required (nullable)beneficiary_namestring requiredbank_namestring requiredaccount_number_last4string requiredrouting_codestring requiredcurrencystring required one ofUSD,EUR
stellar_walletobject required (nullable)addressstring requiredkindstring required one ofaccount,contract
ownership_proofobject optionalmethodstring required one ofsigned_challenge,signed_auth_entrychallenge_xdrstring requiredexpires_atstring required
checksobject optionalaccountstring required one ofpresent,missingtrustlinestring required one ofpresent,missingfrozenboolean requiredofferstring required one ofsponsored_trustline(nullable)
has_moreboolean required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
"$API/v1/counterparties?limit=1" \
-H "authorization: Bearer $KEY"SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.GET("/v1/counterparties", {
params: { query: { limit: 1 } },
});POST /v1/counterparties
Send an Idempotency-Key header on every POST so a retry never repeats the request.
Request body
application/json, required
one of
Variant 1:
objecttypestring required one ofbank_accountlabelstring optionalbeneficiary_namestring requiredbank_namestring requiredaccount_numberstring requiredrouting_codestring requiredcurrencystring required one ofUSD,EUR
Variant 2:
objecttypestring required one ofstellar_walletaddressstring requiredlabelstring optional
Responses
201 Default Response
object
idstring requiredtypestring required one ofbank_account,stellar_walletlabelstring required (nullable)statusstring required one ofpending_verification,active,archivedcreated_atstring requiredverified_atstring required (nullable)archived_atstring required (nullable)bank_accountobject required (nullable)beneficiary_namestring requiredbank_namestring requiredaccount_number_last4string requiredrouting_codestring requiredcurrencystring required one ofUSD,EUR
stellar_walletobject required (nullable)addressstring requiredkindstring required one ofaccount,contract
ownership_proofobject optionalmethodstring required one ofsigned_challenge,signed_auth_entrychallenge_xdrstring requiredexpires_atstring required
checksobject optionalaccountstring required one ofpresent,missingtrustlinestring required one ofpresent,missingfrozenboolean requiredofferstring required one ofsponsored_trustline(nullable)
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X POST \
"$API/v1/counterparties" \
-H "authorization: Bearer $KEY" \
-H "idempotency-key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{"type":"bank_account","beneficiary_name":"<beneficiary_name>","bank_name":"<bank_name>","account_number":"<account_number>","routing_code":"<routing_code>","currency":"USD"}'SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key and an Idempotency-Key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.POST("/v1/counterparties", {
body: {
"type": "bank_account",
"beneficiary_name": "<beneficiary_name>",
"bank_name": "<bank_name>",
"account_number": "<account_number>",
"routing_code": "<routing_code>",
"currency": "USD"
},
});GET /v1/counterparties/{id}
Parameters
assetstring optional in queryidstring required in path
Responses
200 Default Response
object
idstring requiredtypestring required one ofbank_account,stellar_walletlabelstring required (nullable)statusstring required one ofpending_verification,active,archivedcreated_atstring requiredverified_atstring required (nullable)archived_atstring required (nullable)bank_accountobject required (nullable)beneficiary_namestring requiredbank_namestring requiredaccount_number_last4string requiredrouting_codestring requiredcurrencystring required one ofUSD,EUR
stellar_walletobject required (nullable)addressstring requiredkindstring required one ofaccount,contract
ownership_proofobject optionalmethodstring required one ofsigned_challenge,signed_auth_entrychallenge_xdrstring requiredexpires_atstring required
checksobject optionalaccountstring required one ofpresent,missingtrustlinestring required one ofpresent,missingfrozenboolean requiredofferstring required one ofsponsored_trustline(nullable)
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
"$API/v1/counterparties/$ID" \
-H "authorization: Bearer $KEY"SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.GET("/v1/counterparties/{id}", {
params: { path: { id: "<id>" } },
});POST /v1/counterparties/{id}/archive
Send an Idempotency-Key header on every POST so a retry never repeats the request.
Parameters
idstring required in path
Request body
application/json, required
object
Responses
200 Default Response
object
idstring requiredtypestring required one ofbank_account,stellar_walletlabelstring required (nullable)statusstring required one ofpending_verification,active,archivedcreated_atstring requiredverified_atstring required (nullable)archived_atstring required (nullable)bank_accountobject required (nullable)beneficiary_namestring requiredbank_namestring requiredaccount_number_last4string requiredrouting_codestring requiredcurrencystring required one ofUSD,EUR
stellar_walletobject required (nullable)addressstring requiredkindstring required one ofaccount,contract
ownership_proofobject optionalmethodstring required one ofsigned_challenge,signed_auth_entrychallenge_xdrstring requiredexpires_atstring required
checksobject optionalaccountstring required one ofpresent,missingtrustlinestring required one ofpresent,missingfrozenboolean requiredofferstring required one ofsponsored_trustline(nullable)
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X POST \
"$API/v1/counterparties/$ID/archive" \
-H "authorization: Bearer $KEY" \
-H "idempotency-key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{}'SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key and an Idempotency-Key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.POST("/v1/counterparties/{id}/archive", {
params: { path: { id: "<id>" } },
body: {},
});POST /v1/counterparties/{id}/ownership-proof
Send an Idempotency-Key header on every POST so a retry never repeats the request.
Parameters
idstring required in path
Request body
application/json, required
object
signed_challenge_xdrstring required
Responses
200 Default Response
object
idstring requiredtypestring required one ofbank_account,stellar_walletlabelstring required (nullable)statusstring required one ofpending_verification,active,archivedcreated_atstring requiredverified_atstring required (nullable)archived_atstring required (nullable)bank_accountobject required (nullable)beneficiary_namestring requiredbank_namestring requiredaccount_number_last4string requiredrouting_codestring requiredcurrencystring required one ofUSD,EUR
stellar_walletobject required (nullable)addressstring requiredkindstring required one ofaccount,contract
ownership_proofobject optionalmethodstring required one ofsigned_challenge,signed_auth_entrychallenge_xdrstring requiredexpires_atstring required
checksobject optionalaccountstring required one ofpresent,missingtrustlinestring required one ofpresent,missingfrozenboolean requiredofferstring required one ofsponsored_trustline(nullable)
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X POST \
"$API/v1/counterparties/$ID/ownership-proof" \
-H "authorization: Bearer $KEY" \
-H "idempotency-key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{"signed_challenge_xdr":"<signed_challenge_xdr>"}'SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key and an Idempotency-Key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.POST("/v1/counterparties/{id}/ownership-proof", {
params: { path: { id: "<id>" } },
body: {
"signed_challenge_xdr": "<signed_challenge_xdr>"
},
});POST /v1/counterparties/{id}/ownership-challenge
Send an Idempotency-Key header on every POST so a retry never repeats the request.
Parameters
idstring required in path
Request body
application/json, required
object
Responses
200 Default Response
object
idstring requiredtypestring required one ofbank_account,stellar_walletlabelstring required (nullable)statusstring required one ofpending_verification,active,archivedcreated_atstring requiredverified_atstring required (nullable)archived_atstring required (nullable)bank_accountobject required (nullable)beneficiary_namestring requiredbank_namestring requiredaccount_number_last4string requiredrouting_codestring requiredcurrencystring required one ofUSD,EUR
stellar_walletobject required (nullable)addressstring requiredkindstring required one ofaccount,contract
ownership_proofobject optionalmethodstring required one ofsigned_challenge,signed_auth_entrychallenge_xdrstring requiredexpires_atstring required
checksobject optionalaccountstring required one ofpresent,missingtrustlinestring required one ofpresent,missingfrozenboolean requiredofferstring required one ofsponsored_trustline(nullable)
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X POST \
"$API/v1/counterparties/$ID/ownership-challenge" \
-H "authorization: Bearer $KEY" \
-H "idempotency-key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{}'SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key and an Idempotency-Key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.POST("/v1/counterparties/{id}/ownership-challenge", {
params: { path: { id: "<id>" } },
body: {},
});POST /v1/counterparties/{id}/sponsored-trustline
Send an Idempotency-Key header on every POST so a retry never repeats the request.
Parameters
idstring required in path
Request body
application/json, required
object
Responses
200 Default Response
object
counterparty_idstring requiredtrustorstring requiredsponsorstring requiredassetobject requiredcodestring requiredissuerstring required
hashstring requiredenvelope_xdrstring requiredexpires_atstring required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X POST \
"$API/v1/counterparties/$ID/sponsored-trustline" \
-H "authorization: Bearer $KEY" \
-H "idempotency-key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{}'SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key and an Idempotency-Key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.POST("/v1/counterparties/{id}/sponsored-trustline", {
params: { path: { id: "<id>" } },
body: {},
});POST /v1/counterparties/{id}/sponsored-trustline/submit
Send an Idempotency-Key header on every POST so a retry never repeats the request.
Parameters
idstring required in path
Request body
application/json, required
object
hashstring requiredsigned_envelope_xdrstring required
Responses
200 Default Response
object
counterparty_idstring requiredhashstring requiredstatusstring required one ofpending,duplicate
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X POST \
"$API/v1/counterparties/$ID/sponsored-trustline/submit" \
-H "authorization: Bearer $KEY" \
-H "idempotency-key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{"hash":"<hash>","signed_envelope_xdr":"<signed_envelope_xdr>"}'SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key and an Idempotency-Key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.POST("/v1/counterparties/{id}/sponsored-trustline/submit", {
params: { path: { id: "<id>" } },
body: {
"hash": "<hash>",
"signed_envelope_xdr": "<signed_envelope_xdr>"
},
});