Security
OAuth2ClientCredentials(Required scopes: organization:payflow:create)
Any of:
Can be set to describe which user in the remote ERP system that created the payment or order, this is helpful for reporting purposes and if the user also have access to the Spense platform the payment will be attached to this user. If the user does not have an account, a user with no roles or access will be created.
string (email)
Any of:
New field added 2024-08-27. Use the partner API to fetch a list of payment methods. Sending null here will rely on the default payment method (standard way of creating payments). A payment method can be anything, for example a terminal, invoice, payment link or any other future types of payments that may be implemented.
string
POST
curl -i -X POST \
https://api.spense.no/api/payments \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-H 'X-Organization-Id: string' \
-d '{
"customer": {
"email": "",
"phone": {
"countryCode": "",
"number": ""
},
"firstName": "",
"lastName": "",
"customerNumber": "",
"billingAddress": {
"careOf": "",
"street": "",
"secondary": "",
"postalCode": "",
"city": "",
"country": "string",
"countryCode": "string"
},
"type": "person"
},
"order": {
"orderNumber": "",
"objects": []
},
"payment": {
"currency": "",
"totalGrossAmount": 0,
"totalNetAmount": 0,
"installments": [
{
"date": "2019-08-24",
"grossAmount": 0,
"items": [
{
"description": "",
"grossUnitPrice": 0,
"netUnitPrice": 0,
"grossTotalPrice": 0,
"netTotalPrice": 0,
"vatAmount": 0,
"quantity": 0,
"taxRate": 0,
"discountRate": 0,
"lineType": "regular"
}
]
}
],
"installmentsMode": "pay-down",
"items": [],
"dueDate": "2019-08-24",
"paymentRef": "",
"invoiceNumber": "",
"customerReference": "",
"invoiceComments": "string",
"profileId": "string",
"paymentDepartment": "UNKNOWN",
"internalRef": "",
"externalRef": ""
},
"communication": {
"send_payment_link": true,
"send_payment_reminder": true
},
"behaviour": {
"redirectSuccessUrl": "http://example.com",
"redirectCancelUrl": "http://example.com",
"cancelButtonText": "Cancel"
},
"serviceAdvisorEmail": "user@example.com",
"paymentMethodId": "string",
"callback": {
"url": "",
"status_update_url": "",
"terminal_failure_url": "",
"api_key": "string"
},
"supportFunctions": [
{
"sharebox": {
"useSharebox": false,
"plateNumber": "string"
}
}
]
}'Response
{ "id": "1234567890abcdef12345678", "_links": { "gui": "", "longGui": "" }, "installments": [ { … } ] }