Skip to content

Commit 7585abc

Browse files
chore(defaultSeries): add new default series method (#249)
1 parent ab15a5f commit 7585abc

2 files changed

Lines changed: 256 additions & 2 deletions

File tree

website/openapi_v2.en.yaml

Lines changed: 128 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8028,7 +8028,107 @@ paths:
80288028
$ref: "#/components/responses/Unauthenticated"
80298029
"500":
80308030
$ref: "#/components/responses/UnexpectedError"
8031-
8031+
8032+
/organizations/{organization_id}/series-group/default-series:
8033+
put:
8034+
operationId: updateDefaultSeries
8035+
tags:
8036+
- organization
8037+
summary: Set default series
8038+
description: |
8039+
Assigns a default series for the specified invoice type.
8040+
x-codeSamples:
8041+
- lang: Bash
8042+
label: cURL
8043+
source: |
8044+
curl https://www.facturapi.io/v2/organizations/5a2a307be93a2f00129ea035/series-group/default-series \
8045+
-X PUT \
8046+
-H "Authorization: Bearer sk_user_API_KEY" \
8047+
-H "Content-Type: application/json" \
8048+
-d '{
8049+
"type": "I",
8050+
"series": "A"
8051+
}'
8052+
- lang: JavaScript
8053+
label: Node.js
8054+
source: |
8055+
import Facturapi from 'facturapi'
8056+
const facturapi = new Facturapi('sk_user_API_KEY');
8057+
8058+
const result = await facturapi.organizations.updateDefaultSeries(
8059+
'5a2a307be93a2f00129ea035',
8060+
{
8061+
type: 'I',
8062+
series: 'A'
8063+
}
8064+
);
8065+
- lang: csharp
8066+
label: C#
8067+
source: |
8068+
var facturapi = new FacturapiClient("sk_user_API_KEY");
8069+
var result = await facturapi.Organization.UpdateDefaultSeriesAsync(
8070+
"5a2a307be93a2f00129ea035",
8071+
new Dictionary<string, object>
8072+
{
8073+
["type"] = "I",
8074+
["series"] = "A"
8075+
}
8076+
);
8077+
- lang: Java
8078+
label: Java
8079+
source: |
8080+
import io.facturapi.Facturapi;
8081+
import java.util.List;
8082+
import java.util.Map;
8083+
8084+
Facturapi facturapi = new Facturapi("sk_test_API_KEY");
8085+
8086+
var response = facturapi.organizations().updateDefaultSeries(
8087+
"org_123",
8088+
Map.of(
8089+
"type", "I",
8090+
"series", "A"
8091+
)
8092+
);
8093+
- lang: PHP
8094+
source: |
8095+
$facturapi = new Facturapi("sk_user_API_KEY");
8096+
$result = $facturapi->Organizations->updateDefaultSeries(
8097+
"5a2a307be93a2f00129ea035",
8098+
[
8099+
"type" => "I",
8100+
"series" => "A"
8101+
]
8102+
);
8103+
requestBody:
8104+
$ref: "#/components/requestBodies/OrganizationSeriesDefault"
8105+
parameters:
8106+
- in: path
8107+
name: organization_id
8108+
schema:
8109+
type: string
8110+
required: true
8111+
description: Organization ID
8112+
security:
8113+
- "SecretLiveKey": []
8114+
- "SecretTestKey": []
8115+
- "SecretUserKey": []
8116+
responses:
8117+
"200":
8118+
description: Default series updated
8119+
content:
8120+
application/json:
8121+
schema:
8122+
$ref: "#/components/schemas/OkResponse"
8123+
"400":
8124+
$ref: "#/components/responses/BadRequest"
8125+
"401":
8126+
$ref: "#/components/responses/Unauthenticated"
8127+
"404":
8128+
$ref: "#/components/responses/NotFound"
8129+
"500":
8130+
$ref: "#/components/responses/UnexpectedError"
8131+
80328132
/organizations/{organization_id}/series-group/{series_name}:
80338133
put:
80348134
operationId: updateSeriesGroup
@@ -10524,6 +10624,11 @@ components:
1052410624
application/json:
1052510625
schema:
1052610626
$ref: "#/components/schemas/OrganizationSeriesUpdateInput"
10627+
OrganizationSeriesDefault:
10628+
content:
10629+
application/json:
10630+
schema:
10631+
$ref: "#/components/schemas/OrganizationSeriesDefaultInput"
1052710632
OrganizationInviteCreate:
1052810633
required: true
1052910634
content:
@@ -15995,6 +16100,28 @@ components:
1599516100
next_folio_test:
1599616101
type: integer
1599716102
description: Folio number that will be assigned to the next invoice in the Test environment (and will automatically increase with each new invoice).
16103+
OrganizationSeriesDefaultInput:
16104+
type: object
16105+
required:
16106+
- type
16107+
- series
16108+
properties:
16109+
type:
16110+
type: string
16111+
enum:
16112+
- I
16113+
- E
16114+
- P
16115+
- N
16116+
- T
16117+
description: |
16118+
Invoice type. Possible values:
16119+
`I` (Income), `E` (Expense), `P` (Payment), `N` (Payroll), `T` (Transfer).
16120+
series:
16121+
type: string
16122+
minLength: 1
16123+
maxLength: 25
16124+
description: Series name.
1599816125
OrganizationSeriesGroup:
1599916126
title: Objeto Series
1600016127
type: object

