header
You will get this API key in the response of ‘generate api key button’ on merchant object.
Body
Use checkout dictionary as input, refer example request for input data.
Show Top level parameters
Show Top level parameters
The order total inclusive of tax, shipping, and merchant discounts.
The subtotal that should be displayed to the consumer.
The amount of tax on the order.
The amount of shipping cost on the order.
The discount total that should be displayed to the consumer.
This is used to store create time of checkout object.
This is used to store update time of checkout object.
This is used to store shipping method.
The ID of this checkout in the merchant’s system which magic will store for shared identification purposes.
This ID should be unique per checkout.
The ID of the consumer in the merchant’s system which magic will store for shared identification purposes.
The URL to direct the customer’s browser to in the event that they don’t successfully confirm their checkout with Magic.
The URL to direct the customer’s browser to in the event that they successfully confirm their checkout with Magic.
This is used to store update object time.
This is used to indicate subscription status.
The array of cohortts inputs.
Show Amount
Show Amount
The order total inclusive of tax, shipping, and merchant discounts.
The subtotal that should be displayed to the consumer.
The amount of tax on the order.
The amount of shipping cost on the order.
The discount total that should be displayed to the consumer.
The currency in which the amounts are represented.
Show Billing
Show Billing
The name of the person receiving the shipment of the order.
The street address where the order will be shipped.
The optional apartment, suite, unit, etc. where the order will be shipped.
The city of the shipping address.
The area of the shipping address.
The state or province abbreviation for the shipping contact, such as ‘NY’ or ‘CA’.
The country code for the shipping address, such as ‘US’.
The postal code of the shipping address.
The phone number associated with the shipment. Format: “+11234567890”
Show Shipping
Show Shipping
The name of the person receiving the shipment of the order.
The street address where the order will be shipped.
The optional apartment, suite, unit, etc. where the order will be shipped.
The city of the shipping address.
The area of the shipping address.
The state or province abbreviation for the shipping contact, such as ‘NY’ or ‘CA’.
The country code for the shipping address, such as ‘US’.
The postal code of the shipping address.
The phone number associated with the shipment. Format: “+11234567890”
Show Platform
Show Platform
Show Item
Show Item
Item is accept list of items as input, you have to create list of your items and and give that list in the itme’s value in the checkout object dictionary.
The name of the item.
The SKU of the item.
The price of the item.
The quantity of the item.
Array of arrays containing category strings.
The image of ordered item.
Current chekout object id.
Copy
{
"chekout_object":"",
"amounts": {
"total": 15,
"subtotal": 15,
"tax": 5,
"shipping": 3,
"discount_total": null,
"currency": "USD"
},
"billing": {
"name": "Alice Jones",
"address_1": "123 East St.",
"address_2": "Apt. D",
"city": "New York",
"area": null,
"zone_code": "NY",
"country_code": "US",
"postal_code": "90210",
"phone_number": "+15554443333"
},
"shipping": {
"name": "Alice Jones",
"address_1": "123 East St.",
"address_2": "Apt. D",
"city": "New York",
"area": null,
"zone_code": "NY",
"country_code": "US",
"postal_code": "90210",
"phone_number": "+15554443333"
},
"platform": {
"platform_type": "magento",
"platform_version": "1.3"
},
"items": [
{
"price": {
"amount": 15019,
"currency": "USD"
},
"name": "straight_leg_jean",
"sku": "4db3ifnl",
"quantity": 2,
"image": "https://pixabay.com/images/id-1772243/",
"category": [
[
"clothing",
"jeans"
]
]
},
{
"price": {
"amount": 19472,
"currency": "USD"
},
"name": "wide_leg_jean",
"sku": "syt9r0ub",
"quantity": 3,
"image": "https://pixabay.com/images/id-1772243/",
"category": [
[
"clothing",
"jeans"
]
]
},
{
"price": {
"amount": 15,
"currency": "USD"
},
"name": "cropped_jean",
"sku": "r84qlsok",
"quantity": 2,
"image": "https://pixabay.com/images/id-1772243/",
"category": [
[
"clothing",
"jeans"
],
[
"sale"
]
]
}
],
"created_at": "2023-02-16T13:35:15.586091Z",
"updated_at": "2023-02-16T13:35:15.586109Z",
"shipping_method": "overnight",
"merchant_checkout_id": "4b718371-a466-4270-bc97-ece09d256443",
"merchant_user_id": "1234",
"redirect_cancel_url": "https://merchant.com/cancel",
"redirect_confirm_url": "https://merchant.com/redirect",
"subscription_status": "",
"plan_type": "MO",
"is_subscription": true,
"user_cohorts": [
"platinum",
"newsletter",
"club_membe"
]
}
Response
This Response field will return unique ‘checkout_id’ and status code 200 if the transaction succeeds.
Copy
curl --location --request POST 'http://127.0.0.1:8000/api/merchants/checkout' \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
Copy
{
"id": "ch-b402978c257143b6970b478a566c808f"
}