The Spanish version is the authoritative reference. View in Spanish
361 General Negotiation
π Descriptionβ
Allows registering an electronic negotiable instrument with general negotiation, where any third party can acquire the rights to the instrument. This event must be the first in the negotiable instrument's life cycle.
When to use this endpoint
- When you need to register an electronic invoice as a negotiable instrument
- The instrument will be available for open negotiation in the market
- It is the first event that must be registered before any operation on the instrument
Endpointsβ
POST https://developers-sbx.gosocket.net/api/v1/Document/SendEventToAuthority
POST https://developers.gosocket.net/api/v1/Document/SendEventToAuthority
HTTP Methodβ
POST
Authenticationβ
Type: Basic Auth
You must provide your API credentials in each request via Basic Authentication.
Authorization: Basic base64(username:password)
Body Parametersβ
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
status | string | β Yes | Event status code (036 = Registration) | 036 |
description | string | β Yes | Event type description | Inscripcion |
operationType | string | β Yes | Operation type (361 = General negotiation) | 361 |
valuePaid | string | β Yes | Amount paid at the time of registration (generally 0) | 0 |
valueInvoice | string | β Yes | Total value of the invoice/negotiable instrument | 432000 |
IDEmisor | string | β Yes | NIT of the invoice issuer | 900508908 |
IDEmisorTipo | string | β Yes | Identification type (31 = NIT) | 31 |
NombreEmisor | string | β Yes | Legal name of the issuer | Signature South Consulting |
InvoiceID | string | β Yes | Electronic invoice number | SETP991010111 |
docType | string | β Yes | Document type (01 = Sales invoice) | 01 |
CUFEInvoice | string | β Yes | CUFE (Unique Electronic Invoice Code) | 36bc2f7c4d018b3dcb8935129ec0... |
IssueDate | string | β Yes | Invoice issue date (format: YYYY-MM-DD) | 2023-01-03 |
EndDateInvoice | string | β Yes | Instrument due date (format: YYYY-MM-DD) | 2023-01-13 |
Code Examplesβ
- π§ cURL
- π Python
- β‘ JavaScript
- π PHP
- β Java
- π’ Node.js
- π Ruby
- π· C#
- π PowerShell
curl -X POST 'https://developers-sbx.gosocket.net/api/v1/Document/SendEventToAuthority' \
-u 'username:password' \
-d '{
"status": "036",
"description": "Inscripcion",
"operationType": "361",
"valuePaid": "0",
"valueInvoice": "432000",
"IDEmisor": "900508908",
"IDEmisorTipo": "31",
"NombreEmisor": "Signature South Consulting",
"InvoiceID": "SETP991010111",
"docType": "01",
"CUFEInvoice": "36bc2f7c4d018b3dcb8935129ec0fdf5f01bd7f1ff8867037766a837d73f1c51e9d1c3eaada76a94d6751de8ceeccdc6",
"IssueDate": "2023-01-03",
"EndDateInvoice": "2023-01-13"
}'
import requests
import json
url = "https://developers-sbx.gosocket.net/api/v1/Document/SendEventToAuthority"
payload = {
"status":"036",
"description":"Inscripcion",
"operationType":"361",
"valuePaid":"0",
"valueInvoice":"432000",
"IDEmisor":"900508908",
"IDEmisorTipo":"31",
"NombreEmisor":"Signature South Consulting",
"InvoiceID":"SETP991010111",
"docType":"01",
"CUFEInvoice":"36bc2f7c4d018b3dcb8935129ec0fdf5f01bd7f1ff8867037766a837d73f1c51e9d1c3eaada76a94d6751de8ceeccdc6",
"IssueDate":"2023-01-03",
"EndDateInvoice":"2023-01-13"
}
response = requests.post(url, headers=headers, json=payload, auth=("username", "password"))
print(response.status_code)
print(response.json())
const axios = require('axios');
const url = 'https://developers-sbx.gosocket.net/api/v1/Document/SendEventToAuthority';
const config = {
method: 'post',
url: url,
auth: {
username: 'username',
password: 'password'
},
data: {
"status":"036",
"description":"Inscripcion",
"operationType":"361",
"valuePaid":"0",
"valueInvoice":"432000",
"IDEmisor":"900508908",
"IDEmisorTipo":"31",
"NombreEmisor":"Signature South Consulting",
"InvoiceID":"SETP991010111",
"docType":"01",
"CUFEInvoice":"36bc2f7c4d018b3dcb8935129ec0fdf5f01bd7f1ff8867037766a837d73f1c51e9d1c3eaada76a94d6751de8ceeccdc6",
"IssueDate":"2023-01-03",
"EndDateInvoice":"2023-01-13"
}
};
axios(config)
.then(response => {
console.log(response.status);
console.log(JSON.stringify(response.data, null, 2));
})
.catch(error => {
console.error(error);
});
<?php
$url = "https://developers-sbx.gosocket.net/api/v1/Document/SendEventToAuthority";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
$data = json_encode({
"status":"036",
"description":"Inscripcion",
"operationType":"361",
"valuePaid":"0",
"valueInvoice":"432000",
"IDEmisor":"900508908",
"IDEmisorTipo":"31",
"NombreEmisor":"Signature South Consulting",
"InvoiceID":"SETP991010111",
"docType":"01",
"CUFEInvoice":"36bc2f7c4d018b3dcb8935129ec0fdf5f01bd7f1ff8867037766a837d73f1c51e9d1c3eaada76a94d6751de8ceeccdc6",
"IssueDate":"2023-01-03",
"EndDateInvoice":"2023-01-13"
});
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo "Status: " . $httpCode . "\n";
echo $response;
?>
import java.net.http.*;
import java.net.URI;
import java.util.Base64;
public class ApiExample {
public static void main(String[] args) throws Exception {
String url = "https://developers-sbx.gosocket.net/api/v1/Document/SendEventToAuthority";
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create(url))
.method("POST", HttpRequest.BodyPublishers.ofString(
"""{
"status":"036",
"description":"Inscripcion",
"operationType":"361",
"valuePaid":"0",
"valueInvoice":"432000",
"IDEmisor":"900508908",
"IDEmisorTipo":"31",
"NombreEmisor":"Signature South Consulting",
"InvoiceID":"SETP991010111",
"docType":"01",
"CUFEInvoice":"36bc2f7c4d018b3dcb8935129ec0fdf5f01bd7f1ff8867037766a837d73f1c51e9d1c3eaada76a94d6751de8ceeccdc6",
"IssueDate":"2023-01-03",
"EndDateInvoice":"2023-01-13"
}"""
));
String auth = "username:password";
String encodedAuth = Base64.getEncoder().encodeToString(auth.getBytes());
requestBuilder.header("Authorization", "Basic " + encodedAuth);
HttpRequest request = requestBuilder.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println("Status: " + response.statusCode());
System.out.println(response.body());
}
}
const https = require('https');
const data = JSON.stringify({
"status": "036",
"description": "Inscripcion",
"operationType": "361",
"valuePaid": "0",
"valueInvoice": "432000",
"IDEmisor": "900508908",
"IDEmisorTipo": "31",
"NombreEmisor": "Signature South Consulting",
"InvoiceID": "SETP991010111",
"docType": "01",
"CUFEInvoice": "36bc2f7c4d018b3dcb8935129ec0fdf5f01bd7f1ff8867037766a837d73f1c51e9d1c3eaada76a94d6751de8ceeccdc6",
"IssueDate": "2023-01-03",
"EndDateInvoice": "2023-01-13"
});
const auth = Buffer.from('username:password').toString('base64');
const options = {
hostname: 'developers-sbx.gosocket.net',
path: '/api/v1/Document/SendEventToAuthority',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Basic ${auth}`,
'Content-Length': data.length
}
};
const req = https.request(options, (res) => {
let responseData = '';
res.on('data', (chunk) => {
responseData += chunk;
});
res.on('end', () => {
console.log('Status:', res.statusCode);
console.log('Response:', JSON.parse(responseData));
});
});
req.on('error', (error) => {
console.error('Error:', error);
});
req.write(data);
req.end();
require 'net/http'
require 'uri'
require 'json'
uri = URI.parse("https://developers-sbx.gosocket.net/api/v1/Document/SendEventToAuthority")
request = Net::HTTP::Post.new(uri)
request.basic_auth("username", "password")
request.content_type = "application/json"
request.body = JSON.dump({
"status": "036",
"description": "Inscripcion",
"operationType": "361",
"valuePaid": "0",
"valueInvoice": "432000",
"IDEmisor": "900508908",
"IDEmisorTipo": "31",
"NombreEmisor": "Signature South Consulting",
"InvoiceID": "SETP991010111",
"docType": "01",
"CUFEInvoice": "36bc2f7c4d018b3dcb8935129ec0fdf5f01bd7f1ff8867037766a837d73f1c51e9d1c3eaada76a94d6751de8ceeccdc6",
"IssueDate": "2023-01-03",
"EndDateInvoice": "2023-01-13"
})
req_options = {
use_ssl: uri.scheme == "https",
}
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(request)
end
puts "Status: #{response.code}"
puts response.body
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var client = new HttpClient();
var url = "https://developers-sbx.gosocket.net/api/v1/Document/SendEventToAuthority";
// Basic Authentication
var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes("username:password"));
client.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", credentials);
var json = @"{
\"status\": \"036\",
\"description\": \"Inscripcion\",
\"operationType\": \"361\",
\"valuePaid\": \"0\",
\"valueInvoice\": \"432000\",
\"IDEmisor\": \"900508908\",
\"IDEmisorTipo\": \"31\",
\"NombreEmisor\": \"Signature South Consulting\",
\"InvoiceID\": \"SETP991010111\",
\"docType\": \"01\",
\"CUFEInvoice\": \"36bc2f7c4d018b3dcb8935129ec0fdf5f01bd7f1ff8867037766a837d73f1c51e9d1c3eaada76a94d6751de8ceeccdc6\",
\"IssueDate\": \"2023-01-03\",
\"EndDateInvoice\": \"2023-01-13\"
}";
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine($"Status: {(int)response.StatusCode}");
Console.WriteLine(responseBody);
}
}
$url = "https://developers-sbx.gosocket.net/api/v1/Document/SendEventToAuthority"
$headers = @{
"Content-Type" = "application/json"
}
$body = @'{
"status": "036",
"description": "Inscripcion",
"operationType": "361",
"valuePaid": "0",
"valueInvoice": "432000",
"IDEmisor": "900508908",
"IDEmisorTipo": "31",
"NombreEmisor": "Signature South Consulting",
"InvoiceID": "SETP991010111",
"docType": "01",
"CUFEInvoice": "36bc2f7c4d018b3dcb8935129ec0fdf5f01bd7f1ff8867037766a837d73f1c51e9d1c3eaada76a94d6751de8ceeccdc6",
"IssueDate": "2023-01-03",
"EndDateInvoice": "2023-01-13"
}'@
$credentials = "username:password"
$encodedCredentials = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($credentials))
$headers["Authorization"] = "Basic $encodedCredentials"
try {
$response = Invoke-RestMethod -Uri $url -Method Post -Headers $headers -Body $body
Write-Host "Status: 200"
Write-Host ($response | ConvertTo-Json -Depth 10)
} catch {
Write-Host "Status: $($_.Exception.Response.StatusCode.value__)"
Write-Host $_.Exception.Message
}
π Request Example (JSON)β
{
"status": "036",
"description": "Inscripcion",
"operationType": "361",
"valuePaid": "0",
"valueInvoice": "432000",
"IDEmisor": "900508908",
"IDEmisorTipo": "31",
"NombreEmisor": "Signature South Consulting",
"InvoiceID": "SETP991010111",
"docType": "01",
"CUFEInvoice": "36bc2f7c4d018b3dcb8935129ec0fdf5f01bd7f1ff8867037766a837d73f1c51e9d1c3eaada76a94d6751de8ceeccdc6",
"IssueDate": "2023-01-03",
"EndDateInvoice": "2023-01-13"
}