1# POST /v1/transactions
2require "cogentailit"
3
4client = CogentailIT::Client.new(
5 api_key: ENV["COGENTAILIT_API_KEY"]
6)
7
8invoice = client.invoices.create({
9 interchange: {
10 sender_id: "COGENTAILIT",
11 receiver_id: "ACME_LOGISTICS",
12 usage: "PRODUCTION"
13 },
14 invoice: {
15 number: "INV-2024-0847",
16 date: "2024-06-14",
17 terms: "NET 30",
18 total: 12500.00
19 }
20})
21
22puts invoice.state
23# => "delivered to ACME_LOGISTICS"
1// POST /v1/transactions
2import CogentailIT from "@cogentailit/sdk";
3
4const client = new CogentailIT({
5 apiKey: process.env.COGENTAILIT_API_KEY,
6});
7
8const invoice = await client.invoices.create({
9 interchange: {
10 senderId: "COGENTAILIT",
11 receiverId: "ACME_LOGISTICS",
12 usage: "PRODUCTION",
13 },
14 invoice: {
15 number: "INV-2024-0847",
16 date: "2024-06-14",
17 terms: "NET 30",
18 total: 12500.00,
19 },
20});
21
22console.log(invoice.state);
23// => "delivered to ACME_LOGISTICS"
1# POST /v1/transactions
2import os
3from cogentailit import CogentailIT
4
5client = CogentailIT(
6 api_key=os.environ["COGENTAILIT_API_KEY"]
7)
8
9invoice = client.invoices.create({
10 "interchange": {
11 "sender_id": "COGENTAILIT",
12 "receiver_id": "ACME_LOGISTICS",
13 "usage": "PRODUCTION",
14 },
15 "invoice": {
16 "number": "INV-2024-0847",
17 "date": "2024-06-14",
18 "terms": "NET 30",
19 "total": 12500.00,
20 },
21})
22print(invoice.state)
23# => "delivered to ACME_LOGISTICS"