Referência da API

Espaços de trabalho

Resumos de painel da atividade de um comprador ou fornecedor.

Mais sobre este recurso

Retratos de painel que agregam os outros recursos nas duas visões que o console exibe.

Endpoints

Obter espaço de trabalho do comprador

Retorna o resumo do painel do comprador.

GET/v1/workspaces/{regionId}/buyer

Parâmetros

  • fromstring

    Data/timestamp ISO 8601 - só são retornados os itens criados nessa data ou depois dela.

  • tostring

    Data/timestamp ISO 8601 - só são retornados os itens criados nessa data ou antes dela.

Retorna

200 OK com o objeto mostrado na resposta.

Mais detalhes

Retorna o retrato do painel do comprador: as contas de nuvem conectadas, os pedidos de compra e as faturas desta região. Exige a função de comprador neste espaço de trabalho. Opcionalmente restrito a um intervalo de createdAt via from/to - passe os limites de um mês do calendário para ter uma visão por mês.

Erros

  • 401 Unauthorized - Nenhuma credencial foi apresentada, ou o token Bearer / valor de X-Api-Key está ausente, é inválido, expirou ou foi revogado.
  • 403 Forbidden - Quem chama não tem a função de comprador neste espaço de trabalho, ou não tem nenhum acesso a ele.
GET /v1/workspaces/{regionId}/buyer
Requisição
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/buyer" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Resposta · 200 OK
{
   "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 } } ]
   } ]
}
Fale conosco