### GET /v1/Gifts
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for GET /v1/Gifts
```markdown
### Responses
#### 200 - Previous Gifts
Empty response body
#### 400 - API-user lacks core system permissions, please contact the administrator
API-user lacks core system permissions, please contact the administrator
#### 500 - An unexpected error occurred
An unexpected error occurred
### Example Usage
```bash
curl -X GET "https://api.example.com/v1/Gifts"
```
```
--------------------------------
### POST /v1/Gifts
Source: https://api.pennybridge.org/swagger/docs/V1
Depending on the value set in Transaction.Paymentprovider, different fields in other parts of the parameters are required.
E.g.:
Ping Swish e-commerce payment requires User.Phone.
Ping Card and Checkout payments requires Transaction.SuccessUrl and Transaction.CancelUrl.
The user will be redirected to this url after payment UI. The SuccessUrl or CancelUrl can be used to trigger status update on your system.
For Ping Invoice and Deposit, the returned Reference is to be used as payment reference at the bank.
User information is, when consent is given (Gifts.Anonymous=false). also passed on to the donation recipient (the cause).
If Transaction.CallbackUrl is set, a POST call will be made on status changes. Body of the callback is GiftReturnModel.
Callback, SuccessUrl/CancelUrl or polling GET /v1/Gifts/{id} can all be used update payment status in your system.
In Sandbox: Setting Debug.StatusCode will return that status before creating an actual gift and the response body will look like this: {"message":"Debug status set to 201 Created"}.
Status:
executed // The gift is create and sent to the Payment service provider
failed_attempt // The gift has reached max attempts (only active in certain providers)
captured // The payment was successful, the gift is captured
final_failure // The payment failed due to error
cancelled // The payment was cancelled by the user
refunded // The gift is returned to the sender
halted // The gift on hold due to e.g. a refund request
disbursed // The gift has been sent to the organization, final successful status
```markdown
### Parameters
- **createGiftsAndUserModel** (CreateGiftsTransactionBindingModel, body, required): A list of causes, the name of the payment provider and data about the donor.
### Responses
#### 201 - The created Gift
Empty response body
#### 400 - Please examine the response message
Please examine the response message
#### 409 - Please examine the response message
Please examine the response message
#### 500 - Something went wrong in this system or in downstream servers
Something went wrong in this system or in downstream servers
### Example Usage
```bash
curl -X POST "https://api.example.com/v1/Gifts"
```
```
--------------------------------
### GET /v1/Gifts/byReference/{Reference}
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for GET /v1/Gifts/byReference/{Reference}
```markdown
### Parameters
- **Reference** (string, path, required): Reference id from the PSP
### Responses
#### 200 - A single Gift
Empty response body
#### 400 - API-user lacks core system permissions, please contact the administrator
API-user lacks core system permissions, please contact the administrator
#### 404 - A Gift was not found
A Gift was not found
#### 500 - An unexpected error occurred
An unexpected error occurred
### Example Usage
```bash
curl -X GET "https://api.example.com/v1/Gifts/byReference/{Reference}"
```
```
--------------------------------
### GET /v1/Vouchers/{code}
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for GET /v1/Vouchers/{code}
```markdown
### Parameters
- **code** (string, path, required): The code of the voucher
### Responses
#### 200 - A single Voucher
Empty response body
#### 404 - A Voucher was not found or is not valid
A Voucher was not found or is not valid
#### 500 - An unexpected error occurred
An unexpected error occurred
### Example Usage
```bash
curl -X GET "https://api.example.com/v1/Vouchers/{code}"
```
```
--------------------------------
### POST /v1/Gifts/recurring
Source: https://api.pennybridge.org/swagger/docs/V1
Currently ping_autogiro can be used for Transaction.Paymentprovider.
Although the same model as for POST /v1/Gifts are used, CheckoutSettings and Metadata are not considered.
Be sure to set a unique CallbackUrl as to keep track of the series of payment related to this creation.
See Location header in response.
Executed payments from PaymentIds can be looked up at GET /v1/Gifts/{id}.
Although the model for calling is the same as for POST /v1/Gifts, the response is different and CheckoutSettings and Debug are not considered.
Bankgirot is the payment provider of Autogiro and is only available to Swedish customers.
Status:
0: UNSIGNED, // The mandate has been created but not yet signed by the customer.
1: SIGNED, // The mandate has been signed by the customer, typically using BankID.
2: SENT, // The mandate has been sent to Bankgirot for processing after being signed.
3: APPROVED, // The mandate has been approved by Bankgirot.
4: REJECTED, // The mandate has been rejected by Bankgirot or the customer.
5: CANCELLED, // The mandate has been cancelled after being approved.
6: NOT_APPROVED, // The mandate has been rejected by the user bank as the account is not available for the requested type of payment.
```markdown
### Parameters
- **createGiftsAndUserModel** (CreateGiftsTransactionBindingModel, body, required): A list of causes, the name of the payment provider and data about the donor.
### Responses
#### 201 - Recurring payment mandate and it's status
Empty response body
#### 400 - Please examine the response message
Please examine the response message
#### 409 - Please examine the response message
Please examine the response message
#### 500 - Something went wrong in this system or in downstream servers
Something went wrong in this system or in downstream servers
### Example Usage
```bash
curl -X POST "https://api.example.com/v1/Gifts/recurring"
```
```
--------------------------------
### POST /v1/Causes
Source: https://api.pennybridge.org/swagger/docs/V1
If callback is set, the fallowing events will generate a call.
Created = Was created in Pennybridge.
Pending = Waiting for cause to sign the agreement and for internal KYC process to complete. Currently not in operation.
Available = KYC process approved. Cause can start receiving payouts.
Unavailable = For some reason, the cause is no longer available to receive donations. Calling system should not initialize new gifts for this cause. Requests to POST /gifts might be rejected.
```markdown
### Parameters
- **CreateCauseModel** (CreateCauseBindingModel, body, required): Model of the Cause, it's data and it's owner
### Responses
#### 201 - The created Cause
Empty response body
#### 400 - Please examine the response message
Please examine the response message
#### 409 - The Cause already exist, this is the data
The Cause already exist, this is the data
#### 500 - An internal error occurred
An internal error occurred
### Example Usage
```bash
curl -X POST "https://api.example.com/v1/Causes"
```
```
--------------------------------
### GET /v1/Vouchers/{id}
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for GET /v1/Vouchers/{id}
```markdown
### Parameters
- **id** (string, path, required)
### Responses
#### 200 - A single Voucher
Empty response body
#### 404 - A Voucher was not found
A Voucher was not found
#### 500 - An unexpected error occurred
An unexpected error occurred
### Example Usage
```bash
curl -X GET "https://api.example.com/v1/Vouchers/{id}"
```
```
--------------------------------
### GET /v1/Gifts/invoice/{id}
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for GET /v1/Gifts/invoice/{id}
```markdown
### Parameters
- **id** (string, path, required): The payment id of the invoice
### Responses
#### 200 - URL of the invoice
Empty response body
#### 404 - The Gift does not exist OR is not an Invoice
The Gift does not exist OR is not an Invoice
### Example Usage
```bash
curl -X GET "https://api.example.com/v1/Gifts/invoice/{id}"
```
```
--------------------------------
### GET /v1/Gifts/{id}
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for GET /v1/Gifts/{id}
```markdown
### Parameters
- **id** (string, path, required): Id of the gift.
### Responses
#### 200 - A single Gift
Empty response body
#### 400 - API-user lacks core system permissions, please contact the administrator
API-user lacks core system permissions, please contact the administrator
#### 404 - A Gift was not found
A Gift was not found
#### 500 - An unexpected error occurred
An unexpected error occurred
### Example Usage
```bash
curl -X GET "https://api.example.com/v1/Gifts/{id}"
```
```
--------------------------------
### GET /v1/Gifts/{id}/invoice
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for GET /v1/Gifts/{id}/invoice
```markdown
### Parameters
- **id** (string, path, required): The payment id of the invoice
### Responses
#### 200 - URL of the invoice
Empty response body
#### 404 - The Gift does not exist OR is not an Invoice
The Gift does not exist OR is not an Invoice
### Example Usage
```bash
curl -X GET "https://api.example.com/v1/Gifts/{id}/invoice"
```
```
--------------------------------
### GET /v1/Causes/{id}
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for GET /v1/Causes/{id}
```markdown
### Parameters
- **id** (string, path, required)
### Responses
#### 200 - A single Cause, with availability status
Empty response body
#### 400 - API-user lacks core system permissions, please contact the administrator
API-user lacks core system permissions, please contact the administrator
#### 403 - Access to the selected country is not configured
Access to the selected country is not configured
#### 404 - A Cause was not found
A Cause was not found
#### 500 - An unexpected error occurred
An unexpected error occurred
### Example Usage
```bash
curl -X GET "https://api.example.com/v1/Causes/{id}"
```
```
--------------------------------
### GET /v1/Gifts/recurring/{reference}
Source: https://api.pennybridge.org/swagger/docs/V1
Executed payments from PaymentIds can be looked up at GET /v1/Gifts/{id}.
When receiving payment callbacks ur doing a lookup at GET /v1/Gifts/{id} the Status attribute has a slightly different meaning.
final_failure indicate that the a payment (in one to three attempt) was not successful.
cancelled indicate that the whole recurring series has been cancelled and will not make any more payments in the future.
```markdown
### Parameters
- **reference** (string, path, required): Reference id from POST /recurring
### Responses
#### 200 - Information about the recurring mandate
Empty response body
### Example Usage
```bash
curl -X GET "https://api.example.com/v1/Gifts/recurring/{reference}"
```
```
--------------------------------
### GET /v1/Gifts/{id}/receipt
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for GET /v1/Gifts/{id}/receipt
```markdown
### Parameters
- **id** (string, path, required): The payment id
### Responses
#### 200 - URL to download the receipt as a PDF
Empty response body
#### 404 - The Gift does not exist
The Gift does not exist
#### 409 - The Gift is not yet captured
The Gift is not yet captured
### Example Usage
```bash
curl -X GET "https://api.example.com/v1/Gifts/{id}/receipt"
```
```
--------------------------------
### GET /v1/Gifts/{id}/invoice_ocr
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for GET /v1/Gifts/{id}/invoice_ocr
```markdown
### Parameters
- **id** (string, path, required): The payment id of the invoice
### Responses
#### 200 - OCR reference of the invoice
Empty response body
#### 404 - The Gift does not exist
The Gift does not exist
#### 409 - The Gift is already captured
The Gift is already captured
### Example Usage
```bash
curl -X GET "https://api.example.com/v1/Gifts/{id}/invoice_ocr"
```
```
--------------------------------
### PUT /v1/Vouchers/{code}/redeem
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for PUT /v1/Vouchers/{code}/redeem
```markdown
### Parameters
- **code** (string, path, required): The code to redeem
- **GiftAndUser** (CreateGiftsAndUserBindingModel, body, required): Cause(s) to receive the donation and user data for the donor.
In Sandbox: If Debug: true is set, the Voucher will remain in Activated state.
### Responses
#### 200 - A single Voucher
Empty response body
#### 404 - A Voucher was not found or is not valid
A Voucher was not found or is not valid
#### 500 - An unexpected error occurred
An unexpected error occurred
### Example Usage
```bash
curl -X PUT "https://api.example.com/v1/Vouchers/{code}/redeem"
```
```
--------------------------------
### PUT /v1/Vouchers/{id}/activate
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for PUT /v1/Vouchers/{id}/activate
```markdown
### Parameters
- **id** (string, path, required)
### Responses
#### 200 - The activated Voucher
Empty response body
#### 404 - The Voucher was not found
The Voucher was not found
#### 409 - Requested action could not be performed due to conflicting state.
Requested action could not be performed due to conflicting state.
#### 500 - An unexpected error occurred
An unexpected error occurred
### Example Usage
```bash
curl -X PUT "https://api.example.com/v1/Vouchers/{id}/activate"
```
```
--------------------------------
### API Overview: Pennybridge API
Source: https://api.pennybridge.org/swagger/docs/V1
OpenAPI specification version V1
```yaml
# Pennybridge API
# Version: V1
OpenAPI specification
# Base URL: Not specified
```
--------------------------------
### PUT /v1/Vouchers/{id}/note/{note}
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for PUT /v1/Vouchers/{id}/note/{note}
```markdown
### Parameters
- **id** (string, path, required)
- **note** (string, path, required)
### Responses
#### 200 - The updated Voucher
Empty response body
#### 404 - A Voucher was not found
A Voucher was not found
#### 500 - An unexpected error occurred
An unexpected error occurred
### Example Usage
```bash
curl -X PUT "https://api.example.com/v1/Vouchers/{id}/note/{note}"
```
```
--------------------------------
### PUT /v1/Vouchers/{id}/status/{status}
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for PUT /v1/Vouchers/{id}/status/{status}
```markdown
### Parameters
- **id** (string, path, required): Id of the Voucher
- **status** (string, path, required): Status to request
### Responses
#### 200 - The updated Voucher
Empty response body
#### 404 - A Voucher was not found
A Voucher was not found
#### 409 - Requested action could not be performed due to conflicting status.
Requested action could not be performed due to conflicting status.
#### 500 - An unexpected error occurred
An unexpected error occurred
### Example Usage
```bash
curl -X PUT "https://api.example.com/v1/Vouchers/{id}/status/{status}"
```
```
--------------------------------
### PUT /v1/Causes/{id}
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for PUT /v1/Causes/{id}
```markdown
### Parameters
- **id** (string, path, required)
- **CreateCauseModel** (CreateCauseBindingModel, body, required): Model of the Cause
### Responses
#### 200 - The updated Cause
Empty response body
#### 400 - Please examine the response message
Please examine the response message
#### 403 - Resource is not available for update
Resource is not available for update
#### 500 - An unexpected error occurred
An unexpected error occurred
### Example Usage
```bash
curl -X PUT "https://api.example.com/v1/Causes/{id}"
```
```
--------------------------------
### DELETE /v1/Vouchers/{id}
Source: https://api.pennybridge.org/swagger/docs/V1
API endpoint for DELETE /v1/Vouchers/{id}
```markdown
### Parameters
- **id** (string, path, required)
### Responses
#### 200 - The updated Voucher
Empty response body
#### 404 - A Voucher was not found
A Voucher was not found
#### 409 - Requested action could not be performed due to conflicting state.
Requested action could not be performed due to conflicting state.
#### 500 - An unexpected error occurred
An unexpected error occurred
### Example Usage
```bash
curl -X DELETE "https://api.example.com/v1/Vouchers/{id}"
```
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.