Ensure that all API calls are made with TLS 1.1 or higher.
/Accounts
/RecurringSubscriptions
/RecurringSubscriptions/{id}
/RecurringSubscriptions?{status}
/RecurringPayments
/RecurringPayments/{id}
/RecurringPayments?{status}
The authorization used is basic authentication and you need an Agent ID and an API Key to call these methods.
The Agent ID and an API Key are used to create an auth-string which is used in the message headers to authorize calls.
Auth-string = Base64 representation of “Agent ID:API Key”
Example
Agent ID = 4
API Key = 2acab30d-fe50-426f-90d7-8c60a7eb31d4
Combined these give us a credential string:
4:2acab30d-fe50-426f-90d7-8c60a7eb31d4
Which base64-encoded gives us the auth-string:
NDoyYWNhYjMwZC1mZTUwLTQyNmYtOTBkNy04YzYwYTdlYjMxZDQ=
Request
GET https://test-api.payson.se/2.0/Accounts Host: test-api.payson.se Authorization: Basic NDoyYWNhYjMwZC1mZTUwLTQyNmYtOTBkNy04YzYwYTdlYjMxZDQ= Content-Type: application/json
Response Codes | Status | Description |
---|---|---|
200 | Ok | The call was successful. The requested resource will be returned in the response body. |
401 | Unauthorized | The authorization failed. |
Response
HTTP/1.1 200 OK Content-Type: application/json
{ "accountEmail":"testagent-checkout2@payson.se", "status":"Approved", "merchantId":4, "enabledForInvoice":true, "enabledForpaymentPlan":true, "enabledForRecurringPayments":true }
Request
POST https://test-api.payson.se/2.0/RecurringSubscriptions Host: test-api.payson.se Authorization: Basic NDoyYWNhYjMwZC1mZTUwLTQyNmYtOTBkNy04YzYwYTdlYjMxZDQ= Content-Type: application/json
{ "customer":{ (customer object, optional) "city": (string, optional), "countryCode": (string, optional), "identityNumber": (string, optional), "email": (string, optional), "firstName": (string, optional), "lastName": (string, optional), "phone": (string, optional), "postalCode": (string, optional), "street": (string, optional), "type": (string, optional) }, "agreement":{ (agreement object, required) "currency": (string, required) }, "merchant":{ (merchant object, required) "checkoutUri": (string, required), "confirmationUri": (string, required), "notificationUri": (string, required), "termsUri": (string, required), "partnerId": (string, optional), "validationUri": (string, optional), "integrationInfo": (string, optional), "reference": (string, optional) }, "gui":{ (gui object, optional) "colorScheme": (string, optional), "locale": (string, optional), "requestPhone": (boolean, optional), "phoneOptional": (boolean, optional), "verification": (string, optional), "countries": (array, optional) } }
{ "merchant":{ "checkoutUri":"https://www.examplestore.com/checkout.php", "confirmationUri":"https://www.examplestore.com/confirmation.php", "notificationUri":"https://www.examplestore.com/notification.php", "termsUri":"https://www.examplestore.com/terms.php" }, "agreement":{ "currency":"sek" } }
Response Codes | Status | Description |
---|---|---|
201 | Created | The call was successful. The created resource will be returned in the response body. |
400 or 500 | Bad request | The call failed. Look at the returned JSON-object in the response body for more information. |
401 | Unauthorized | The authorization failed. |
Response
HTTP/1.1 201 Created Location: https://test-api.payson.se/2.0/RecurringSubscriptions/bfac7c19-d3cc-4f65-938c-a9d700d1d24f
{ "status": "created", "id": "bfac7c19-d3cc-4f65-938c-a9d700d1d24f", "snippet": "<div id='paysonContainer' url='https://test-www.payson.se/embedded/recurring?id=bfac7c19-d3cc-4f65-938c-a9d700d1d24f'></div><script type='text/javascript' src='https://test-www.payson.se/embedded/Content/payson.js?v2'></script>", "agreement": { "currency": "sek" }, "customer": { "city": null, "countryCode": null, "identityNumber": null, "email": null, "firstName": null, "lastName": null, "phone": null, "postalCode": null, "street": null, "type": "person" }, "merchant": { "checkoutUri": "https://www.examplestore.com/checkout.php", "confirmationUri": "https://www.examplestore.com/confirmation.php", "partnerId": null, "notificationUri": "https://www.examplestore.com/notification.php", "validationUri": null, "termsUri": "https://www.examplestore.com/terms.php", "integrationInfo": null, "reference": null }, "gui": { "colorScheme": "white", "locale": "en", "requestPhone": false, "phoneOptional": false, "verification": "none", "countries": null }, "history": { "created": "2019-01-16T13:43:56", "awaitingSubscription": null, "customerSubscribed": null, "customerUnsubscribed": null, "canceled": null, "expired": null }, "links": [ { "href": "https://test-api.payson.se/2.0/RecurringSubscriptions/bfac7c19-d3cc-4f65-938c-a9d700d1d24f", "rel": "self" } ] }
Request
GET https://test-api.payson.se/2.0/RecurringSubscriptions/bfac7c19-d3cc-4f65-938c-a9d700d1d24f Host: test-api.payson.se Authorization: Basic NDoyYWNhYjMwZC1mZTUwLTQyNmYtOTBkNy04YzYwYTdlYjMxZDQ=
Response Codes | Status | Description |
---|---|---|
200 | Ok | The call was successful. The resource will be returned in the response body. |
401 | Unauthorized | The authorization failed. |
404 | Not found | The requested resource was not found. |
Response
HTTP/1.1 200 OK Content-Type: application/json
{ "status": "created", "id": "bfac7c19-d3cc-4f65-938c-a9d700d1d24f", "snippet": "<div id='paysonContainer' url='https://test-www.payson.se/embedded/recurring?id=bfac7c19-d3cc-4f65-938c-a9d700d1d24f'></div><script type='text/javascript' src='https://test-www.payson.se/embedded/Content/payson.js?v2'></script>", "agreement": { "currency": "sek" }, "customer": { "city": null, "countryCode": null, "identityNumber": null, "email": null, "firstName": null, "lastName": null, "phone": null, "postalCode": null, "street": null, "type": "person" }, "merchant": { "checkoutUri": "https://www.examplestore.com/checkout.php", "confirmationUri": "https://www.examplestore.com/confirmation.php", "partnerId": null, "notificationUri": "https://www.examplestore.com/notification.php", "validationUri": null, "termsUri": "https://www.examplestore.com/terms.php", "integrationInfo": null, "reference": null }, "gui": { "colorScheme": "white", "locale": "en", "requestPhone": false, "phoneOptional": false, "verification": "none", "countries": null }, "history": { "created": "2019-01-16T13:43:56", "awaitingSubscription": null, "customerSubscribed": null, "customerUnsubscribed": null, "canceled": null, "expired": null }, "links": [ { "href": "https://test-api.payson.se/2.0/RecurringSubscriptions/bfac7c19-d3cc-4f65-938c-a9d700d1d24f", "rel": "self" } ] }
Request
PUT https://test-api.payson.se/2.0/RecurringSubscriptions/bfac7c19-d3cc-4f65-938c-a9d700d1d24f Host: test-api.payson.se Authorization: Basic NDoyYWNhYjMwZC1mZTUwLTQyNmYtOTBkNy04YzYwYTdlYjMxZDQ= Content-Type: application/json
{ "status": "created", "id": "bfac7c19-d3cc-4f65-938c-a9d700d1d24f", "agreement": { "currency": "sek" }, "merchant": { "checkoutUri": "https://www.examplestore.com/checkout.php", "confirmationUri": "https://www.examplestore.com/confirmation.php", "notificationUri": "https://www.examplestore.com/notification.php", "termsUri": "https://www.examplestore.com/terms.php", }, "gui": { "colorScheme": "gray" } }
Response Codes | Status | Description |
---|---|---|
200 | Ok | The call was successful. The updated resource will be returned in the response body. |
400 | Bad request | The call failed. Look at the returned JSON-object in the response body for more information. |
401 | Unauthorized | The authorization failed. |
Response
HTTP/1.1 200 OK Location: https://test-api.payson.se/2.0/Checkouts/a273a0b8-402c-428f-99a0-a93f00df6bf6 Content-Type: application/json
{ "status": "created", "id": "bfac7c19-d3cc-4f65-938c-a9d700d1d24f", "snippet": "<div id='paysonContainer' url='https://test-www.payson.se/embedded/recurring?id=bfac7c19-d3cc-4f65-938c-a9d700d1d24f'></div><script type='text/javascript' src='https://test-www.payson.se/embedded/Content/payson.js?v2'></script>", "agreement": { "currency": "sek" }, "customer": { "city": null, "countryCode": null, "identityNumber": null, "email": null, "firstName": null, "lastName": null, "phone": null, "postalCode": null, "street": null, "type": "person" }, "merchant": { "checkoutUri": "https://www.examplestore.com/checkout.php", "confirmationUri": "https://www.examplestore.com/confirmation.php", "partnerId": null, "notificationUri": "https://www.examplestore.com/notification.php", "validationUri": null, "termsUri": "https://www.examplestore.com/terms.php", "integrationInfo": null, "reference": null }, "gui": { "colorScheme": "gray", "locale": "en", "requestPhone": false, "phoneOptional": false, "verification": "none", "countries": null }, "history": { "created": "2019-01-16T13:43:56", "awaitingSubscription": null, "customerSubscribed": null, "customerUnsubscribed": null, "canceled": null, "expired": null }, "links": [ { "href": "https://test-api.payson.se/2.0/RecurringSubscriptions/bfac7c19-d3cc-4f65-938c-a9d700d1d24f", "rel": "self" } ] }
Request
GET https://test-api.payson.se/2.0/RecurringSubscriptions?status=customerSubscribed Host: test-api.payson.se Authorization: Basic NDoyYWNhYjMwZC1mZTUwLTQyNmYtOTBkNy04YzYwYTdlYjMxZDQ= Content-Type: application/json
Response Codes | Status | Description |
---|---|---|
200 | Ok | The call was successful. The requested resource will be returned in the response body. |
400 | Bad request | The call failed. Look at the returned JSON-object in the response body for more information. |
401 | Unauthorized | The authorization failed. |
Response
HTTP/1.1 200 OK Content-Type: application/json
{ "pageSize": 20, "page": 1, "totalPages": 1, "count": 13, "totalCount": 13, "data": [ { "status": "customerSubscribed", "id": "4faba7e7-9913-48a4-81e8-a9a100e348ea", "snippet": "<div id='paysonContainer' url='https://test-www.payson.se/embedded/recurring?id=4faba7e7-9913-48a4-81e8-a9a100e348ea'></div><script type='text/javascript' src='https://test-www.payson.se/embedded/Content/payson.js?v2'></script>", "agreement": { "currency": "sek" }, "customer": { "city": "Stan", "countryCode": "SE", "identityNumber": "4605092222", "email": "test@payson.se", "firstName": "Tess", "lastName": "Persson", "phone": null, "postalCode": "99999", "street": "Testgatan 1", "type": "person" }, "merchant": { "checkoutUri": "https://demoshop.payson.se/2.0/apidemo/Checkout/Recurring/14", "confirmationUri": "https://demoshop.payson.se/2.0/apidemo/Confirmation/Recurring/14", "partnerId": null, "notificationUri": "https://demoshop.payson.se/2.0/apidemo/Notification/Recurring/14", "validationUri": null, "termsUri": "https://demoshop.payson.se/2.0/apidemo/Terms", "integrationInfo": null, "reference": null }, "gui": { "colorScheme": "white", "locale": "sv", "requestPhone": false, "phoneOptional": false, "verification": "none", "countries": null }, "history": { "created": "2018-11-23T14:47:30", "awaitingSubscription": "2018-11-23T14:47:45", "customerSubscribed": "2018-11-23T14:48:03", "customerUnsubscribed": null, "canceled": null, "expired": null }, "links": [ { "href": "https://test-api.payson.se/2.0/RecurringSubscriptions/4faba7e7-9913-48a4-81e8-a9a100e348ea", "rel": "self" } ] }, { "status": "customerSubscribed", "id": "dafd580e-3bd1-4aa7-bab3-a9cb00b513fa", "snippet": "<div id='paysonContainer' url='https://test-www.payson.se/embedded/recurring?id=dafd580e-3bd1-4aa7-bab3-a9cb00b513fa'></div><script type='text/javascript' src='https://test-www.payson.se/embedded/Content/payson.js?v2'></script>", "agreement": { "currency": "sek" }, "customer": { "city": "Stan", "countryCode": "SE", "identityNumber": "4605092222", "email": "tess.t.persson@test.se", "firstName": "Tess", "lastName": "Persson", "phone": null, "postalCode": "99999", "street": "Testgatan 1", "type": "person" }, "merchant": { "checkoutUri": "http://localhost/paysonsandbox/example/recurring-subscription-create.php", "confirmationUri": "http://localhost/paysonsandbox/example/confirmation.php?ref=prp", "partnerId": null, "notificationUri": "http://localhost/paysonsandbox/example/notification.php?ref=prp", "validationUri": null, "termsUri": "http://localhost/paysonsandbox/example/terms.php", "integrationInfo": null, "reference": null }, "gui": { "colorScheme": "white", "locale": "sv", "requestPhone": false, "phoneOptional": false, "verification": "none", "countries": null }, "history": { "created": "2019-01-04T11:59:16", "awaitingSubscription": "2019-01-04T11:59:25", "customerSubscribed": "2019-01-04T11:59:27", "customerUnsubscribed": null, "canceled": null, "expired": null }, "links": [ { "href": "https://test-api.payson.se/2.0/RecurringSubscriptions/dafd580e-3bd1-4aa7-bab3-a9cb00b513fa", "rel": "self" } ] } ] }
Request
POST https://test-api.payson.se/2.0/RecurringPayments Host: test-api.payson.se Authorization: Basic NDoyYWNhYjMwZC1mZTUwLTQyNmYtOTBkNy04YzYwYTdlYjMxZDQ=
{ "subscriptionId": (subscription id, required), "notificationUri": (string, required), "expirationDate": (string, optional), "order":{ (order object, required) "currency": (string, required), "items":[ (array, required) { "name": (string, required), "unitPrice": (decimal, required), "quantity": (decimal, required), "taxRate": (decimal, optional), "reference": (string, optional), "discountRate": (decimal, optional), "ean": (string, optional), "imageUri": (string, optional), "type": (string, optional), "uri": (string, optional) } ] }, "description": (string, optional) }
{ "subscriptionId": "5d4961bd-d800-4353-9e0a-a9d500a16e54", "notificationUri": "https://www.examplestore.com/notification.php", "expirationDate" : "2030-01-01T13:37:00", "order": { "currency": "sek", "items": [ { "name": "Product 1", "unitPrice": 150.00, "quantity": 1.00, "taxRate": 0.25 } ] } }
Response Codes | Status | Description |
---|---|---|
200 | Ok | The call was successful. The resource will be returned in the response body. |
401 | Unauthorized | The authorization failed. |
404 | Not found | The requested resource was not found. |
Response
HTTP/1.1 200 OK Content-Type: application/json
{ "id": "1e5a7ce0-008b-4421-8c34-a9d8009b27cc", "created": "2019-01-17T10:24:54", "subscriptionId": "5d4961bd-d800-4353-9e0a-a9d500a16e54", "expirationDate" : "2030-01-01T13:37:00", "purchaseId": 3808235, "order": { "currency": "sek", "totalFeeExcludingTax": 4.5, "totalFeeIncludingTax": 5.63, "totalPriceExcludingTax": 120, "totalPriceIncludingTax": 150, "totalTaxAmount": 30, "totalCreditedAmount": 0, "items": [ { "itemId": "ffd6e0e3-c4fd-4ad2-b425-a9d8009b27cc", "discountRate": 0, "ean": null, "imageUri": null, "name": "Product 1", "quantity": 1, "reference": null, "taxRate": 0.25, "totalPriceExcludingTax": 120, "totalPriceIncludingTax": 150, "totalTaxAmount": 30, "creditedAmount": 0, "type": "physical", "unitPrice": 150, "uri": null } ] }, "description": null, "notificationUri": null, "status": "processingPayment", "links": [ { "href": "https://test-api.payson.se/2.0/RecurringPayments/1e5a7ce0-008b-4421-8c34-a9d8009b27cc", "rel": "self" } ] }
Request
GET https://test-api.payson.se/2.0/RecurringPayments/1e5a7ce0-008b-4421-8c34-a9d8009b27cc Host: test-api.payson.se Authorization: Basic NDoyYWNhYjMwZC1mZTUwLTQyNmYtOTBkNy04YzYwYTdlYjMxZDQ=
Response Codes | Status | Description |
---|---|---|
200 | Ok | The call was successful. The resource will be returned in the response body. |
401 | Unauthorized | The authorization failed. |
404 | Not found | The requested resource was not found. |
Response
HTTP/1.1 200 OK Content-Type: application/json
{ "id": "1e5a7ce0-008b-4421-8c34-a9d8009b27cc", "created": "2019-01-17T10:24:54", "subscriptionId": "5d4961bd-d800-4353-9e0a-a9d500a16e54", "purchaseId": 3808235, "order": { "currency": "sek", "totalFeeExcludingTax": 4.5, "totalFeeIncludingTax": 5.63, "totalPriceExcludingTax": 120, "totalPriceIncludingTax": 150, "totalTaxAmount": 30, "totalCreditedAmount": 0, "items": [ { "itemId": "ffd6e0e3-c4fd-4ad2-b425-a9d8009b27cc", "discountRate": 0, "ean": null, "imageUri": null, "name": "Product 1", "quantity": 1, "reference": null, "taxRate": 0.25, "totalPriceExcludingTax": 120, "totalPriceIncludingTax": 150, "totalTaxAmount": 30, "creditedAmount": 0, "type": "physical", "unitPrice": 150, "uri": null } ] }, "description": null, "notificationUri": null, "status": "readyToShip", "links": [ { "href": "https://test-api.payson.se/2.0/RecurringPayments/1e5a7ce0-008b-4421-8c34-a9d8009b27cc", "rel": "self" } ] }
Request
PUT https://test-api.payson.se/2.0/RecurringPayments/1e5a7ce0-008b-4421-8c34-a9d8009b27cc Host: test-api.payson.se Authorization: Basic NDoyYWNhYjMwZC1mZTUwLTQyNmYtOTBkNy04YzYwYTdlYjMxZDQ=
{ "id": "1e5a7ce0-008b-4421-8c34-a9d8009b27cc", "created": "2019-01-17T10:24:54", "subscriptionId": "5d4961bd-d800-4353-9e0a-a9d500a16e54", "purchaseId": 3808235, "order": { "currency": "sek", "items": [ { "itemId": "ffd6e0e3-c4fd-4ad2-b425-a9d8009b27cc", "name": "Product 1", "quantity": 1, "taxRate": 0.25, "creditedAmount": 10, "unitPrice": 150 } ] }, "notificationUri": "https://www.examplestore.com/notification.php", "status": "shipped" }
Response Codes | Status | Description |
---|---|---|
200 | Ok | The call was successful. The resource will be returned in the response body. |
401 | Unauthorized | The authorization failed. |
404 | Not found | The requested resource was not found. |
Response
HTTP/1.1 200 OK Content-Type: application/json
{ "id": "1e5a7ce0-008b-4421-8c34-a9d8009b27cc", "created": "2019-01-17T10:24:54", "subscriptionId": "5d4961bd-d800-4353-9e0a-a9d500a16e54", "purchaseId": 3808235, "order": { "currency": "sek", "totalFeeExcludingTax": 4.5, "totalFeeIncludingTax": 5.63, "totalPriceExcludingTax": 120, "totalPriceIncludingTax": 150, "totalTaxAmount": 30, "totalCreditedAmount": 10, "items": [ { "itemId": "ffd6e0e3-c4fd-4ad2-b425-a9d8009b27cc", "discountRate": 0, "ean": null, "imageUri": null, "name": "Product 1", "quantity": 1, "reference": null, "taxRate": 0.25, "totalPriceExcludingTax": 120, "totalPriceIncludingTax": 150, "totalTaxAmount": 30, "creditedAmount": 10, "type": "physical", "unitPrice": 150, "uri": null } ] }, "description": null, "notificationUri": "https://www.examplestore.com/notification.php", "status": "shipped", "links": [ { "href": "https://test-api.payson.se/2.0/RecurringPayments/1e5a7ce0-008b-4421-8c34-a9d8009b27cc", "rel": "self" } ] }
Request
GET https://test-api.payson.se/2.0/RecurringPayments?status=readytoship Host: test-api.payson.se Authorization: Basic NDoyYWNhYjMwZC1mZTUwLTQyNmYtOTBkNy04YzYwYTdlYjMxZDQ= Content-Type: application/json
Response Codes | Status | Description |
---|---|---|
200 | Ok | The call was successful. The requested resource will be returned in the response body. |
400 | Bad request | The call failed. Look at the returned JSON-object in the response body for more information. |
401 | Unauthorized | The authorization failed. |
Response
HTTP/1.1 200 OK Content-Type: application/json
{ "pageSize": 20, "page": 1, "totalPages": 1, "count": 13, "totalCount": 13, "data": [ { "id": "0fb03b40-8a1b-4c4a-9c4b-a9d1010d2a3f", "created": "2019-01-10T17:20:00", "subscriptionId": "3ad8eb16-ecce-4cce-801c-a9d100fc4504", "purchaseId": 3807969, "order": { "currency": "sek", "totalFeeExcludingTax": 15.39, "totalFeeIncludingTax": 19.24, "totalPriceExcludingTax": 427.14, "totalPriceIncludingTax": 540, "totalTaxAmount": 112.86, "totalCreditedAmount": 0, "items": [ { "itemId": "0b2a5f5f-250a-42b2-84c1-a9d1010d2a40", "discountRate": 0, "ean": null, "imageUri": null, "name": "TestItem3", "quantity": 2, "reference": "R103", "taxRate": 0, "totalPriceExcludingTax": 40, "totalPriceIncludingTax": 40, "totalTaxAmount": 0, "creditedAmount": 0, "type": "physical", "unitPrice": 20, "uri": null }, { "itemId": "6f5f3005-0f6f-4f55-9589-a9d1010d2a40", "discountRate": 0, "ean": null, "imageUri": null, "name": "TestFee", "quantity": 1, "reference": "F001", "taxRate": 0.25, "totalPriceExcludingTax": 80, "totalPriceIncludingTax": 100, "totalTaxAmount": 20, "creditedAmount": 0, "type": "fee", "unitPrice": 100, "uri": null }, { "itemId": "14585100-c3e8-46db-9bf1-a9d1010d2a40", "discountRate": 0, "ean": null, "imageUri": null, "name": "TestItem2", "quantity": 3, "reference": "R102", "taxRate": 0.4, "totalPriceExcludingTax": 107.14, "totalPriceIncludingTax": 150, "totalTaxAmount": 42.86, "creditedAmount": 0, "type": "physical", "unitPrice": 50, "uri": null }, { "itemId": "995f5373-4914-44c4-b038-a9d1010d2a40", "discountRate": 0.5, "ean": null, "imageUri": null, "name": "TestItem1", "quantity": 1, "reference": "R101", "taxRate": 0.25, "totalPriceExcludingTax": 200, "totalPriceIncludingTax": 250, "totalTaxAmount": 50, "creditedAmount": 0, "type": "physical", "unitPrice": 500, "uri": null } ] }, "description": null, "notificationUri": null, "status": "readyToShip", "links": [ { "href": "https://test-api.payson.se/2.0/RecurringPayments/0fb03b40-8a1b-4c4a-9c4b-a9d1010d2a3f", "rel": "self" } ] }, { "id": "607bc67c-8104-43d9-b2b2-a9d101116f9d", "created": "2019-01-10T17:35:33", "subscriptionId": "3ad8eb16-ecce-4cce-801c-a9d100fc4504", "purchaseId": 3807970, "order": { "currency": "sek", "totalFeeExcludingTax": 15.39, "totalFeeIncludingTax": 19.24, "totalPriceExcludingTax": 427.14, "totalPriceIncludingTax": 540, "totalTaxAmount": 112.86, "totalCreditedAmount": 0, "items": [ { "itemId": "5febd768-b57c-4708-9901-a9d101116f9e", "discountRate": 0, "ean": null, "imageUri": null, "name": "TestItem2", "quantity": 3, "reference": "R102", "taxRate": 0.4, "totalPriceExcludingTax": 107.14, "totalPriceIncludingTax": 150, "totalTaxAmount": 42.86, "creditedAmount": 0, "type": "physical", "unitPrice": 50, "uri": null }, { "itemId": "31b0f4cf-c589-452b-aadf-a9d101116f9e", "discountRate": 0, "ean": null, "imageUri": null, "name": "TestFee", "quantity": 1, "reference": "F001", "taxRate": 0.25, "totalPriceExcludingTax": 80, "totalPriceIncludingTax": 100, "totalTaxAmount": 20, "creditedAmount": 0, "type": "fee", "unitPrice": 100, "uri": null }, { "itemId": "de66f27e-3dfc-4f43-ae0e-a9d101116f9e", "discountRate": 0, "ean": null, "imageUri": null, "name": "TestItem3", "quantity": 2, "reference": "R103", "taxRate": 0, "totalPriceExcludingTax": 40, "totalPriceIncludingTax": 40, "totalTaxAmount": 0, "creditedAmount": 0, "type": "physical", "unitPrice": 20, "uri": null }, { "itemId": "ee866b30-e024-49e2-b209-a9d101116f9e", "discountRate": 0.5, "ean": null, "imageUri": null, "name": "TestItem1", "quantity": 1, "reference": "R101", "taxRate": 0.25, "totalPriceExcludingTax": 200, "totalPriceIncludingTax": 250, "totalTaxAmount": 50, "creditedAmount": 0, "type": "physical", "unitPrice": 500, "uri": null } ] }, "description": null, "notificationUri": null, "status": "readyToShip", "links": [ { "href": "https://test-api.payson.se/2.0/RecurringPayments/607bc67c-8104-43d9-b2b2-a9d101116f9d", "rel": "self" } ] } ] }
After a subscription or payment has had its status changed to a status where the merchant may need to act, a notification will be sent. The notification is a POST call to the notificationUri specified with the id as a querystring parameter.
Example
https://www.myexamplestore.nu/notification.php/?subscription=ccf49366-ea2d-410f-8bbf-a97b00912a37
https://www.myexamplestore.nu/notification.php/?payment=ccf49366-ea2d-410f-8bbf-a97b00912a37
Make sure the notificationUri is publicly accessible for notifications to work.
The POST to notificationUri expect a 200 OK in response and will keep trying for up to 24 hours if the response is anything else.
Subscriptions – Notification is sent when | The subscription will have status |
---|---|
The subscription is complete and the merchant can now create payments. | customerSubscribed |
The subscription is canceled. | customerUnSubscribed |
Payments – Notification is sent when | The payment will have status |
---|---|
The payment is complete and the order should be shipped. | readyToShip |
The payment has been marked as shipped. | shipped |
Money has been paid out to the merchant´s PaysonAccount. | paidToAccount |
The payment has been denied. | denied |
The payment was canceled. | canceled |
The payment has been fully credited. | paidToAccount* |
The payment has been partially credited. | shipped* |
*Check totalCreditedAmount to determine if the payment has been credited.