# Tutorial: Send orders

The buyer sends a purchase order to the seller using the order only flow from the Peppol BISv3 Order specifications (opens new window). Ubl examples are available at the business documents / orders. Use your identifiers as {partyId}(buyer) in the url paths.

More advanced flows are available using the generic endpoint. The advanced flow tutorial will be created once the Peppol workgroups are finalized.

# Prerequisite

  • You have registered a hook with the topic OrderSent or *Sent. If not, go to hooks.
  • The seller supports Order Only as receiver capability.

# Step 1: Preflight

Use Query recipient party to make sure the seller supports the order in all possible delivery options. This can be done using this POST /{partyId}/purchaseOrder/queryRecipientParty endpoint.

Or in case of Peppol by using this form:

Now copy the returned identifier as {receiverId} because we need it for the next step.

# Step 2: Send purchase order

Use the {receiverId} in POST /{partyId}/purchaseOrder/send?receiverId={receiverId} endpoint and upload the document using multipart. Once the document is successfully uploaded an id for the upcoming events is returned. This means the document is validated and reliably stored (at least 2 replicas). The response will be very fast because the actual sending will be done asynchronously.

Response:

{
  "id": "5618b40a-822d-4e74-8894-b489617dbaa4"
}

# Step 3: Receive hooks

When the order is successfully received by the receiver access point an OrderSent topic will be broadcasted to your registered hooks.

The available topics are:

  • OrderSent
  • OrderSentError
  • OrderSentRetry
{
  "topic": "OrderSent",
  "partyId": "{partyId}",
  "hookId": "2",
  "documentId": "5618b40a-822d-4e74-8894-b489617dbaa4",
  "details": {
    "id": "orderId",
    "sourceDocumentTypeId": "urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:fdc:peppol.eu:poacc:trns:order:3::2.1",
    "targetDocumentTypeId": "urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:fdc:peppol.eu:poacc:trns:order:3::2.1",
    "endpoint": "https://accp-ap.econnect.eu/as4/v1",
    "recipient": "{receiverId}",
    "attempt": "1",
    "protocol": "As4",
    "messageId": "3e3b336c-6563-431c-93bc-6b109dedfcc5@econnect.eu",
    "returnedMessageId": "640edc84-235a-4d74-a9ed-761bb2685316@econnect.eu"
  },
  "createdOn": "2020-06-22T09:31:57.7444125+00:00",
  "sentOn": "2020-06-22T09:31:57.8703556+00:00"
}
© 2024 eConnect International B.V.