added
Create Order API
over 1 year ago by Federica Valenghi
Release Date 31 May 2022
Overview
Update of the Scalapay Create Order API call with the addition of fields to also enter new Scalapay products (Pay in 4, Pay Later).
The merchant can set the new fields: frequency, type and products in the Create Order API call
What's changed
Change of Create Order API call v2/orders
New fields added: frequency, type and products
Parameters
Path
Attribute | Type | Description |
---|---|---|
order details | array | Order Details Object |
Order Details Object
Attribute | Type | Description | Required | New Field |
---|---|---|---|---|
items | array | Order items list. See Item | YES | |
billing | Address | Billing informations | NO | |
consumer | Consumer | Consumer informations | YES | |
merchant | Merchant | Merchant urls informations | YES | |
shipping | Address | Shipping informations | YES | |
discounts | array | Discount list. See Discount | NO | |
taxAmount | Amount | Total tax amount | NO | |
totalAmount | Amount | Total order amount | YES | |
shippingAmount | Amount | Total shipping amount | NO | |
merchantReference | string | Unique reference that identifies merchant order | NO | |
type | string | Accepted values: online or offline | NO | New |
product | string | Which Scalapay product is being called Accepted values: pay-in-3 , pay-in-4 , later | NO | New |
frequency | Frequency | Number of installments | NO | New |
Example payload
{
"totalAmount": {
"amount": "100.00",
"currency": "EUR"
},
"consumer": {
"phoneNumber": "0400000001",
"givenNames": "Test",
"surname": "Test",
"email": "[email protected]"
},
"billing": {
"name": "Testr",
"line1": "Via Test, 58",
"suburb": "Milano",
"postcode": "20135",
"countryCode": "IT",
"phoneNumber": "0400000000"
},
"shipping": {
"name": "Test",
"line1": "Via Test, 58",
"suburb": "Milano",
"postcode": "20135",
"countryCode": "IT",
"phoneNumber": "0400000000"
},
"items":[
{
"name": "32",
"category": "clothes",
"subcategory": ["shirt", "long-sleeve"],
"brand": "TopChoice",
"gtin": "123458791330",
"sku": "12341234",
"quantity": 1,
"price": {
"amount": "10.00",
"currency": "EUR"
}
},
{
"name": "Jeans",
"category": "clothes",
"subcategory": ["pants", "jeans"],
"brand": "TopChoice",
"gtin": "123458722222",
"sku": "12341235",
"quantity": 1,
"price": {
"amount": "20.00",
"currency": "EUR"
}
}
],
"discounts": [
{
"displayName": "10% Off",
"amount": {
"amount": "103.00",
"currency": "EUR"
}
}
],
"merchant": {
"redirectConfirmUrl": "https://scalapay.com",
"redirectCancelUrl": "https://scalapay.com"
},
"merchantReference": "merchantOrder-1234",
"taxAmount": {
"amount": "3.70",
"currency": "EUR"
},
"shippingAmount": {
"amount": "10.00",
"currency": "EUR"
},
"orderExpiryMilliseconds": 6000000,
"channel": "scalapay.com",
"type":"online",
"product":"pay-in-3",
"frequency":{
"number": 1,
"frequencyType":"monthly"
}
}
{
"totalAmount": {
"amount": "100.00",
"currency": "EUR"
},
"consumer": {
"phoneNumber": "0400000001",
"givenNames": "Test",
"surname": "Test",
"email": "[email protected]"
},
"billing": {
"name": "Test",
"line1": "Test",
"suburb": "Milano",
"postcode": "20135",
"countryCode": "IT",
"phoneNumber": "0400000000"
},
"shipping": {
"name": "Test",
"line1": "Test",
"suburb": "Milano",
"postcode": "20135",
"countryCode": "IT",
"phoneNumber": "0400000000"
},
"items":[
{
"name": "32",
"category": "clothes",
"subcategory": ["shirt", "long-sleeve"],
"brand": "TopChoice",
"gtin": "123458791330",
"sku": "12341234",
"quantity": 1,
"price": {
"amount": "10.00",
"currency": "EUR"
}
},
{
"name": "Jeans",
"category": "clothes",
"subcategory": ["pants", "jeans"],
"brand": "TopChoice",
"gtin": "123458722222",
"sku": "12341235",
"quantity": 1,
"price": {
"amount": "20.00",
"currency": "EUR"
}
}
],
"discounts": [
{
"displayName": "10% Off",
"amount": {
"amount": "103.00",
"currency": "EUR"
}
}
],
"merchant": {
"redirectConfirmUrl": "https://scalapay.com",
"redirectCancelUrl": "https://scalapay.com"
},
"merchantReference": "merchantOrder-1234",
"taxAmount": {
"amount": "3.70",
"currency": "EUR"
},
"shippingAmount": {
"amount": "10.00",
"currency": "EUR"
},
"orderExpiryMilliseconds": 6000000,
"channel": "scalapay.com",
"type":"online",
"product":"pay-in-4",
"frequency":{
"number": 1,
"frequencyType":"monthly"
}
}
{
"totalAmount": {
"amount": "100.00",
"currency": "EUR"
},
"consumer": {
"phoneNumber": "0400000001",
"givenNames": "Test",
"surname": "Test",
"email": "[email protected]"
},
"billing": {
"name": "Test",
"line1": "Via Test, 58",
"suburb": "Milano",
"postcode": "20135",
"countryCode": "IT",
"phoneNumber": "0400000000"
},
"shipping": {
"name": "Tesr",
"line1": "Via Test, 58",
"suburb": "Milano",
"postcode": "20135",
"countryCode": "IT",
"phoneNumber": "0400000000"
},
"items":[
{
"name": "32",
"category": "clothes",
"subcategory": ["shirt", "long-sleeve"],
"brand": "TopChoice",
"gtin": "123458791330",
"sku": "12341234",
"quantity": 1,
"price": {
"amount": "10.00",
"currency": "EUR"
}
},
{
"name": "Jeans",
"category": "clothes",
"subcategory": ["pants", "jeans"],
"brand": "TopChoice",
"gtin": "123458722222",
"sku": "12341235",
"quantity": 1,
"price": {
"amount": "20.00",
"currency": "EUR"
}
}
],
"discounts": [
{
"displayName": "10% Off",
"amount": {
"amount": "103.00",
"currency": "EUR"
}
}
],
"merchant": {
"redirectConfirmUrl": "https://scalapay.com",
"redirectCancelUrl": "https://scalapay.com"
},
"merchantReference": "merchantOrder-1234",
"taxAmount": {
"amount": "3.70",
"currency": "EUR"
},
"shippingAmount": {
"amount": "10.00",
"currency": "EUR"
},
"orderExpiryMilliseconds": 6000000,
"channel": "scalapay.com",
"type":"online",
"product":"later",
"frequency":{
"number": 14,
"frequencyType":"daily"
}
}
Successful Response (200)
Attribute | Type | Description |
---|---|---|
token | string | Scalapay order unique token. |
expires | datetime | Date and time of the order to expire in ISO 8601 format. |
checkoutUrl | string | Redirect Url to the Scalapay checkout. |
Example Response
{
"token": "WSG16DYX62BX",
"expires": "2022-09-08T15:58:28.000Z",
"checkoutUrl": "https://portal.integration.scalapay.com/checkout/WSG16DYX62BX"
}