website/openapi_v2.yaml

Lines changed: 128 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8222,7 +8222,107 @@ paths:
82228222
$ref: "#/components/responses/Unauthenticated"
82238223
"500":
82248224
$ref: "#/components/responses/UnexpectedError"
8225-
8225+
8226+
/organizations/{organization_id}/series-group/default-series:
8227+
put:
8228+
operationId: updateDefaultSeries
8229+
tags:
8230+
- organization
8231+
summary: Establecer serie predeterminada
8232+
description: |
8233+
Asigna una serie predeterminada para el tipo de comprobante indicado.
8234+
x-codeSamples:
8235+
- lang: Bash
8236+
label: cURL
8237+
source: |
8238+
curl https://www.facturapi.io/v2/organizations/5a2a307be93a2f00129ea035/series-group/default-series \
8239+
-X PUT \
8240+
-H "Authorization: Bearer sk_user_API_KEY" \
8241+
-H "Content-Type: application/json" \
8242+
-d '{
8243+
"type": "I",
8244+
"series": "A"
8245+
}'
8246+
- lang: JavaScript
8247+
label: Node.js
8248+
source: |
8249+
import Facturapi from 'facturapi'
8250+
const facturapi = new Facturapi('sk_user_API_KEY');
8251+
8252+
const result = await facturapi.organizations.updateDefaultSeries(
8253+
'5a2a307be93a2f00129ea035',
8254+
{
8255+
type: 'I',
8256+
series: 'A'
8257+
}
8258+
);
8259+
- lang: csharp
8260+
label: C#
8261+
source: |
8262+
var facturapi = new FacturapiClient("sk_user_API_KEY");
8263+
var result = await facturapi.Organization.UpdateDefaultSeriesAsync(
8264+
"5a2a307be93a2f00129ea035",
8265+
new Dictionary<string, object>
8266+
{
8267+
["type"] = "I",
8268+
["series"] = "A"
8269+
}
8270+
);
8271+
- lang: Java
8272+
label: Java
8273+
source: |
8274+
import io.facturapi.Facturapi;
8275+
import java.util.List;
8276+
import java.util.Map;
8277+
8278+
Facturapi facturapi = new Facturapi("sk_test_API_KEY");
8279+
8280+
var response = facturapi.organizations().updateDefaultSeries(
8281+
"org_123",
8282+
Map.of(
8283+
"type", "I",
8284+
"series", "A"
8285+
)
8286+
);
8287+
- lang: PHP
8288+
source: |
8289+
$facturapi = new Facturapi("sk_user_API_KEY");
8290+
$result = $facturapi->Organizations->updateDefaultSeries(
8291+
"5a2a307be93a2f00129ea035",
8292+
[
8293+
"type" => "I",
8294+
"series" => "A"
8295+
]
8296+
);
8297+
requestBody:
8298+
$ref: "#/components/requestBodies/OrganizationSeriesDefault"
8299+
parameters:
8300+
- in: path
8301+
name: organization_id
8302+
schema:
8303+
type: string
8304+
required: true
8305+
description: ID de la organización
8306+
security:
8307+
- "SecretLiveKey": []
8308+
- "SecretTestKey": []
8309+
- "SecretUserKey": []
8310+
responses:
8311+
"200":
8312+
description: Serie predeterminada actualizada
8313+
content:
8314+
application/json:
8315+
schema:
8316+
$ref: "#/components/schemas/OkResponse"
8317+
"400":
8318+
$ref: "#/components/responses/BadRequest"
8319+
"401":
8320+
$ref: "#/components/responses/Unauthenticated"
8321+
"404":
8322+
$ref: "#/components/responses/NotFound"
8323+
"500":
8324+
$ref: "#/components/responses/UnexpectedError"
8325+
82268326
/organizations/{organization_id}/series-group/{series_name}:
82278327
put:
82288328
operationId: updateSeriesGroup
@@ -10709,6 +10809,11 @@ components:
1070910809
application/json:
1071010810
schema:
1071110811
$ref: "#/components/schemas/OrganizationSeriesUpdateInput"
10812+
OrganizationSeriesDefault:
10813+
content:
10814+
application/json:
10815+
schema:
10816+
$ref: "#/components/schemas/OrganizationSeriesDefaultInput"
1071210817
OrganizationInviteCreate:
1071310818
required: true
1071410819
content:
@@ -16205,6 +16310,28 @@ components:
1620516310
next_folio_test:
1620616311
type: integer
1620716312
description: Número de folio que se asignará a la siguiente factura en ambiente Test (y que se incrementará automáticamente por cada nueva factura).
16313+
OrganizationSeriesDefaultInput:
16314+
type: object
16315+
required:
16316+
- type
16317+
- series
16318+
properties:
16319+
type:
16320+
type: string
16321+
enum:
16322+
- I
16323+
- E
16324+
- P
16325+
- N
16326+
- T
16327+
description: |
16328+
Tipo de comprobante. Valores posibles:
16329+
`I` (Ingreso), `E` (Egreso), `P` (Pago), `N` (Nómina), `T` (Traslado).
16330+
series:
16331+
type: string
16332+
minLength: 1
16333+
maxLength: 25
16334+
description: Nombre de la serie.
1620816335
OrganizationSeriesGroup:
1620916336
title: Objeto Series
1621016337
type: object

0 commit comments

Comments
 (0)