POST
/tenants/{tenantId}/purchases/suppliers
tenantCreateSupplier · Procurement
USER requires active membership and fresh permissions. Supplier management uses purchases.read/create; approval/cancellation requires purchases.approve. Drafts can be fully replaced with expectedVersion; approval fixes the snapshot. Receipts require purchase creation/write AND Inventory adjustment/write. They atomically append PURCHASE_RECEIPT movements/new serial units, preserve exact costs, update received/pending projections, audit, replay and outbox. No excess receipt, reused serial identity, direct stock edits, unit identifiers in receipt DTOs, valuation, FX, tax, invoice or payment. Services/untracked lines use administrative acceptance without inventory effects. Cancel an open order to stop outstanding incoming; previously posted receipts remain. Lists use UUIDv7 cursor50/max100; incoming is outstanding per open approved order line, excludes drafts/cancelled. Decimals are strings: costs/quantities scale6, quantity*cost totals scale12 without rounding. Up to100 distinct lines and100 units total per receipt. Order number+LegalEntity are immutable; supplier code remains reserved. No anonymous access or business UI.
- Autenticación
- SupabaseBearer · http bearer
- required-permissions
purchases.create
Ejemplo
Los valores entre <> y {} son marcadores: sustitúyelos
por los tuyos antes de ejecutarlo.
curl --request POST \
--url 'https://api.marky.ec/v1/tenants/{tenantId}/purchases/suppliers' \
--header 'Authorization: Bearer <SupabaseBearer>' \
--header 'Idempotency-Key: <Idempotency-Key>' \
--header 'Content-Type: application/json' \
--data @body.json
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
tenantIdobligatorio
|
path | stringformato uuidpatrón ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ |
|
Idempotency-Keyobligatorio
|
header | stringformato uuid |
UUIDv4/v7; replay24h under fresh authorization, input fingerprint bound to aggregate ID. |
Cuerpo (obligatorio)
application/jsonSupplierInput
objectsin otras propiedades
-
codeobligatoriostringpatrón ^[a-zA-Z][a-zA-Z0-9_.-]*$longitud mín. 1longitud máx. 64 -
nameobligatoriostringlongitud mín. 1longitud máx. 200 -
taxIdstring | nulllongitud máx. 64 -
emailstring | nulllongitud máx. 254 -
phonestring | nulllongitud máx. 64 -
addressstring | nulllongitud máx. 1000Free text of up to 1000 characters. May hold several lines (CRLF is stored as LF); any other control character is refused.
-
profileContactProfileInputobject | nullsin otras propiedadesExtended record (CONTACTS-1), replaced whole when sent: a key left out or null is not stated. Null or {} clears it. Left out of an update, the stored profile is kept; left out of a creation, the profile starts empty. Strings are trimmed and never blank; unknown keys are refused.
-
contactTypestring | nulluno de "COMPANY", "PERSON", null -
companyNamestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 200Legal name.
-
tradeNamestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 200 -
taxIdTypestring | nulluno de "RUC", "CEDULA", "PASSPORT", "OTHER", nullWhat the taxId of the record is.
-
taxIdTypeOtherstring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 40Names the identification. Accepted only with taxIdType OTHER.
-
websitestring | nullpatrón ^[hH][tT][tT][pP][sS]?://[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?(:[0-9]{1,5})?([/?#][^\s\\]*)?$longitud máx. 500http or https only, with a host and without credentials.
-
mobilestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 64 -
languagestring | nulluno de "es", "en", "pt", "fr", "other", null -
primaryContactobject | nullsin otras propiedadesThe person the record is addressed to. Their email and phone are the email and phone of the record.
-
salutationstring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 20 -
firstNamestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 100 -
lastNamestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 100 -
jobTitlestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 100 -
departmentstring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 100
-
-
billingAddressobject | nullsin otras propiedades-
attentionstring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 200 -
countryCodestring | nullpatrón ^[A-Za-z]{2}$ISO 3166-1 alpha-2. Stored in capitals.
-
statestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 100 -
citystring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 100 -
street1string | nullpatrón ^[^\u0000-\u0009\u000b-\u001f\u007f-\u009f]*\S[^\u0000-\u0009\u000b-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 200May hold several lines.
-
street2string | nullpatrón ^[^\u0000-\u0009\u000b-\u001f\u007f-\u009f]*\S[^\u0000-\u0009\u000b-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 200May hold several lines.
-
postalCodestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 20 -
phonestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 64
-
-
shippingAddressobject | nullsin otras propiedadesIts own values: it is never linked to the billing address.
-
attentionstring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 200 -
countryCodestring | nullpatrón ^[A-Za-z]{2}$ISO 3166-1 alpha-2. Stored in capitals.
-
statestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 100 -
citystring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 100 -
street1string | nullpatrón ^[^\u0000-\u0009\u000b-\u001f\u007f-\u009f]*\S[^\u0000-\u0009\u000b-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 200May hold several lines.
-
street2string | nullpatrón ^[^\u0000-\u0009\u000b-\u001f\u007f-\u009f]*\S[^\u0000-\u0009\u000b-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 200May hold several lines.
-
postalCodestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 20 -
phonestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 64
-
-
contactPersonsarray | nullelementos máx. 20Further people, at most 20. Written, each one states at least one value.
Cada elementoobjectpropiedades mín. 1sin otras propiedades-
firstNamestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 100 -
lastNamestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 100 -
jobTitlestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 100 -
departmentstring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 100 -
emailstring | nullpatrón ^[^\s@]+@[^\s@]+\.[^\s@]+$longitud máx. 254 -
phonestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 64 -
mobilestring | nullpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 64
-
-
currencyCodestring | nullpatrón ^[a-zA-Z]{3}$Preferred ISO 4217 currency among the supported ones, stored in capitals. Documents keep stating their own.
-
paymentTermsDaysinteger | nullmín. 0máx. 3650Informative: no due date, credit or charge is derived from it.
-
notesstring | nullpatrón ^[^\u0000-\u0009\u000b-\u001f\u007f-\u009f]*\S[^\u0000-\u0009\u000b-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 4000May hold several lines.
-
tagsarray | nullelementos máx. 20At most 20, unique without regard to case.
Cada elementostringpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 40 -
customFieldsarray | nullelementos máx. 20At most 20 name/value pairs with unique names.
Cada elementoobjectsin otras propiedades-
nameobligatoriostringpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 64 -
valueobligatoriostringpatrón ^[^\u0000-\u001f\u007f-\u009f]*\S[^\u0000-\u001f\u007f-\u009f]*$longitud mín. 1longitud máx. 500
-
-
Respuestas
201 Success
-
Cache-Controlvalor fijo "no-store"
application/jsonSupplierReceipt
objectsin otras propiedades
-
idobligatoriostringformato uuidpatrón ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ -
statusobligatoriostringuno de "ACTIVE", "ARCHIVED" -
createdAtobligatoriostringformato date-time -
updatedAtobligatoriostringformato date-time
400 Invalid request
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
401 Missing or invalid access token
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
403 Identity, membership or permission denied
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
404 Unknown resource
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
409 Duplicate permanent identity/IMEI, stale unit version, reserved/illegal unit state, custody/legal entity constraint or idempotency conflict.
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
413 Payload too large
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
429 Per-minute rate or monthly quota exceeded; authenticated API clients require PUBLIC_API entitlement.
-
Retry-Afterintegermín. 1Seconds before retrying; quota reset is UTC next month.
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
500 Internal failure
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
503 Auth/database/governance unavailable; no memory fallback for Redis.
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-