Get customer’s payment profiles:
GET /paymentprofiles
Sample Response:
JSON
{
"entities": [{
"profile_token": "xxxxxxxxxx",
"last_four": "xxxx",
"type": "Visa"
},
{
"profile_token": "yyyyyyyyyyy",
"last_four": "yyyy",
"type": "Master"
}
]
}
Save the desired payment profile and post the order.
How to Add New Payment Profiles
1) First Login into the site 4over.com
2) Then go to Account->Orders & Account->Stored Payment Methods
3) Then Click on Add New Card.
4) Now hit the /paymentprofiles API. You can see the added card in the response.
Note: If you added credit cards to your 4Over account before generating API keys, those cards will not appear when calling the /paymentprofiles API.
To resolve this, you can either:
– Add a new credit card after generating your API keys, or
– Remove the existing card from the 4over.com website and re-enter the credit card details to create a new payment profile and sync with the API.
Payment Processing
To process payments add the Payment block to the order POST.
The requested amount is not required. The amount is calculated internally and matched against the amount passed by the user. If this parameter is excluded the calculated amount will be charged to the credit card on file by way of the provided payment token. Please note that “requested_amount” must be excluded from payment block for this to work correctly. If this parameter is present with 0 or null value the order will fail.
Orders Payment using Credit Card Processing
POST /orders
Input Parameters
These are in addition to order parameters above.
@param profile_token.
Sample Request
html
https://api.4over.com/orders
Sample Request Body
JSON
{
"order_id": "test001",
"is_test_order": "true",
"coupon_code": "PRC5PKS",
"skip_conformation": "true",
"jobs": [
{
"product_uuid": "91efff4d-de64-410a-8794-fc547022a7f2",
"runsize_uuid": "52e3d710-0e8f-4d4d-8560-7d4d8655be69",
"option_uuids": [],
"turnaroundtime_uuid": "50979118-b3a2-4556-9f46-d1da268f2354",
"colorspec_uuid": "13abbda7-1d64-4f25-8bb2-c179b224825d",
"dropship": "true",
"sets": 2,
"files": {
"set_001": {
"job_name": "job001-001",
"files": {
"fr": "5a2e207c-8a97-42a3-9b17-1e4899eae9ac",
"bk": "d044410f-003e-4b32-8039-f6d590728f5b"
}
},
"set_002": {
"job_name": "job001-002",
"files": {
"fr": "8b0fd851-7f13-4700-a35a-baff123eecfe",
"bk": "3d71bf4a-a799-4dfb-ac90-8fea5f97b608"
}
}
},
"ship_to": {
"company": "My Print Company",
"firstname": "James",
"lastname": "Doe",
"email": "james.doe@abcd_company.com",
"phone": "888-888-8888",
"address": "8900 Executive Park Drive",
"address2": "",
"city": "Knoxville",
"state": "TN",
"zipcode": "37923",
"country": "US"
},
"ship_from": {
"company": "My Print Company",
"firstname": "Mike",
"lastname": "Doe",
"email": null,
"phone": "888-888-8888",
"address": "100 CUMMINGS CTR",
"address2": null,
"city": "BEVERLY",
"state": "MA",
"zipcode": "01915",
"country": "US"
},
"shipper": {
"shipping_method": "FREE UPS Ground",
"shipping_code": "03f"
},
"ship_from_facility": "DAY"
},
{
"product_uuid": "91efff4d-de64-410a-8794-fc547022a7f2",
"runsize_uuid": "52e3d710-0e8f-4d4d-8560-7d4d8655be69",
"option_uuids": [],
"turnaroundtime_uuid": "50979118-b3a2-4556-9f46-d1da268f2354",
"colorspec_uuid": "13abbda7-1d64-4f25-8bb2-c179b224825d",
"dropship": "true",
"sets": 3,
"files": {
"set_001": {
"job_name": "job002-001",
"files": {
"fr": "62a7d70a-3b38-45a8-9327-e10a9c4057df",
"bk": "ef45e3ff-2f3c-415c-8c63-4f5e3f290e8d"
}
},
"set_002": {
"job_name": "job002-002",
"files": {
"fr": "bad3efad7-2e72-4a5e-87ec-d8bad3ef0359",
"bk": "f9ead3ef0-b0de-4033-ad6d-aa15aa8c2555"
}
},
"set_003": {
"job_name": "job002-003",
"files": {
"fr": "3830c3ee-72e4-46d7-8d0d-aad3ef77ccf1",
"bk": "bd380570-135d-47fd-9411-b3ead3ef99d8"
}
}
},
"ship_to": {
"company": "My Test Company",
"firstname": "Maria",
"lastname": "Doe",
"email": "maria.doe@abcd_company.com",
"phone": "888-888-8888",
"address": "8900 Executive Park Drive",
"address2": null,
"city": "Knoxville",
"state": "TN",
"zipcode": "37923",
"country": "US"
},
"ship_from": {
"company": "My Print Company",
"firstname": "Mike",
"lastname": "Doe",
"email": null,
"phone": "888-888-8888",
"address": "100 CUMMINGS CTR",
"address2": null,
"city": "BEVERLY",
"state": "MA",
"zipcode": "01915",
"country": "US"
},
"shipper": {
"shipping_method": "FREE UPS Ground",
"shipping_code": "03f"
},
"ship_from_facility": "DAY"
}
],
"payment": {
"profile_token": "xxxxxxxxxx"
}
}
Sample Response
JSON
{
"order_status": "Success",
"customer_order_id": "test001",
"job_ids": {
"X8291118499-001": {
"customer_job_id": "job001-001",
"status": 200,
"messages": []
},
"X8291118499-002": {
"customer_job_id": "job001-002",
"status": 200,
"messages": []
},
"X8291118499-003": {
"customer_job_id": "job002-001",
"status": 200,
"messages": []
},
"X8291118499-004": {
"customer_job_id": "job002-002",
"status": 200,
"messages": []
},
"X8291118499-005": {
"customer_job_id": "job002-003",
"status": 200,
"messages": []
}
},
"payment_response": {
"payment_uuid": "e58bee7f-0b57-4214-9e2a-33d683e7fe9f",
"payment_provider": {
"payment_provider_uuid": "6b0e699e-bdaf-4d1e-af4c-bc422ad21761",
"payment_provider": "Authorizenet",
"created_at": "2013-11-05 11:33:51-08"
},
"requested_amount": "119.70",
"requested_currency": {
"currency_code": "USD",
"currency": "United States dollar",
"currency_number": "840",
"created_at": "2013-09-30 09:27:22.689216-07"
},
"request_transaction_code": "12345678920",
"request_data": "",
"requested_at": "2018-10-18T18:06:19+0000",
"response_transaction_code": "12345678920",
"response_data": {
"card_number": "XXXX1111",
"card_type": "Visa",
"response_message": "This transaction has been approved."
},
"responded_at": "2018-10-18T18:06:19+0000",
"authorization_code": "ABCDEF",
"authorized_at": "2018-10-18T18:06:19+0000",
"authorized_payment_amount": "119.70",
"authorized_refund_amount": 0,
"authorized_currency": {
"currency_code": "USD",
"currency": "United States dollar",
"currency_number": "840",
"created_at": "2013-09-30 09:27:22.689216-07"
},
"paying_organization": {
"organization_uuid": "a4377724-8819-4a96-bc2b-3877b269f989",
"organization_name": "4over",
"organization_description": "4over Website - Trade Ultra",
"job_code_prefix": "K",
"is_public_organization": true,
"primary_contact_user": {
"user_uuid": "d44fa923-d567-48ed-aa3a-9c02a98bcee6",
"first_name": "Admin User",
"last_name": "API",
"email": "",
"user_notes": "admin user",
"created_at": "2014-03-18 12:33:43.387423-07",
"updated_at": "2015-07-06 10:29:18.338875-07",
"deleted_at": "",
"organizations": "https://sandbox-api.4over.com/users/d44fa923-d567-48ed-aa3a-9c02a98bcee6/organizations",
"logins": "https://sandbox-api.4over.com/users/d44fa923-d567-48ed-aa3a-9c02a98bcee6/logins",
"token": "5ec64e96d3877374fd35c2aae94cea3d07b83e10",
"timestamp": "0.09669000 1539885980",
"current_organization_uuid": "a4377724-8819-4a96-bc2b-3877b269f989"
},
"parent_organization": {
"organization_uuid": "8a17ef16-d997-4544-9f7c-d313febf9c40",
"organization_name": "4over root",
"organization_description": "4over root",
"job_code_prefix": "Z",
"is_public_organization": true,
"primary_contact_user": {
"user_uuid": "cb51b9fc-6a6e-4b98-885f-5d21041c1403",
"first_name": "Jane",
"last_name": "Doe",
"email": "fake@4over.com",
"user_notes": "test",
"created_at": "2012-09-10 07:00:00.000000+0000",
"updated_at": "2018-05-31 15:48:19.140525-07",
"deleted_at": "",
"organizations": "https://sandbox-api.4over.com/users/cb51b9fc-6a6e-4b98-885f-5d21041c1403/organizations",
"logins": "https://sandbox-api.4over.com/users/cb51b9fc-6a6e-4b98-885f-5d21041c1403/logins",
"token": "47a11796c675bbde6e3215239cd1a4c76255e854",
"timestamp": "0.09683600 1539885980",
"current_organization_uuid": "a4377724-8819-4a96-bc2b-3877b269f989"
}
}
},
"paying_user": {
"user_uuid": "0e153dc0-9b7b-47e8-8cfd-e50d88817ffb",
"first_name": "Test",
"last_name": "Tester",
"email": "fake@4over.com",
"user_notes": "testing ",
"created_at": "2013-08-26 07:00:00.000000+0000",
"updated_at": "2018-05-31 15:48:19.773569-07",
"deleted_at": "",
"organizations": "https://sandbox-api.4over.com/users/0e153dc0-9b7b-47e8-8cfd-e50d88817ffb/organizations",
"logins": "https://sandbox-api.4over.com/users/0e153dc0-9b7b-47e8-8cfd-e50d88817ffb/logins",
"token": "19253d572c2e5db795b4a8c846135218587c065b",
"timestamp": "0.09695700 1539885980",
"current_organization_uuid": "a4377724-8819-4a96-bc2b-3877b269f989"
},
"created_at": "2018-10-18T18:06:19+0000"
},
"payment_type": "authnet"
}