API Reference

Order Completion API

Use this API to complete Orders with the Flow1st API

Overview

An Order Completion request needs to be made in order to distribute the Product’s digital content to the customer. This API is a POST request that takes order details as input, and returns order identification information as a JSON response.

Pre Requisites

An access token needs to be generated in order to use this API (see Authentication - Generate Access Token)

Request Signature

A valid signature should be generated for this request. See Generating Signatures for a detailed description on how this should be implemented.

API Description

HTTP Headers

Header NameDescription
AccessTokenThis is the Access Token field returned from the Authentication - Generate Access Token response. This should be in the format Bearer <AccessToken>
Content-Typeapplication/vnd.carry1st.order.distributor+json
X-SIGNATUREThis is the header that will contain the signature of the request. Refer to Generating Signatures
X-TIMESTAMPThis is the current time in ISO-8601 format. This should be the same timestamp as the one used to generate the Signature

URL Format

POST api/orders/distributors/order-complete

List of Order Complete POST fields

These are the list of POST payload fields that needs to be submitted to the API

ParamFormatMandatoryDescription
externalReferenceStringYThe externalReference of the distributor that is used for reconciliation as well as identifying the order on the Flow1st Partner System
productBundleSkuStringYThis is the SKU identifier that is retrieved from the List Product Fields API
quantityNumberYThis should always be 1
recipientIdentifierStringYThe userId of the customer that exists on the platform of the Product
emailStringYThe email of the customer to send the Order Email
webhookUrlStringIf provided, this is the URL that will be used to notify the partner backend server of order completion events. If not present, the default value in Configuring Webhooks will be used

Example JSON Request

The following JSON Request is an example of the correct construction of a Create Payment Request:

{
   "externalReference": "saqr_ref_001",
   "productBundleSku": "codm30cp",
   "quantity": 1,
   "recipientIdentifier": "GEDKZW",
   "email": "[email protected]",
   "webhookUrl": "https://86c99ac283b8.ngrok-free.app"
}

Success Response

Valid HTTP Success Status Codes:

HTTP Status CodeNameDescription
201SuccessThis indicates that the request has been successful
400Bad RequestThe X-SIGNATURE HTTP header in the request might not be matching the server.The X-TIMESTAMP HTTP header in the request might not be within 5 minutes of creating the Access Token.The Request Body might be invalid.

HTTP Response Body

{
   "reference": "C-58333198548871-P",
   "externalReference": "saqr_ref_002",
   "productBundleSku": "codm30cp",
   "quantity": 1,
   "recipientIdentifier": "GEDKZW",
   "email": "[email protected]",
   "status": "PENDING",
   "fulfilmentStatus": "PENDING"
}

HTTP Response Fields

NameTypeDescription
referenceStringThe Carry1st Order reference for this order
externalReferenceStringThis will match the externalReference of the original request
productBundleSkuStringThis will match the productBundleSku of the original request
quantityNumberThis will match the quantity of the original request
emailStringThis will match the email of the original request
statusStringThis represents the status of the order. For all created payments, a value of PENDING will be returned
fulfilmentStatusStringThis represents the status of the order. For all created payments, a value of PENDING will be returned

Error Response

See Handling Error Codes for more details on handling error responses.