MyPages API
Pay

Pay

When you have the My Pages section in place and want the customer to be able to actually pay, you can use this method to get the information needed to initialize a payment.

POST /Pay

* Required

PropertyData typeDescription
BODY:
languagestringLanguage in the checkout
accountId*string (guid)ID to the account the customer wants to initialize payment for. Could also be the ID of an invoice.

Request

{
  "language": "string",
  "accountId": "string"
}

Response

{
  "purchaseId": "string",
  "jwt": "string"
}

Response parameters

PropertyData typeDescription
purchaseIdstringUnique ID to the purchase, needed to initialize the checkout
jwtstringPurchase JWT token, needed to initialize the checkout

Payment status

Get information regarding the status of a payment

POST /Pay/Status

* Required

PropertyData typeDescription
BODY:
purchaseIdstringUnique ID to the purchase
accountId*stringID of the account you want to know status on. Could also be the ID of an invoice.

Request

{
  "purchaseId": "string",
  "accountId": "string"
}

Response

{
  "state": "paid"
}

Response parameters

PropertyData typeDescription
Statestring (Enum)StatusTypes:
[ Paid, Unpaid, Error, Cancelled, TimedOut ]