Last active
January 20, 2024 15:03
-
-
Save mikkelrask/46374d57bee7f3ee8c7183683ace0262 to your computer and use it in GitHub Desktop.
Create customer payload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
url = "https://app.rackbeat.com/api/customers" | |
payload = { | |
'number': '50487668', | |
'company_name': 'Rackbeat + Netvisor', | |
'customer_group_id': '1001', | |
'payment_terms_id': '2', | |
'company_vat': 'FI12345678', # The key accepts both strings and integers, and will respond with an int, if given one | |
'contact_email': 'sami.salonen@email.com', | |
'vat_zone': 'domestic', | |
'address_city': 'København', | |
'address_country': 'Danmark', | |
'address_name': 'Netvisor+Rackbeat', | |
'address_state': 'Hovedstaden', | |
'address_street': 'Gærtovet 1-5', | |
'address_street2': '', | |
'address_zipcode': '1699', | |
'currency': 'DKK', | |
'contact_phone': '+4550487667', | |
'ean': '1313131313133', | |
'delivery_terms_id': '1001', | |
'employee_id': '667', | |
'layout_id': '1', | |
'general_discount_percentage': '0', | |
'invoice_email': 'sami.salonen+spam@email.com', | |
'locale': 'FI', | |
'is_barred': 'false', | |
'max_credit': '10000', | |
'offer_email': 'sami.salonen+trash@email.com', | |
'order_email': 'sami.salonen+confirmations@email.com', | |
'our_reference_id': '667', | |
'their_reference_id': '', | |
'attention_id': '2342' | |
} | |
headers = { | |
'Authorization': 'Bearer YOUR_RACKBEAT_API_KEY' # Created at https://app.rackbeat.com/settings/api | |
} | |
response = requests.request("POST", url, headers=headers, data=payload, files=files) | |
print(response.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment