Obtener espacio de trabajo de comprador
Devuelve el resumen del panel del comprador.
GET/v1/workspaces/{regionId}/buyer
Parámetros
fromstringFecha/marca de tiempo ISO 8601: solo se devuelven los elementos creados en esta fecha o después.
tostringFecha/marca de tiempo ISO 8601: solo se devuelven los elementos creados en esta fecha o antes.
Devuelve
200 OK con el objeto que se muestra en la respuesta.
Más detalles
Devuelve la instantánea del panel del comprador: las cuentas de nube conectadas, las órdenes de compra y las facturas de esta región. Requiere el rol de comprador en este espacio de trabajo. Opcionalmente se limita a un rango de createdAt mediante from/to: pasa los límites de un mes natural para obtener una vista mensual.
Errores
- 401 Unauthorized - No se presentó ninguna credencial, o el token Bearer o el valor de X-Api-Key falta, no es válido, caducó o fue revocado.
- 403 Forbidden - El llamador no tiene el rol de comprador en este espacio de trabajo, o no tiene ningún acceso a él.
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/buyer" \
-H "X-Api-Key: $PLEAXY_API_KEY"{
"cloudConnections": [ {
"id": "string",
"provider": "aws" | "gcp" | "azure" | "oci",
"accountLabel": "string",
"detail": "string",
"spend": number,
"status": "connected" | "pending" | "error",
"connectedAt": "string",
"awsAccountId": "string",
"dataSources": [ "invoices" | "current_cost" ],
"gcp": { "billingAccountId": "string", "providerId": "string" },
"oci": { "homeRegion": "string", "keyFingerprint": "string" },
"azure": { "scopeDisplayName": "string", "agreementType": "string" },
"lastSyncedAt": "string",
"lastSyncStatus": "ok" | "error" | "throttled" | "never",
"lastSyncError": "string",
"lastSyncErrorCode": "throttled" | "access_revoked" | "platform_config" | "data_not_enabled" | "unknown"
} ],
"purchaseOrders": [ {
"id": "string",
"buyerOrgId": "string",
"supplierOrgId": "string",
"supplier": "string",
"amount": number,
"currency": "string",
"status": "draft" | "pending_approval" | "rejected" | "awaiting_fulfillment" | "invoiced" | "paid" | "canceled" | "closed" | "expired",
"invoiceId": "string",
"provider": "aws" | "gcp" | "azure" | "oci",
"payerAccounts": [
{ "id": "string", "label": "string", "detail": "string" }
],
"billToParty": {
"source": "company_profile" | "custom",
"companyName": "string",
"address": { "line1": "string", "line2": "string", "city": "string", "region": "string", "postalCode": "string", "country": "string" },
"addressText": "string",
"taxId": "string"
},
"costCenter": "string",
"costCenterChanges": [ { "from": "string", "to": "string", "reason": "string", "by": "string", "byName": "string", "at": "string" } ],
"budgetOwner": "string",
"buyerName": "string",
"supplierSite": "string",
"notes": "string",
"requestId": "string",
"lineItems": [
{
"lineNo": number,
"scopeType": "sku" | "service" | "account" | "custom",
"scopeId": "string" | null,
"name": "string",
"ruleType": "quantity" | "amount",
"unit": "string",
"unitPrice": number,
"qty": number,
"nteAmount": number,
"lineType": "goods" | "service",
"currency": "string",
"paymentTerms": "string",
"validFrom": "string",
"validUntil": "string",
"consumed": number,
"customerLineNo": "string",
"supplierSku": "string",
"priceSource": "contract" | "list" | "manual"
}
],
"approval": {
"requester": "string",
"requesterEmployeeKey": "string",
"groups": [
{
"id": "string",
"mode": "sequential" | "parallel",
"label": "string",
"status": "pending" | "approved" | "rejected",
"stages": [
{ "id": "string", "label": "string", "approverEmployeeKey": "string", "approverName": "string", "status": "pending" | "approved" | "rejected" }
]
}
],
"groupIndex": number,
"status": "pending" | "approved" | "rejected",
"history": [
{ "stage": "string", "by": "string", "at": "string", "action": "approved" | "rejected" | "limit_exceeded" | "reassigned" | "skipped" }
],
"autonomy": boolean,
"selfApproved": boolean
},
"supplierEmail": { "to": "string", "at": "string" },
"priorInvoiced": { "amount": number, "currency": "string", "basis": "invoiced" | "remaining", "sourceSystem": "sap_ariba" | "coupa" | "oracle", "importId": "string", "fileName": "string", "importedAt": "string", "importedBy": "string" },
"createdAt": "string"
} ],
"invoices": [ {
"documentType": "invoice" | "debit_note",
"amendsInvoiceId": "string",
"amendsExternalInvoiceNumber": "string",
"debitNoteIds": [ "string" ],
"replacesInvoiceIds": [ "string" ],
"replacedByInvoiceIds": [ "string" ],
"replacement": { "creditedInFull": boolean, "uncredited": number },
"uncreditedOriginals": [ { "invoiceId": "string", "externalInvoiceNumber": "string", "uncredited": number, "currency": "string" } ],
"id": "string",
"po": "string",
"poLineNo": number,
"billsNoPoLine": true,
"buyerOrgId": "string",
"supplierOrgId": "string",
"supplier": "string",
"amount": number,
"currency": "string",
"usageAmount": number,
"usageCurrency": "string",
"tolerancePct": number,
"matchStatus": "pending" | "matched" | "discrepancy" | "unverified",
"unverifiedReason": "no_purchase_order" | "no_billing_connection" | "debit_note",
"discrepancyReason": "amount" | "currency",
"paid": boolean,
"dueInDays": number,
"approval": {
"requester": "string",
"requesterEmployeeKey": "string",
"groups": [
{
"id": "string",
"mode": "sequential" | "parallel",
"label": "string",
"status": "pending" | "approved" | "rejected",
"stages": [
{ "id": "string", "label": "string", "approverEmployeeKey": "string", "approverName": "string", "status": "pending" | "approved" | "rejected" }
]
}
],
"groupIndex": number,
"status": "pending" | "approved" | "rejected",
"history": [
{ "stage": "string", "by": "string", "at": "string", "action": "approved" | "rejected" | "limit_exceeded" | "reassigned" | "skipped" }
],
"autonomy": boolean,
"selfApproved": boolean
},
"createdAt": "string",
"lastRemindedAt": "string",
"rejection": { "reasonCode": "amount_incorrect" | "not_ordered_or_not_received" | "duplicate" | "missing_or_wrong_po" | "wrong_billing_entity" | "other", "reason": "string", "at": "string" },
"replacesInvoiceId": "string",
"source": "po-flip" | "direct" | "manual" | "feed",
"submittedFormat": "json" | "cxml" | "ubl",
"submittedBy": "string",
"externalInvoiceNumber": "string",
"lineItems": [
{ "description": "string", "qty": number, "unitPrice": number, "discount": number, "charge": number, "amount": number }
],
"adjustments": [
{ "type": "discount" | "charge", "description": "string", "amount": number }
],
"taxAmount": number,
"taxBreakdown": [ { "description": "string", "rate": number, "amount": number } ],
"paymentCurrencyAmount": { "currencyCode": "string", "totalAmount": number, "currencyExchangeDetails": { "rate": number, "rateDate": "string", "rateSource": "string" } },
"taxCurrencyAmount": { "currencyCode": "string", "amountBreakdown": { "taxes": { "totalAmount": number } }, "currencyExchangeDetails": { "rate": number, "rateDate": "string", "rateSource": "string" } },
"baseCurrencyAmount": { "currencyCode": "string", "totalAmount": number },
"rateWarnings": [
{ "object": "payment" | "tax", "currency": "string", "statedRate": number, "referenceRate": number, "source": "provider" | "override", "asOf": "string", "deviationPct": number }
],
"withholdings": [ { "description": "string", "rate": number, "amount": number } ],
"deductions": [ { "kind": "prepayment" | "credit", "description": "string", "amount": number, "reference": "string", "paidOn": "string", "sourceInvoiceId": "string", "stated": true } ],
"invoiceKind": "prepayment",
"creditNoteIds": [ "string" ],
"creditApplications": [ { "id": "string", "creditNoteId": "string", "externalCreditNoteNumber": "string", "amount": number, "appliedAt": "string", "appliedByName": "string", "auto": true } ],
"payment": { "status": "recorded", "method": "ach" | "wire" | "check" | "card" | "other" | "credit", "paymentDate": "string", "reference": "string", "paidAmount": { "amount": number, "currency": "string", "rate": number, "rateDate": "string" } },
"remittances": [ { "id": "string", "sentAt": "string", "sentByName": "string", "note": "string", "file": { "fileName": "string", "contentType": "application/pdf" | "image/png" | "image/jpeg", "sizeBytes": number } } ]
} ]
}