Checkout APIs

Generate Hosting page

curl –location –request POST ‘https://api.sandbox.checkout.com/hosted-payments’ \
–header ‘Content-Type: application/json’ \
–header ‘Authorization: Bearer {secret key}’ \
–data-raw ‘{
“amount”: 1000,
“currency”: “GBP”,
“billing”: {
“address”: {
“address_line1”: “Checkout.com”,
“address_line2”: “90 Tottenham Court Road”,
“city”: “London”,
“state”: “st”,
“zip”: “W1T 4TJ”,
“country”: “GB”
},
“phone”: {
“country_code”: “+1”,
“number”: “415 555 2671”
}
},
“reference”: “Test data”,
“processing_channel_id”: “{processing channel id}”,
“success_url”: “https://example.com/payments/success”,
“cancel_url”: “https://example.com/payments/cancel”,
“failure_url”: “https://example.com/payments/failure”
}’

Creating workflow

curl –location –request POST ‘https://api.sandbox.checkout.com/workflows’ \
–header ‘Content-Type: application/json’ \
–header ‘Authorization: Bearer {secret key}’ \
–data-raw ‘{
“name”: “Webhooks workflow netsuite”,
“active”: true,
“conditions”: [
{
“type”: “event”,
“events”: {
“gateway”: [
“payment_approved”,
“payment_declined”,
“card_verification_declined”,
“card_verified”,
“payment_authorization_incremented”,
“payment_authorization_increment_declined”,
“payment_capture_declined”,
“payment_captured”,
“payment_refund_declined”,
“payment_refunded”,
“payment_void_declined”,
“payment_voided”
],
“dispute”: [
“dispute_canceled”,
“dispute_evidence_required”,
“dispute_expired”,
“dispute_lost”,
“dispute_resolved”,
“dispute_won”
]
}
},
{
“type”: “processing_channel”,
“processing_channels”: [
“{processing channel id}”
]
}
],
“actions”: [
{
“type”: “webhook”,
“url”: “https://5102772-sb1.extforms.netsuite.com/app/site/hosting/scriptlet.nl?script=650&deploy=1&compid=5102772_SB1&h=e82ec5a7592514bd3cd8”
}
]
}’

Get checkout payments

curl –location –request GET ‘https://api.sandbox.checkout.com/payments/{payment id}’ \
–header ‘Authorization: Bearer {secret key}’ \
–header ‘Content-Type: application/json’

Get hosting page

curl –location –request GET ‘https://api.sandbox.checkout.com/hosted-payments/hpp_iwoIH3vgjX-b’ \
–header ‘Authorization: Bearer {secret key}’


Get workflow

curl –location –request GET ‘https://api.sandbox.checkout.com/workflows/{workflow id}’ \
–header ‘Authorization: Bearer {secret key}’



Leave a comment

Your email address will not be published. Required fields are marked *