API Reference

Fulfilment Completion Webhooks

Use this API to notify the Pay1st Gateway about successful fulfilment completion

Used in Gateway Integration

Overview

As Carry1st maintains the responsibilities of Merchant of Record status, it’s important that Carry1st can verify that each order has been fulfilled via the Fulfilment Completion Webhooks. This API is a POST request that takes the Carry1st reference, fulfilled products and SKUs as input. The Pay1st Gateway responds with an empty response.

Pre Requisites

Request Signature

A valid signature should be generated for this request. See Gateway - 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.payments.payment+json
X-SIGNATUREThis is the header that will contain the signature of the request. Refer to the Request Signing section above
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

https://<payments_url>/api/pay1st/payments/fulfilments

List of Create Payment POST fields

These are the list of POST parameters that needs to be passed from the Pay1st Partner to the Pay1st Gateway.

ParamFormatMandatoryDescription
referencestringYesUnique identifier for the transaction
productsarray of Product FieldsYesList of product items to be fulfilled

List of Product Fields

Products are used to describe the item that the customer is paying for within the application. These are the products and SKUs that were actually fulfilled

ParamFormatMandatoryDescription
skustringYesIdentifier for the specific product SKU
fulfilmentStatusstringYesStatus of the product fulfilment (e.g. FULFILLED)
quantityintegerYesNumber of units fulfilled
fulfilmentTimestamplong UTCYesUTC timestamp when the product was fulfilled. This should be in Linux epoch format.

Example JSON Request

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

{
    "reference": "<carry1st_transaction_reference>",
    "products": [
        {
            "sku": "SKU_1",
            "fulfilmentStatus": "FULFILLED",
            "quantity": 1,
            "fulfilmentTimestamp": <long UTC>
        },
        {
            "sku": "SKU_2",
            "fulfilmentStatus": "FULFILLED",
            "quantity": 1,
            "fulfilmentTimestamp": <long UTC>
        }
    ]
}

List of Fulfilment Statuses

StatusDescription
NOT_STARTEDThe fulfilment has not started
PENDINGThe fulfilment is in currently in a pending on the partner system
PARTIALLY_FULFILLEDThe fulfilment has not fulfilled the entire quantity specified in the request
FULFILLEDThe SKU has been successfully fulfilled on the partner system
FAILEDThe fulfilment has failed on the partner system
REFUNDA refund has been issued for the partner
CHARGEBACKA chargeback has been issued for this SKU by the customer

Success Response

Valid HTTP Success Status Codes:

HTTP Status Code

Name

Description

200

Success

This indicates that the request has been successful.

400

Bad Request

The Payment Reference may be incorrect

401

Unauthorized

The incorrect role value was used

The incorrect API Key and API Secret combination was used (see Configuring API Credentials )

500

Internal Server Error

This would be an error on the Carry1st side. Carry1st Team will be aware of this, but the Partner might want to follow up on this error.

HTTP Response Body

There is no response body sent by the Pay1st Gateway

Error Response

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