Create a new purchase and process it

Create a new purchase and process it

Request

POST https://api.nexway.store/purchases/public

Request body

The request body takes a complete Purchase resource, containing the following writable properties:

{
    "cartDetails": {
        "country": "string",
        "endUser": {
            "city": "string",
            "country": "string",
            "email": "string",
            "firstName": "string",
            "id": "string",
            "lastName": "string",
            "locale": "string",
            "storeId": "string",
            "streetAddress": "string",
            "zipCode": "string"
        },
        "locale": "string",
        "products": {
            "<key>": {
                "quantity": "int64"
            }
        },
        "storeId": "string"
    },
    "cartId": "string",
    "payment": {
        "ccCvv": "string",
        "ccEncryptedData": {
            "data": "string",
            "token": "string"
        },
        "ccExpirationMonth": "int32",
        "ccExpirationYear": "int32",
        "ccNumber": "string",
        "ccOwnerName": "string",
        "ccType": "string",
        "customerCountry": "string",
        "customerFirstName": "string",
        "customerLastName": "string",
        "env": "string",
        "orderNumber": "string",
        "transactionAmount": "string",
        "transactionCountry": "string",
        "transactionCurrency": "string",
        "transactionLanguage": "string",
        "transactionMetaData": {
            "customerCountry": "string",
            "customerEmail": "string",
            "customerFirstName": "string",
            "customerLastName": "string",
            "orderItems": [
                {
                    "orderDebitCredit": "string",
                    "orderItemAmount": "string",
                    "orderItemId": "string",
                    "orderItemName": "string",
                    "orderItemPrice": "string",
                    "orderItemQty": "string",
                    "orderItemRef": "string",
                    "orderItemTaxRate": "string",
                    "orderPublisherRef": "string",
                    "orderShippingNb": "string"
                }
            ],
            "paypalEnableBillingAgreement": "int32",
            "pushUri": "string",
            "softDescriptor": "string"
        },
        "transactionReturnUrl": "string",
        "vendor": "string"
    }
}

Properties

Name Type Description Additional
cartDetails object CartInput Optional
cartDetails.country string Optional
cartDetails.endUser object EndUser Optional
cartDetails.endUser.city string Optional
cartDetails.endUser.country string Optional
cartDetails.endUser.email string Optional
cartDetails.endUser.firstName string Optional
cartDetails.endUser.id string Optional
cartDetails.endUser.lastName string Optional
cartDetails.endUser.locale string Optional
cartDetails.endUser.storeId string Optional
cartDetails.endUser.streetAddress string Optional
cartDetails.endUser.zipCode string Optional
cartDetails.locale string Optional
cartDetails.products object Optional
cartDetails.products.<key> map of object ProductInput Optional
cartDetails.products.<key>.quantity int64 Optional
cartDetails.storeId string Optional
cartId string

Cart Id

Optional
payment object DoTransaction
payment.ccCvv string Optional
payment.ccEncryptedData object CcEncryptedData Optional
payment.ccEncryptedData.data string Optional
payment.ccEncryptedData.token string Optional
payment.ccExpirationMonth int32 Optional
payment.ccExpirationYear int32 Optional
payment.ccNumber string Optional
payment.ccOwnerName string Optional
payment.ccType string Optional
payment.customerCountry string Optional
payment.customerFirstName string Optional
payment.customerLastName string Optional
payment.env string Optional
payment.orderNumber string Optional
payment.transactionAmount string Optional
payment.transactionCountry string Optional
payment.transactionCurrency string Optional
payment.transactionLanguage string Optional
payment.transactionMetaData object MetaDataFields Optional
payment.transactionMetaData.customerCountry string Optional
payment.transactionMetaData.customerEmail string Optional
payment.transactionMetaData.customerFirstName string Optional
payment.transactionMetaData.customerLastName string Optional
payment.transactionMetaData.orderItems[] array Optional
payment.transactionMetaData.orderItems[].orderDebitCredit string Optional
payment.transactionMetaData.orderItems[].orderItemAmount string Optional
payment.transactionMetaData.orderItems[].orderItemId string Optional
payment.transactionMetaData.orderItems[].orderItemName string Optional
payment.transactionMetaData.orderItems[].orderItemPrice string Optional
payment.transactionMetaData.orderItems[].orderItemQty string Optional
payment.transactionMetaData.orderItems[].orderItemRef string Optional
payment.transactionMetaData.orderItems[].orderItemTaxRate string Optional
payment.transactionMetaData.orderItems[].orderPublisherRef string Optional
payment.transactionMetaData.orderItems[].orderShippingNb string Optional
payment.transactionMetaData.paypalEnableBillingAgreement int32 Optional
payment.transactionMetaData.pushUri string Optional
payment.transactionMetaData.softDescriptor string Optional
payment.transactionReturnUrl string Optional
payment.vendor string Optional

Response

The following HTTP status codes may be returned, optionally with a response resource.

Status code Description Resource
200 OK

OK

PurchaseResponse
201 Created

Created

PurchaseResponse
202 Accepted

Accepted

PurchaseResponse
401 Unauthorized

Unauthorized

403 Forbidden

Forbidden

404 Not Found

Not Found

500 Internal Server Error

Failure

Example

{
    "cartDetails": {
        "endUser": {}
    },
    "cartId": "6dd06cd7-ff35-4c3f-8445-046c860fea38",
    "payment": {
        "ccEncryptedData": {},
        "transactionMetaData": {}
    }
}

Explore this API

purchase

purchase

Request Content-Type
Response Content-Type
Try it out!