POST /batches/{id}/payments
This operation is used to add one or more Payments to user(s) for a specific Batch that was created using POST /batches
.
Validation will occur on each Payment when adding payments to a Batch. A Payment must have at least a valid MSISDN and an amount to PAY. All validation must succeed before the list of payments is added to the Batch.
Multiple payments to the same MSISDN are accepted. These payments will appear as multiple payments in the user's statement.
Payments can be made to 6DOT50 and non-6DOT50 registered members:
Payments to non-members will be automatically sent a SMS once the batch is submitted for payment.
Payments to existing members, who have the app installed, will receive a push notification that they have received a payment.
If your Pay account has been enabled with referral capability, the fields referralAmount and referralMsisdn may be used, otherwise they will be ignored.
A Batch must be in DRAFT status to add any Payments to it.
Request
Ensure the bearer token is included in the Header of the POST operation:
Authorization
Yes
id
Yes
The Batch ID to add Payment(s) to
The operation accepts an array of Payment
s to add to the specified Batch:
clearExisting
Yes
Set ClearExisting
to true
if you would like to remove all Payments currently in the Batch and replace them with a new list of Payments.
payments
Yes
Payment
msisdn
Yes
The mobile number to pay, formatted in international dialing format. e.g. 27821231234.
amount
Yes
The Amount to transfer to the MSISDN (up to 2 decimal places).
firstname
No
First name of the person to pay (optional)
lastname
No
Last name of the person to pay (optional)
externalId
No
Optional payment identifier that can be supplied by external system for tracing purposes. If supplied, the external ID must be unique.
referralAmount
No
The Amount to allocate to a referral (optional)
referralMsisdn
No
Referral MSISDN to pay (international format, e.g. 27821231234)
The use of referralAmount
and referralMsisdn
requires your PAY account to be enabled at the Organisational level. Please contact Support for more information.
Response
If successful, the operation will return the following response, which includes the standard Batch response, a Summary for the Batch, as well as Payment(s) that were added to the Batch:
id
string($guid)
Batch ID.
name
string
Friendly name of the Batch.
externalId
string
External ID of the Batch.
statusCode
string
Status of the Batch.
createdAt
string($date-time)
Date and time when the Batch was created.
summary
payments
BatchSummary
paymentsAmount
decimal
Total value of payments to be made
paymentsCount
int32
Total count of payments to be made
referralsAmount
decimal
Total value of referral payments to be made
settledAmount
decimal
Total value of payments that have been settled to users (i.e. paid to their accounts). The balance (paymentsAmount
less settledAmount
) is the value of payments pending to non-6DOT50 members (i.e. still to join)
settledCount
int32
Total count of payments settled
cancelledAmount
decimal
Total amount of payments cancelled in the batch (e.g. by using cancel operation)
cancelledCount
int32
Total count of payments cancelled
Payment
id
string($guid)
Unique ID for the Payment. can be used to perform payment specific operations using /payments
batchId
string($guid)
The Batch ID that the Payment is part of.
msisdn
string
The mobile number that will be paid, formatted in international dialing format. e.g. 27821231234.
amount
decimal
The amount that will be paid for the Payment.
firstname
string
Firstname of the user.
lastname
string
Lastname of the user.
externalId
string
Payment identifier supplied by external system for tracing purposes.
statusCode
string
settledAt
string($date-time)
The date at which the Payment was paid into the user's account.
isMember
boolean
true = the user is a member of 6DOT50, false = the user is not a member of 6DOT50.
referralAmount
decimal
The Amount to allocate as a referral. Only applicable if Referral capability has been enabled for the Organisation.
referralMsisdn
string
The MSISDN of the referral. Only applicable if Referral capability has been enabled for the Organisation.
createdAt
string($date-time)
The date and time when the Payment instruction was created.
Payment Validation
Validation will occur on each payment when adding Payment(s) to a Batch. A Payment must have at least a valid MSISDN and an amount to PAY. All validation must succeed before Payment(s) are added to the Batch.
Should validation fail when attempting to add a Payment, a 400 Bad Request will be returned with an array of validation failures:
errorMessage
string
A friendly description of the validation error
fieldName
string
The Field that failed validation, .e.g msisdn
fieldValue
string
The Value for the field that failed validation
The following is an example payload and responses that failed validation:
Last updated