#Curl
curl --request POST \
--url https://api.conekta.io/orders \
--header 'accept: application/vnd.conekta-v2.0.0+json' \
-u key_eYvWV7gSDkNYXsmr: \
--header 'content-type: application/json' \
--data '{
"line_items": [{
"name": "Tacos",
"unit_price": 1000,
"quantity": 12
}],
"currency": "MXN",
"customer_info": {
"name": "Fulanito Pérez",
"email": "[email protected]",
"phone": "+5218181818181"
},
"charges":[{
"payment_method": {
"type": "spei"
}
}]
}'
#JSON Response
{
"livemode": false,
"amount": 12000,
"currency": "MXN",
"payment_status": "pending_payment",
"amount_refunded": 0,
"customer_info": {
"email": "[email protected]",
"phone": "+5218181818181",
"name": "Fulanito Pérez",
"object": "customer_info"
},
"object": "order",
"id": "ord_2i5d4gdwpZR5Yat6U",
"metadata": {},
"created_at": 1518744793,
"updated_at": 1518744793,
"line_items": {
"object": "list",
"has_more": false,
"total": 1,
"data": [{
"name": "Tacos",
"unit_price": 1000,
"quantity": 12,
"object": "line_item",
"id": "line_item_2i5d4gdwpZR5Yat6S",
"parent_id": "ord_2i5d4gdwpZR5Yat6U",
"metadata": {},
"antifraud_info": {}
}]
},
"charges": {
"object": "list",
"has_more": false,
"total": 1,
"data": [{
"id": "5a8634d9ffecf9376e833305",
"livemode": false,
"created_at": 1518744793,
"currency": "MXN",
"payment_method": {
"clabe": "646180111812345678",
"bank": "STP",
"receiving_account_number": "646180111812345678",
"receiving_account_bank": "STP",
"object": "bank_transfer_payment",
"type": "spei",
"expires_at": 1526520793
},
"object": "charge",
"description": "Payment from order",
"status": "pending_payment",
"amount": 12000,
"fee": 928,
"customer_id": "",
"order_id": "ord_2i5d4gdwpZR5Yat6U"
}]
}
}
#Paid Event Notification
{
"action": "charge.paid",
"data": {
"object": {
"id": "5a8634d9ffecf9376e833305",
"livemode": false,
"created_at": 1518744793,
"currency": "MXN",
"payment_method": {
"clabe": "646180111812345678",
"bank": "STP",
"receiving_account_number": "646180111812345678",
"receiving_account_bank": "STP",
"object": "bank_transfer_payment",
"type": "spei",
"expires_at": 1526520793
},
"object": "charge",
"description": "Payment from order",
"status": "paid",
"amount": 12000,
"paid_at": 1518744834,
"fee": 928,
"customer_id": "",
"order_id": "ord_2i5d4gdwpZR5Yat6U"
}
},
"previous_attributes": {
"status": "pending_payment"
},
"livemode": false,
"webhook_status": "pending",
"id": "5511d4ce2412294cf6000084",
"object": "event",
"type": "charge.created",
"created_at": 1427231950,
"webhook_logs": [
{
"id": "webhl_nPzGMBeQmMUu7aQ",
"url": "http://requestb.in/1em0jsx1",
"failed_attempts": 0,
"last_http_response_status": -1,
"object": "webhook_log",
"last_attempted_at": 0
}
]
}