Skip to main content
REST client

Sellers

The 6 operations under sellers, as typed calls on the generated REST client.

1 min read
View MarkdownEdit on GitHub

Sellers

Available from @codespar/sdk 0.12.0, which is not on npm yet. The published version today is 0.11.0, and it has no cs.api; 0.12.0 is on the main branch of codespar-core. The examples below are not compiled against the installed package for that reason.

Every call below is cs.api reaching one operation of the OpenAPI document this page was generated from; the REST client overview explains request, response, the option bag and the errors. The values are placeholders shaped by the document.

import { CodeSpar } from "@codespar/sdk";

const cs = new CodeSpar({ apiKey: process.env.CODESPAR_API_KEY });

POST /v1/sellers

POST/v1/sellers

Onboard a seller (KYB) and affiliate it at Rinne

const result = await cs.api.post("/v1/sellers", {
  body: {
    full_name: "Example",
    name: "Example",
    document_number: "string",
    document_type: "CNPJ",
    document_tax_type: "PJ",
    mcc: "string",
    contact: {},
    address: {},
    transfer_configurations: {
      automatic_transfer_enabled: true,
      transfer_frequency: "DAILY",
      rail: "PIX",
      utc_hour_of_day: 0,
      day_of_week: 0,
      day_of_month: 0,
      min_balance: 1000
    },
    declared_revenue: 0,
    declared_income: 0,
    net_worth: 0,
    company_logo_url: "https://example.com/hook",
    website_url: "https://example.com/hook",
    fee_policy_id: "feepolicy_0000000000000000",
    metadata: {},
    linked_consumer_id: "linkedconsumer_0000000000000000",
    allowed_capture_methods: [
      "string"
    ],
    allowed_payment_methods: [
      "string"
    ]
  }
});

Parameters, body and every documented response: POST /v1/sellers in the HTTP reference.

GET /v1/sellers/{sellerId}

GET/v1/sellers/{sellerId}

Read one seller

const result = await cs.api.get("/v1/sellers/{sellerId}", {
  path: {
    sellerId: "slr_0000000000000000"
  }
});

Parameters, body and every documented response: GET /v1/sellers/{sellerId} in the HTTP reference.

GET /v1/sellers/{sellerId}/custody

GET/v1/sellers/{sellerId}/custody

Compare this seller's ledger against Rinne's custody

const result = await cs.api.get("/v1/sellers/{sellerId}/custody", {
  path: {
    sellerId: "slr_0000000000000000"
  }
});

Parameters, body and every documented response: GET /v1/sellers/{sellerId}/custody in the HTTP reference.

GET /v1/sellers/{sellerId}/ledger

GET/v1/sellers/{sellerId}/ledger

This seller's wallet ledger, without learning the wallet id

const result = await cs.api.get("/v1/sellers/{sellerId}/ledger", {
  path: {
    sellerId: "slr_0000000000000000"
  }
});

Parameters, body and every documented response: GET /v1/sellers/{sellerId}/ledger in the HTTP reference.

GET /v1/sellers/{sellerId}/pending-settlement

GET/v1/sellers/{sellerId}/pending-settlement

What Rinne reports as sold but not yet settled

const result = await cs.api.get("/v1/sellers/{sellerId}/pending-settlement", {
  path: {
    sellerId: "slr_0000000000000000"
  }
});

Parameters, body and every documented response: GET /v1/sellers/{sellerId}/pending-settlement in the HTTP reference.

GET /v1/sellers/{sellerId}/status

GET/v1/sellers/{sellerId}/status

Refresh a seller's affiliation status from Rinne

const result = await cs.api.get("/v1/sellers/{sellerId}/status", {
  path: {
    sellerId: "slr_0000000000000000"
  }
});

Parameters, body and every documented response: GET /v1/sellers/{sellerId}/status in the HTTP reference.

Sellers | CodeSpar