Référence de l’API

Espaces de travail

Synthèses de tableau de bord de l’activité d’un acheteur ou d’un fournisseur.

En savoir plus sur cette ressource

Des instantanés de tableau de bord qui agrègent les autres ressources dans les deux vues qu’affiche la console.

Endpoints

Obtenir l’espace de travail acheteur

Renvoie la synthèse du tableau de bord de l’acheteur.

GET/v1/workspaces/{regionId}/buyer

Paramètres

  • fromstring

    Date/horodatage ISO 8601 : seuls les éléments créés à cette date ou après sont renvoyés.

  • tostring

    Date/horodatage ISO 8601 : seuls les éléments créés à cette date ou avant sont renvoyés.

Retour

200 OK avec l’objet présenté dans la réponse.

Plus de détails

Renvoie l’instantané du tableau de bord acheteur : les comptes cloud connectés, les bons de commande et les factures de cette région. Nécessite le rôle acheteur dans cet espace de travail. Peut être limité à une plage de createdAt via from/to : passez les bornes d’un mois civil pour obtenir une vue mensuelle.

Erreurs

  • 401 Unauthorized - Aucun identifiant n’a été fourni, ou la valeur du jeton Bearer / de X-Api-Key est manquante, invalide, expirée ou révoquée.
  • 403 Forbidden - L’appelant n’a pas le rôle acheteur dans cet espace de travail, ou n’y a aucun accès.
GET /v1/workspaces/{regionId}/buyer
Requête
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/buyer" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Réponse · 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 } } ]
   } ]
}
Nous contacter